📄 program_8_7.m
字号:
% Program 8_7
% Illustration of Lowpass Digital Filtering
%
clf
% Generate the input sequence
k =3D 1:51;
w1 =3D 0.8*pi;w2 =3D 0.1*pi;
A =3D 1.5;B =3D 2.0;
x1 =3D A*cos(w1*(k-1)); x2 =3D B*cos(w2*(k-1));
x =3D x1+x2;
si =3D [0 0 0];
b =3D 0.0662272*[1 3 3 1];
a =3D [1 -0.9356142 0.56712691 -0.10159107];
y =3D filter(b,a,x,si);
stem(k-1,x2);axis([0 50 -2 2]);
xlabel('Time index n'); ylabel('Amplitude');
title('Desired component of the input sequence');
pause
stem(k-1,y);
xlabel('Time index n'); ylabel('Amplitude');
title('Output sequence generated by function filter ');
pause
si =3D [0 0 0];
y2 =3D filtfilt(b,a,x);
stem(k-1,y2);
xlabel('Time index n'); ylabel('Amplitude');
title('Output sequence generated by function =
filtfilt');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -