我有一些信号和我混合分别加起来一个更大的信号,其中每个信号位于不同的频率区域。 现在,我使用FFTW对大信号执行FFT操作,并将具体的FFT分档(信号所在的位置)切出。FFT和IFFT的长度
E.g.大信号FFT变换与1024点 的信号的采样速率为fs = 200000
我计算以下面的方式给定的开始停止频率的水泥贮存箱的位置:
tIndex.iStartPos = (int64_t) ((tFreqs.i64fstart)/(mSampleRate/uFFTLen));
和例如我得到的第一个信号被削减16箱。 现在我再次用FFTW进行ifft变换,并返回16个复数值(因为我保留了16个bin的矢量)。但是,当我将提取的信号与MATLAB中的原始小信号进行比较时,我可以看到原始信号(是一个wav-File)有xxxxx数据,我的信号(我保存为原始二进制文件)具有只有16个复杂的值。
那么如何获得正确转换的iFFT操作的长度?这里分别有什么不对?
编辑 逻辑本身被分成3个程序,每个程序都在多线程的环境中。出于这个原因我在这里发表一些伪代码:
ReadWavFile(); //returns the signal data and the RIFF/FMT header information
CalculateFFT_using_CUFFTW(); //calculates FFT with user given parameters, like FFT length, polyphase factor, and applies polyphased window to reduce leakage effect
GetFFTData(); //copy/get FFT data from CUDA device
SendDataToSignalDetector(); //detects signals and returns center frequency and bandwith for each sigal
Freq2Index(); // calculates positions with the returned data from the signal detector
CutConcreteBins(position);
AddPaddingZeroToConcreteBins(); // adds zeros till next power of 2
ApplyPolyphaseAndWindow(); //appends the signal itself polyphase-factor times and applies polyphased window
PerformIFFT_using_FFTW();
NormalizeFFTData();
Save2BinaryFile();
- >然后分析了MATLAB数据(是在工作的那一刻)
请问您可以发布您的代码吗?这会使你的描述更加清晰,也可能代码没有正确地遵循你的描述。 – buzjwa
什么wav文件你有200000的采样率?疯。 – dmedine
IFFT输入的长度与您想要输出的长度(例如1024,与放入第一个FFT的数据的长度相同)不会更短(例如16而不是1024)。如果你想要真正的结果,IFFT的输入也必须是共轭对称的。 – hotpaw2