Why the amplitude of fft computing is a little bit different from a known value?
이전 댓글 표시
I was trying test this:
n=5000;
ts=5;
t=[0:ts/n:ts];
x1=sin(2*pi*20*t);
x2=2*sin(2*pi*60*t);
x3=20*sin(2*pi*200*t);
x4=15*sin(2*pi*350*t);
x=x1+x2+x3+x4;
N=length(x);
k=[0:N-1];
T=N/Fs;
freq=k/T;
cutoff=ceil(N/2);
X=fftn(x)/(N/2);
X=abs(X);
stem(freq(1:cutoff),X(1:cutoff))
The magnitudes got different results to 1 (x1); 2 (x2); 20 (x3) and 15 (x4). And more...if "n" has more or less points for computing the fft, the frequencies (20, 60, 200, 350) also change. Why? Can someone help me? Thanks a lot.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!