If I reduce the number of samples used for an FFT (increasing the width of the frequency bins), is it correct to say that the energy in two bins with smaller frequency bins (eg. 10kHz-20kHz and 20kHz-30kHz) is equivalent to the energy in a single, larger bin (e.g. 10kHz-30kHz)?
Electronic – FFT Frequency Bin – Impact on Energy Totals
audiofftultrasound
Related Solutions
The maximum sample rate of the device is 2Mhz, this is just something else that I don't understand, how can I detect 100Mhz+ signal if the maximum sample rate is 2Mhz ?
You can't, at least not unambiguously if there are other signals that are of a lower frequency in the input.
Anyway, if I understand correctly, the maximum frequency in FFT is 1Mhz, via nyquist, my question is, how can I find the bin that corresponds to the 148Mhz signal ? I can see a spike that corresponds to the signal but I want to be able to index into the bins and find it.
Probably reason why you see a spike that corresponds to the signal is because you're experiencing aliasing. There's no way to unambiguously detect the \$148.369\text{ MHz}\$ signal without a sufficiently high sample rate. It could actually be a much lower frequency signal.
For example, if I try to sample a \$2\text{ kHz}\$ sine wave signal with a sampling rate of \$1.5\text{ kHz}\$, the ADC reconstruction of the signal might end up actually being \$0.5\text{ kHz}\$, so there's no way to tell the difference between a \$2\text{ kHz}\$ or a \$0.5\text{ kHz}\$ signal using only the data acquired by an ADC. That's why ADCs are often used with an analog low-pass antialiasing filter to avoid the problem.
If you want to detect this \$148.369\text{ MHz}\$ signal, you need to either sample the signal at more than twice that frequency (the more, the better), or use an alternative strategy that does not involve directly looking for the \$148.369\text{ MHz}\$ signal.
For example, you can mix the signal with another (sine wave) signal generated by a local oscillator and look for the beat frequencies instead of the \$148.369\text{ MHz}\$ signals. You can then use an ADC and antialiasing filter filter to look for them. A proper choice of the local oscillator frequency would create beat frequencies much less than the sampling rate of the system.
This is actually the technique used in some (all?) radios to tune to a specific frequency, called heterodyning.
Since you are working with a fixed sample rate, your FFT length (which will require your window to be at the same width) will increase your frequency resolution. The benefit of having a finer frequency resolution is twofold: the apparent one is that you get a finer freqeuecy resolution, so that you might be able to distinguish two signals that are very close in frequency. The second one is that, with a higher frequency resolution, your FFT noise floor will be lower. The noise in your system has a fixed power, unrelated to the number of points of your FFT, and that power is distributed evenly (if we're talking white noise) to all your frequency components. Thus, having more frequency components mean that individual noise contribution of your frequency bins will be lowered, while the total integrated noise stays the same, which results in a lower noise floor. This will allow you to distinguish a higher dynamic range.
However, there are drawbacks to using a longer FFT. First one is that you'll need more processing power. The FFT is a O(NlogN) algorithm, where N is the number of points. While it may not be as dramatic as the naive DFT, the increase in N will start to bleed your processor, especially if you're working in the confines of an embedded system. Secondly, when you increase N, you're gaining frequency resolution while you're losing time resolution. With a bigger N, you need to take more samples to arrive at your frequency domain result, which means that you need to take samples for a longer time. You will be able to detect a higher dynamic range and finer frequency resolution, but if you're looking for spurs, you'll have a less clear idea about WHEN that spur occurred exactly.
The type of window you should use is a whole other subject, which I'm not that informed to give you an answer to WHICH one is better. However, different windows have different output characteristics, of which most(if not all) are reversible post processing the FFT result. Some windows may make your frequency components bleed to side bins (if I'm not mistaken, the Hanning window makes your components appear on three bins.), others may give you a better frequency accuracy while introducing some gain error to your components. This is completely dependent to the nature of result you're trying to achieve, so I'd do some research (or some simulations) to arrive at which one is the best for your specific application.
Related Topic
- Electronic – Relationship of FFT Size, Sampling Rate and Buffer Size
- An intuitive question on the meaning of bins in a power spectrum of FFT
- Electronic – the meaning of the fourier transform results
- Electronic – Performing FFT at low frequencies but high resolution
- Electronic – Bucketing FFT into one-third octave bands
Best Answer
One of the most useful ways of handling this sort of question with FFTs is to use Parseval's Theorem. Paraphrasing loosely, it says that if you have a signal, it doesn't matter whether you compute its energy by summing the power in each time sample, or the energy in each frequency bin, you necessarily get the same answer - because it's the same signal.
If you keep the sample rate the same, and halve the number of samples you take, then you've halved the length and so halved the total energy in the signal.
Halving the number of samples will halve the number of frequency bins, while doubling their width.
Half the total energy, half the number of frequency bins, therefore the energy in each bin stays the same.