📄 ks03.m
字号:
Fs=20;f=1;N=20;
n=0:N-1;
xn=2*sin(2*pi*2*f/Fs*n)+sin(2*pi*5*f/Fs*n)+3*sin(2*pi*8*f/Fs*n);
X=fft(xn,N);
subplot(3,2,1);plot(n,xn);grid
subplot(3,2,2);stem(n,abs(X),'k');grid
title('xn的幅度频谱');xlabel('rad/s');
b=[0.187632,0, -0.241242,0,0.241242,0,-0.187632];
a=[1,0,0.602012,0, 0.495684, 0,0.035924];
[h,t]=impz(b,a,N);
H=ifft(h,N);
subplot(3,2,3);stem(t,h);grid
subplot(3,2,4);plot(n,H);grid
y=conv(xn,h);
Y=ifft(y,N);
subplot(3,2,5);plot(y);grid
axis([0,N,1.1*min(y),1.1*max(y)]);
subplot(3,2,6);stem(n,abs(Y),'k');grid
title('yn的幅度频谱');xlabel('rad/s');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -