%to plot the frequency
response of a system
b=[1,0,.9];
%numerator coefficients of system1
a=[1,0,.4];
%denominator coefficients of system1
d=[1,-1];
%nulmerator coefficients of system2
f=[1,0.25];
%denominator coefficients of system2
[h,ph]=freqz(b,a);
[h1,ph1]=freqz(d,f);
subplot(2,2,1);
plot(ph/pi,abs(h));
grid;
ylabel('magnitude');
xlabel('normalised
frequency');
subplot(2,2,2);
plot(ph1/pi,abs(h1));
grid;
ylabel('magnitude');
xlabel('normalised
frequency');
subplot(2,2,3);
plot(ph/pi,angle(h));
grid;
xlabel('normalised
frequency');
ylabel('phase
in radians');
subplot(2,2,4);
plot(ph1/pi,angle(h1));
grid;
xlabel('normalised
frequency');
ylabel('phase
in radians');
No comments:
Post a Comment