Reputation: 85
I am trying to create a spectral analyzer plugin using C++; After the FFT, I would like to somehow average each bin using RMS. The reason being is because I want the frequency plot to display at a slower rate for better viewing. How can I achieve this? To be a little more specific, I have a FFT with a sample size of 4096 with a sampling frequency of 44,100 HZ. I'm updating the display every 40 ms. Each FFT frame is displaying to fast for the human eye. How can I smooth this out by some type of averaging?
Thanks,
Isaiah Thompson
Upvotes: 0
Views: 355
Reputation: 180145
Your display updates every 40 ms are of course pointless. You have 44.100 samples per second, 4096 samples per FFT so about 11 FFT's per second. That's one every 90 ms, not 40 ms.
Furthermore, the common way to display this is as a spectrogram. Don't use a 4096 bin FFT, that's overkill anyway. Instead, use a 1024 point FFT. You'll now get 44 FFT's per second. Color-code each bin, and plot each FFT on a vertical line. The horizontal axis is the time axis. You can now show half a minute of FFT's on a single screen, and it will horizontally scroll at 44 pixels/second. This is slow enough for the eye to track.
Upvotes: 0