I have implemented Jens Joergen Nielsen FFT code in my windows program that converts V(t) to V(f). I am using 2500 Hz sampling with N=8192 point FFT. I am plotting the FFT amplitude as sqrt(Re^2 + Im^2)/N. Im getting the correct peak frequency after FFT, however, I am getting only about 1/2 of the peak amplitude (of the input sine wave input amplitude) with rectangular window. (If my input wave is 20.0*sin(omega*t) the FFT gives ~10 for peak height at omega). Using various windows (Hamming, Bartlett, etc) the V(f) peak amplitude becomes even smaller. Any suggestion why do I get 1/2 peak heights? What correction factors should I use for the spectrum height for various window types? Appreciate all help. Peter
FFT spectrum height question
Started by ●October 12, 2008
Reply by ●October 12, 20082008-10-12
On Oct 12, 10:50 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:> > Using various windows (Hamming, Bartlett, etc) the V(f) peak amplitude > > becomes even smaller.Well yeah, a window function basically "fades" the signal in and out slowly, so it spends almost all of the time at less than "full volume". You'll want to correct for that with the integral of the window function - essentially the area under the curve. If it gets too hard to figure out, just feed it a full scale input (constant valued if you want) and take the output that produces as a baseline to figure out an empirical scale factor. If you at some point implement this in fixed point, you'll have to think a bit about pre-scaling vs. post-scaling to make sure you don't overflow your word length at any point in the process.
Reply by ●October 13, 20082008-10-13
Peter123 wrote:> I have implemented Jens Joergen Nielsen FFT code in my windows program > that converts V(t) to V(f). I am using 2500 Hz sampling with N=8192 point > FFT. > I am plotting the FFT amplitude as sqrt(Re^2 + Im^2)/N. Im getting the > correct peak frequency after FFT, however, I am getting only about 1/2 of > the peak amplitude (of the input sine wave input amplitude) with > rectangular window. (If my input wave is 20.0*sin(omega*t) the FFT gives > ~10 for peak height at omega). > Using various windows (Hamming, Bartlett, etc) the V(f) peak amplitude > becomes even smaller. > > Any suggestion why do I get 1/2 peak heights?Are you also including the part at V(-f)? -- glen