Digital Signal Processing Reference
In-Depth Information
%[xp,yp]=ginput(1) ;text(xp,yp, 'O
--- Non-linear Phase of IIR Filter ')
%[xp,yp]=ginput(1) ;text(xp,yp,'O
<
<
--- Linear Phase of FIR filter ')
%print -depsc f3_8
A.3.8 Program f 31_5
%Digital Signal Processing:A Practitioner's Approach
%Dr.Kaluri Venkata Ranga Rao, kaluri@ieee.org
%Generates figure 3.18,3.19
clear;close;
n=6;rdb=0.4;wn=0.4;
[b,a]=butter(n,wn);
N=360;
fn=linspace(0,0.5,N);
sysd=tf(b,a,1); hk=impulse(sysd);
m=abs(freqz(b,a,N));
phi=angle(freqz(b,a,N))*180/pi;
nmax=length(fn); n1=round(wn*nmax*1.1);
line_1=ones(size(fn(1:n1)))*0.92;
line_2=ones(size(fn(1:n1)))*1.02; part_1=fn(1: n1);
subplot(211);plot(fn,m,part_1,line_1,part_1,line_2);grid;
temp1=abs(roots(a));
temp=angle(roots(a)); [theta,i]=sort(temp);r=temp1(i);
subplot(111);polar(theta,r,'o');grid;
x=r.*sin(theta);y=r.*cos(theta);
[p,s]=polyfit(x,y,2);X=linspace(max(x), min(x),30);
Y=polyval(p,X); theta_x=atan(X./Y);r_x=sqrt(X.*X+Y.*Y);
hold;
polar(theta_x,r_x,'-.');
%xlabel('Butterworth Filter');
%[xp,yp]=ginput(1);text(xp,yp,'Butterworth Filter ')
%[xp,yp]=ginput(1);text(xp,yp,'
< --- 2nd Order pole trace ')
pause;
%temp1=abs (roots (b));
temp=angle(roots(b));[theta,i]=sort(temp);r=temp1(i);
%pause;
%subplot(111) ;polar(theta,r, 'o') ;grid;
%subplot (212) ;plot (fn,phi,fn,phi_new) ;grid;
%[xp,yp]=ginput(1);
%text(xp,yp, 'O
< --- Non-linear Phase of IIR Filter ')
%[xp, yp]=ginput(1);
%text(xp,yp, 'O
< --- Linear Phase of FIR filter ')
Search WWH ::




Custom Search