clear all;
fs=1000; %一周采样N=20,采样频率fs=1000 t=0:1/fs:0.02; f1=50;
x=cos(2*pi*f1*t); subplot(3,1,1); stem(t,x,'filled'); axis([0,0.03,-2,2]);
title('50H负正弦信号采样N=20'); xlabel('时间(s)');
N=20; k=0:N;
d=k-N/2; y=fft(x,N);
f=fs*d/length(y); subplot(3,1,2); plot(f,abs(y)); subplot(3,1,3);
plot(f,angle(y)*180/pi);
因篇幅问题不能全部显示,请点此查看更多更全内容