DSPRelated.com
Forums

FFT spectrum height question

Started by Peter123 October 12, 2008
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

On 13 Okt, 00:22, "Peter123" <p...@cornell.edu> wrote:
> I have implemented Jens Joergen Nielsen FFT code in my windows program > that converts V(t) to V(f). &#4294967295;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 &#4294967295;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?
It's because of Euler's equations: cos(x) = 1/2 (exp(jx)+exp(-jx)) sin(x) = 1/j2 (exp(jx)-exp(-jx))
> What correction factors should I use for the spectrum height for various > window types?
Don't bother. You will not see the exact numbers you use for the amplitudes unless the frequency of the sinusoidal is an integer fraction of the sampling frequency, f = k/N wher k and N integers and k < N/2. Rune
>On 13 Okt, 00:22, "Peter123" <p...@cornell.edu> wrote: >> I have implemented Jens Joergen Nielsen FFT code in my windows program >> that converts V(t) to V(f). =A0I am using 2500 Hz sampling with
N=3D8192 =
>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 =A0amplitude (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? > >It's because of Euler's equations: > >cos(x) =3D 1/2 (exp(jx)+exp(-jx)) >sin(x) =3D 1/j2 (exp(jx)-exp(-jx)) > >> What correction factors should I use for the spectrum height for
various
>> window types? > >Don't bother. You will not see the exact numbers you use >for the amplitudes unless the frequency of the sinusoidal >is an integer fraction of the sampling frequency, > >f =3D k/N > >wher k and N integers and k < N/2. > >Rune >
Thanks Rune. I assume 3D is the amplitude.. (why 3D?) Peter
On 14 Okt, 13:46, "Peter123" <p...@cornell.edu> wrote:
> >On 13 Okt, 00:22, "Peter123" <p...@cornell.edu> wrote: > >> I have implemented Jens Joergen Nielsen FFT code in my windows program > >> that converts V(t) to V(f). =A0I am using 2500 Hz sampling with > N=3D8192 = > >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 =A0amplitude (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? > > >It's because of Euler's equations: > > >cos(x) =3D 1/2 &#4294967295;(exp(jx)+exp(-jx)) > >sin(x) =3D 1/j2 (exp(jx)-exp(-jx)) > > >> What correction factors should I use for the spectrum height for > various > >> window types? > > >Don't bother. You will not see the exact numbers you use > >for the amplitudes unless the frequency of the sinusoidal > >is an integer fraction of the sampling frequency, > > >f =3D k/N > > >wher k and N integers and k < N/2. > > >Rune > > Thanks Rune. > I assume 3D is the amplitude.. &#4294967295;(why 3D?)
No 3D anywhere. It seems there are character coding issues when the posts are read with different readers. This is an equal sign: = In some readers it appears as '3D<equal sign>' or something like that. Rune