FFT spectral leak?
이전 댓글 표시
I find that in the power spectrum returned by fft the amplitude of peaks are much smaller than expected, even for artifical signals. This is in contrast to the examples given in documation
openExample('matlab/FFTOfNoisySignalExample')
I wonder what can be done to improve? Increasing sampling rate seem to have very little effect.
t=linspace(0,10,1e4);
x=1*cos(7e1*t)+2*cos(3e2*t);
%should make peaks at 70 and 300 with amplitude of 1 and 2
[omega,P1]=fft1D(t,x);
plot(omega,P1)
function [omega,P1]=fft1D(t,x)
L=numel(t);
Fs=L/(max(t)-min(t));
xfft = fft(x);
P2 = abs(xfft/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
omega = Fs*(0:(L/2))/L*2*pi;
end
댓글 수: 1
Marcel Kreuzberg
2022년 11월 9일
in the example 'matlab/FFTOfNoisySignalExample' the intervall parameters are defined first.
if you play in your example with the line t=linspace(0,10,1e4) you will get different peak values as the fft is not the exact analytic result
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spectral Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

