3
$\begingroup$

Which bins of FFT result are useful? For example I made FFT on 1024 real samples, and it produced result with 1024 complex samples.
I read somewhere, the only half of that result is useful if input samples are of type real.

Is bin number 513 (nyquist frequency) useful? Should I cut this bin or it should stay?

$\endgroup$
  • 1
    $\begingroup$ Yes, Nyquist frequency is important. You can can recreate the second half of your complex spectrum from the first one, but once you lost the bin 513, there is no way back. $\endgroup$ – jojek Mar 3 '15 at 10:05
  • $\begingroup$ @jojek: What if I dont want to recreate time doman signal. is that bin useful for analysis? $\endgroup$ – apocalypse Mar 3 '15 at 10:12
  • 1
    $\begingroup$ I always use it, since you might be interested in getting the energy of your signal from your spectrum. If you miss this frequency bin then your estimate will be off by some amount. $\endgroup$ – jojek Mar 3 '15 at 10:22
  • $\begingroup$ @jojek: check this: stackoverflow.com/a/4371627/1109215 Guy says that bin has no practical use (?) $\endgroup$ – apocalypse Mar 3 '15 at 10:26
  • $\begingroup$ Paul mentions anti-aliasing filter, meaning that this bin should contain value close to zero. Nevertheless it still contains some data, especially for generated signals on your computer. But again, do you really need it? Probably, probably not. $\endgroup$ – jojek Mar 3 '15 at 10:29
4
$\begingroup$

I believe you should use the Nyquist bin every time. By having it, you can always recreate the full DFT of your real-valued signal from the first half of spectrum. Whereas if you discard this value there is no way back and you can recreate your time domain signal.

As in answer you pointed to, usually the Nyquist bin shouldn't contain any data when while using anti-aliasing filter. Nevertheless sometimes you might want to estimate the energy of your signal from it's DFT. You might therefore get inaccurate value. Question is, do you really care about such accuracy?

Just to wrap up. I always use Nyquist bin and I don't need to ask myself these questions.

$\endgroup$
  • $\begingroup$ Does it not depend on the type of analysis that you carry out? For one, I have never used the Nyquist frequency and always discard it. $\endgroup$ – Phorce Mar 3 '15 at 11:08
  • $\begingroup$ If you don't know whether you need it or not - leave it, since it will not do any harm. $\endgroup$ – jojek Mar 3 '15 at 11:10
3
$\begingroup$

Half of the FFT transform from real data is redundant. However, the imaginary parts of bin 1 and bin 513 are zero, so that's where the redundancy in those bins is. As a result, you need bins 1 to 513 to represent the original data (you could stuff the real part of bin 513 into the imaginary part of bin 1 if you really wanted to get along with 1024 words of storage).

Your question is whether bin 513 is useful. That depends on what you are doing. It is quite unlikely that it is significantly less useful than bin 512, however.

If you are using FFT as a mechanism for implementing convolution, you won't want to lose information, so you'll need bin 513.

If you are using it as an analysis tool, it is likely that you will be working with analog prefiltering and windowing and other tools that make higher frequencies taper off. But then the tapering off will not just hit bin 513 but will affect quite a number of bins before that as well.

On its own, the FFT/DFT is a representation of the frequencies of a periodic signal with a period of 1024 (in your case). But it's rarely data from an actual circle that you are applying it on: FFT is almost always applied as a component in some more complex algorithm, using padding, windowing, overlap-add and other stuff.

What the bins mean and how important retaining every one of them is depends on just what you use the FFT for.

$\endgroup$
1
$\begingroup$

Even with an anti-alias filter, which needs to cut-off below Fs/2 for any finite length window and finite width transition band, filter roll-off noise and artifacts ("leakage") produced by convolution with the window function can end up in the middle (N/2) bin.

So reconstruction by IFFT (overlap add/save fast convolution, et.al.) and total power analysis (Parseval's) requires using the middle bin.

But any FFT result analysis that tries to ignore windowing leakage or filter stop band or left-over aliasing noise could ignore that bin (and maybe even some number of bins near it) as stuff in the noise floor.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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