Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I'm sampling a signal at 44100kHz, and I have 1024 samples on which I perform an FFT. My bin resolution is therefore around 43 hz/bin, so the frequencies I get energy for are multiples of 43hz: 43Hz,86Hz,129Hz etc...

The problem is that I the frequency I need to calculate the energy for lies between those bins! Specifically, I have: BIN[389]= 16750 Hz BIN[390]= 16793 Hz but I wish to calculate the energy for 16781Hz, 16824Hz,...

Is there a mathematical manipulation I can pull off to get the info I need? zero padding? Or perhaps multiplying my sample by an exponent before performing an FFT?

Thanks for the help

share|improve this question

2 Answers 2

up vote 4 down vote accepted

It's actually possible to pre-multiply the signal with a complex exponential and thus shift the center frequencies of the FFT bins. Particular useful is multiplication that shifts by half a bin since it maintains complex conjugate symmetry for real valued time domain signals and you end up with N/2 complex at N/2 frequencies instead with N/2+1 frequencies with N/2-1 complex numbers and two real numbers (Nyquist and DC).

However, it really depends what you are trying to do. The interpretation of the FFT magnitude as a "energy" is a bit problematic. You are NOT just getting energy at the center frequency but a weighted sum of of the energies over a bunch of frequencies, where the weighting function has roughly a sin(x)/x shape. The frequency selectivity of an FFT is actually not particularly good and it's not a great tool to actually calculate the energy in a specific frequency band.

Zero padding can also be used to increase the frequency resolution, however you need to keep in mind that the FFT assumes discrete and PERIODIC signals so zero padding can only be done on signals that are trailing off sufficiently (like the impulse response of a filter) or when windowing is applied to mitigate the transition between signals and zeros.

share|improve this answer
    
"The frequency selectivity of an FFT is actually not particularly good and it's not a great tool to actually calculate the energy in a specific frequency band." I have several specific frequencies, which may or may not contain energy. I need to know which ones do and which ones don't. In order to quantify "do" and "don't" I compare their fft values to those of the bins in between. So if wish to know if there's energy in bin 200 I will compare it's value to 198,199,201,202. Can you suggest a different way? –  Daniel Jan 8 '13 at 7:30
    
It really depends on the bandwidth of the signal you are looking for and the nature of the signals in the other bands. FFT may work just fine if the signal you need is a steady state sine wave and the rest is gaussian noise –  Hilmar Jan 8 '13 at 14:26
    
One alternative is to multiply the signal with the sine wave of the frequency to detect and follow that with a low pass filter of the desired bandwith and some detector. You can do two low pass filters "wide" and "narrow". If the output is the same, then your sine wave is there, if "wide" is sufficiently bigger than "narrow", it's not. –  Hilmar Jan 8 '13 at 14:28
    
thanks, I'll give it a shot –  Daniel Jan 9 '13 at 9:44

If you used a rectangular window (e.g. the same as no window) on your signal before the FFT, then you can interpolate any point between bin centers using a Sinc interpolation kernel (a short window-ed Sinc interpolation kernel may be a good enough approximation).

Zero-padding and using a longer FFT is the same as this interpolation, and may be computationally less effort if you need a lot of interpolated points.

Note that a "bin" contains not just one frequency, but really contains the result of a bandpass filter about 1 to 2 bins in width (and with lots of stop-band ripple unless using a suitable non-rectangular-shaped window).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.