clc;
clear;
Y_vect = [1 -0.5 0.25]; % Coefficient of numerator
X_vect = [1 2 0 1]; % Coefficient of denominator
figure(1) % Figure of Z-plane, "*" means polars, "o" means zeros.
zplane(Y_vect, X_vect);
figure(2) % Figure of Time-domain Impulse response
impz(Y_vect, X_vect);
legend('h(n)')
t = 0 : 100
Input = 5 + 3*cos(0.2*pi*t) + 4*sin(0.6*pi*t) ; % Generate input signal
Output = filter(Y_vect, X_vect, Input); % Response of input signal
figure(3) % Figure of Response for x(n)
subplot(2,1,1);
stem(Input, 'filled');
legend('x(n)')
subplot(2,1,2);
stem(Output,'filled');
legend('y(n)')
多给点分,谢谢!