fft scalloping or window effect
Ältere Kommentare anzeigen
why is the magnitude higher in the plot below without using the flattop window than when it is used. I thought the flattop window should compensate for the window effect
fs=1000;
T=1/fs;
N=512;
n=0:1:512-1;
t=(0:1:N-1)*T;
xt=sin(2*pi*101.6*t);
xn=sin(2*pi*101.6/fs*n);
t=(0:1:N-1)*T;
f=fs*(0:length(xn)-1)/length(xn)
wn = flattopwin(N);
% xn=xn(:);
% xn=xn.*(wn);
Xk=fft(xn,length(xn));
% Xk=(Xk)';
G=abs(Xk);
plot(wn)
Akzeptierte Antwort
Weitere Antworten (4)
Wayne King
am 15 Feb. 2012
Hi Lisa, If you use the msspectrum method for spectrum.periodogram with the flat top window, you see that it does an awfully good job.
Fs = 1e3;
t = linspace(0,1,1000);
x = cos(2*pi*100*t);
Hft = msspectrum(spectrum.periodogram('Flat Top'),x,'Fs',1e3,'NFFT',length(x));
sqrt(2*Hft.Data(101))
Hnw = msspectrum(spectrum.periodogram,x,'Fs',1e3,'NFFT',length(x));
sqrt(2*Hnw.Data(101))
% flat top actually does a better job than no window
1 Kommentar
Lisa Justin
am 15 Feb. 2012
Wayne King
am 15 Feb. 2012
0 Stimmen
Lisa, you have to compensate for the L2 norm of the window, regardless of which window you use. Keep in mind that you are multiplying the signal by the window, which means that you are convolving the signal's spectrum with the spectrum of the window.
4 Kommentare
Wayne King
am 15 Feb. 2012
because of what I said: "you have to compensate for the L2 norm of the window", your code does not do that.
Lisa Justin
am 15 Feb. 2012
Lisa Justin
am 15 Feb. 2012
Lisa Justin
am 15 Feb. 2012
Wayne King
am 15 Feb. 2012
0 Stimmen
The L2 norm is the energy of the window, not the length.
You can use Hft.Data that has the doubles that you need.
Hft.Frequencies has the corresponding frequencies.
3 Kommentare
Lisa Justin
am 16 Feb. 2012
Wayne King
am 16 Feb. 2012
Lisa, I have told you. Hft.Data is what you want and that is type double.
Lisa Justin
am 16 Feb. 2012
Dr. Seis
am 16 Feb. 2012
0 Stimmen
Nooooo... The FFT should be scaled by the time increment (dt = 1/fs). You apply this correction to ALL the amplitudes in the frequency domain, not just the ones that aren't at 0 Hz or the Nyquist.
See my reasons here:
It has to do with the conservation of energy between the time domain and its representation in the frequency domain.
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!