Accurately calculate the spectrum energy (scaling, window and other concerns)

1 次查看(过去 30 天)
Hi,
I am studying on how to calculate the energy within a frequency band. I tried to use the psd function as well as the fft function. The code is as follows.
h = spectrum.periodogram('Hann');
Hpsd = psd(h,xframe,'NFFT',2^13,'Spectrumtype','Twosided','Fs',Fs);
and
frame_fft = abs(fft(xframe.*hann(length(xframe)),2^13));
frame_psd = frame_fft.^2/Fs/length(xframe);
I found that the Hann window used in each function has a different gain, which leads to the different results.
So my question is how to get a PSD with accurate values (w/wo window function)? In addition, could anybody please explain why we need to divide the Fs and frame length to normalize the scale? I tried to look into the psd function but couldn't understand the 'KMU' variable which is the 'Normalizing scale factor'.
Any help will be appreciated, Bach

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by