English 中文(简体)
如何解释KissFFT s kiss_fftr(FFT用于真实信号)的功能
原标题:How to interpret the result from KissFFT s kiss_fftr (FFT for a real signal) function
  • 时间:2011-11-01 21:09:22
  •  标签:
  • fft
  • kissfft

I m using KissFFT s real function to transform some real audio signals. I m confused, since I input a real signal with nfft samples, but the result is nfft/2+1 complex frequency bins.

www.un.org/Depts/DGACM/index_spanish.htm From KissFFT s README:

The real (i.e. not complex) optimization code only works for even length ffts. It does two half-length FFTs in parallel (packed into real&imag), and then combines them via twiddling. The result is nfft/2+1 complex frequency bins from DC to Nyquist.

因此,我不知道如何解释结果。 我的假设是,数据包装如下:r[0]i[0]r[0]r[nfft/2]i [nfft/2],其中r[0]将是DC, i[0]是第一个频率,第1卷,第1卷,第2页,等等。 情况如何?

最佳回答

是的。 原因是,真的信号是混杂的。 对应负频率的系数(-pi:0 或 pi:2pi , 无论以何种方式来思考)是[0:pi]的系数。

Note the out[0] and out[Nfft/2] bins (DC and Nyquist) have zero in the imaginary part. I ve seen some libraries pack these two real parts together in the first complex, but I view that as a breach of contract that leads to difficult-to-diagnose, nearly-right bugs.

管道:如果你在数据类型上使用浮标,你可以将输出阵列投到浮体*(c99)或 st:比较法*(c++)。 kiss_fft_cpx ruct的包装是相容的。 之所以如此,是因为Kiss_fft与其他类型的平方浮线和双倍,以及缺乏这些特征的老的ANSI C编纂者。

这里有一个相反的例子(假设99名汇编者和类型=float)

float get_nth_bin_phase(const float * in, int nfft, int whichbin )
{
  kiss_fftr_cfg st = kiss_fftr_alloc(1024,0,0,0);
  float complex * out = malloc(sizeof(float complex)*(nfft/2+1));
  kiss_fftr(st,in,(kiss_fft_cpx*)out);

  whichbin %= nfft;
  if ( whichbin <= nfft/2 ) 
    ph = cargf(out[whichbin]);
  else
    ph = cargf( conjf( out[nfft-whichbin] ) );
  free(out);
  kiss_fft_free(st);
  return ph;
}
问题回答

r *** 和1.1 result结果构成一种复杂的病媒。 两部分加在一起,给你一个规模(两个组成部分的面积)和一个频率二的阶段(通过点2())。





相关问题
Spectrogram C++ library [closed]

For my current project in C++ / Qt I need a library (LGPL is preferred) which can calculate a spectrogram from a signal ( basically an array of doubles ). I already use Qwt for the GUI part. Any ...

Coding UnsharpMask without Fourier functions

I am doing some image processing code in C#, but I cant use any libraries or GNU like code. The UnsharpMask function depends on Gaussian blur which in turn depends on Fourier Transforms. I wrote ...

How can I create an FFT graph in MATLAB?

I have data for the y axis of a graph and I need to perform an FFT on the data and plot it. I don t have much experience with MATLAB, so any help will be very appreciated.

Using Core Audio to extract floats from AIFF

Is there a way using Core Audio on OS X to extract a set of frames in an AIFF file into an array of 32-bit floats suitable for performing an FFT on?

Audio File FFT in an OS X environment

I m looking to perform an FFT on a linear PCM audio file (with potentially more than one audio channel) on OS X. What is the best way to go about this? Several sources have indicated that Apple s ...

Magnitude of FFT result depends on wave frequency?

I m baffled by the results I m getting from FFT and would appreciate any help. I m using FFTW 3.2.2 but have gotten similar results with other FFT implementations (in Java). When I take the FFT of a ...

spike in my inverse fourier transform

I am trying to compare two data sets in MATLAB. To do this I need to filter the data sets by Fourier transforming the data, filtering it and then inverse Fourier transforming it. When I inverse ...

How to use numpy with portaudio to extract bass, mid treble

As in this example How to extract frequency information from an input audio stream (using PortAudio)? I m curious about portaudio and numpy... I m not 100% sure about fft, how can I pass numpy a ...

热门标签