I have been using excel to calculate the power spectrums for both HANN and RECTANGULAR windowing with :
N - 1
DFT = X(K) =1/N ∑ x(n) ( cos (2πnk/N) - j sin (2πnk/N) )
n = 0
HANN x(n) = 0.5 (1 - cos (2πn/(N-1)))
RECTANGULAR x(n) =1
The RECTANGULAR function turns out to be ok, with 0 dB at 0 Hz. However I am having difficulty with the HANN function. It would appear from what I read online this should also be 0 dB at 0 Hz ? However when I use excel and the formulae above I get -6 dB at 0 Hz, which to be honest is what I would expect. Which is correct for the HANN function, 0 dB or -6 dB at 0 Hz ? If it is 0 dB, why do I get -6 dB ? If it is -6 dB, why do all these resources online quote 0 dB ?
N - 1
DFT = X(K) =1/N ∑ x(n) ( cos (2πnk/N) - j sin (2πnk/N) )
n = 0
HANN x(n) = 0.5 (1 - cos (2πn/(N-1)))
RECTANGULAR x(n) =1
The RECTANGULAR function turns out to be ok, with 0 dB at 0 Hz. However I am having difficulty with the HANN function. It would appear from what I read online this should also be 0 dB at 0 Hz ? However when I use excel and the formulae above I get -6 dB at 0 Hz, which to be honest is what I would expect. Which is correct for the HANN function, 0 dB or -6 dB at 0 Hz ? If it is 0 dB, why do I get -6 dB ? If it is -6 dB, why do all these resources online quote 0 dB ?