Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: 800 spectral lines out of 1024 FFT outputs

$
0
0
The amplitude of the FFT result is directly correlated to the length of "real" samples (non-zero). In fact the definition of the FFT can be interpreted as the cross-correlation of an input signal with complex sinusoids at each frequency bin. When we have 1600 real samples and pad the remaining samples with zero we are really only multiply-and-accumulating 1600 samples, the zero padded samples add nothing to the result. Doing the same with 2048 real samples will accumulate more samples and have a larger amplitude as a result. If the input signal is perfectly correlated and periodic within the window the amplitude of 1600 samples should be exactly 0.78125 that of the amplitude of 2048 samples (1600 / 2048 = 0.78125). In reality the ratio of amplitudes probably won't be exact but should be fairly close and can be used as an approximation. Without even taking into account the accuracy of ADC samples the amplitude will vary depending on how periodic the signal is and windowing used. A signal that may be periodic within 2048 samples probably won't be periodic within 1600 samples and the end "edge" will cause spectral leakage into adjacent frequency bins. A good best practice is to use a simple window function (such as hanning window) that forces the signal to be periodic within the FFT window. This isn't so much an MSP question but more of a signal processing theory question that can be answered by understanding the concepts and math behind the FFT. The same problems will be present no matter what platform and precision you are using, whether it's fixed-point on MSP or double precision floating-point in MATLAB. Understanding how the FFT works and why will help you to get the most out of your application and algorithms. Regards, Brent

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>