y(n) −2.56y(n −1)+2.22y(n−2)−0.65y(n−3) = x(n)+x(n−3)
close all,
clear all,
clc,
% y(n) −2.56y(n −1)+2.22y(n−2)−0.65y(n−3) = x(n)+x(n−3)
% y(n) = 2.56y(n −1)-2.22y(n−2)+0.65y(n−3) + x(n)+x(n−3)
y=[];
x=0:1:10;
for n=1:1:length(x)
if(n<6),
y(n)=0;
else
y(n) = x(n) + (1/2)*x(n-1) + 2*x(n-2) + 4*x(n-3) - x(n-5);
y(n) = 2.56*y(n -1) - 2.22*y(n-2)+0.65*y(n-3) + x(n)+x(n-3);
end
end
scrsz = get(0,'ScreenSize');
Dim=0;
figure('Position',[scrsz(1)+Dim, scrsz(2)+Dim,scrsz(3)-20,scrsz(4)-100]);
plot(x,y);
grid on,
xlabel('--- x --->');
ylabel('y(n) = 2.56*y(n -1) - 2.22*y(n-2)+0.65*y(n-3) + x(n)+x(n-3');
title('Plot: y(n) = 2.56*y(n -1) - 2.22*y(n-2)+0.65*y(n-3) + x(n)+x(n-3','FontSize',20);
Comments
Leave a comment