FREQUENCY RESPONSE OF A DIGITAL SYSTEM
%to plot the frequency response
of a digital system
b=ones(1,5);
%FIR system1
a=[1];
d=[1,-1];
%FIR system2
f=[1];
w=0:.01:2*pi;
[h,ph]=freqz(b,a,w);
[h1,ph1]=freqz(d,f,w);
magh=abs(h);
angh=angle(h);
angh1=angle(h1);
magh1=abs(h1);
subplot(2,2,1);
plot(ph/pi,magh);
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,angh);
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