![](https://csdnimg.cn/release/download_crawler_static/86154315/bg4.jpg)
figure;
f=-500:500;
yy1=fftshift(fft(y1));
plot(f,abs(yy1));
title('f=1000ƵÆ×');
[y2,t2]=sig(0,1/300,1);
figure;
plot(t2,y2);
axis([0 0.15 -10 150]);
title('f=300ʱÓòÐźÅ');
figure;
yy2=fftshift(fft(y2));
plot(-150:150,abs(yy2));
title('f=300ƵÆ×');
[y3,t3]=sig(0,0.02,1);
figure;
plot(t3,y3);
title('f=200ʱÓòÐźÅ');
axis([0 0.15 -8 5]);
figure;
yy3=fftshift(fft(y3));
plot(-25:25,abs(yy3));
title('f=200ƵÆ×');
第二部分主程序:
xb=impseq(0,0,100);
figure;
stem(0:length(xb)-1,xb);
axis([-1,3,0,2]);
figure;
y1=fft(xb);
plot(0:length(y1)-1,y1);
hb=impseq(0,0,100)+2.5.*impseq(1,0,100)+2.5.*impseq(2,0,100)+impseq(3,0,100);
figure;
stem(0:length(hb)-1,hb);
axis([-1,5,0,3])
figure
y2=fftshift(fft(hb));
plot(-(length(y2)-1)/2:(length(y2)-1)/2,abs(y2));
figure;
y3=conv(double(xb),double(hb));
plot(0:length(y3)-1,y3);
y4=fftshift(fft(y3));
figure;
plot(-(length(y4)-1)/2:(length(y4)-1)/2,abs(y4));
可复制、编制,期待你的好评与关注!