From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 40/CH6/EX6.9/Exa_6_9.sce | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 40/CH6/EX6.9/Exa_6_9.sce (limited to '40/CH6/EX6.9/Exa_6_9.sce') diff --git a/40/CH6/EX6.9/Exa_6_9.sce b/40/CH6/EX6.9/Exa_6_9.sce new file mode 100755 index 000000000..3e8500a97 --- /dev/null +++ b/40/CH6/EX6.9/Exa_6_9.sce @@ -0,0 +1,29 @@ +//Periodic notch filter design at 60 HZ and sampling frequency 300HZ +z=%z; +f=0:(0.5/400):0.5; +z1=exp(%i*2*%pi*f); +for i=1:401 + H1Z(i)=(z1(i)^5-1)/((z1(i)^5)-(0.9^5)); + H2Z(i)=(z1(i)^5-1)/((z1(i)^5)-(0.99^5)); +end +H1Z=abs(H1Z); +H2Z=abs(H2Z); +N1z=(1-z^-5)/(1-z^-1); +H3z=(N1z)/(horner(N1z,z/0.9)); +H4z=(N1z)/(horner(N1z,z/0.99)); +H3z=horner(H3z,z1); +H4z=horner(H4z,z1); +a=gca(); +a.x_location="origin"; +a.y_location="origin"; +plot2d(f,H1Z); +plot2d(f,H2Z); +xlabel('Digital frequency f'); +ylabel('magnitude'); +xtitle('Periodic Notch Filter N=5,R=0.9,0.99'); +xset('window',1); +plot2d(f,H3z); +plot2d(f,H4z); +xlabel('Digital frequency f'); +ylabel('magnitude'); +xtitle('Notch Filter that also passes DC N=5,R=0.9,0.99'); -- cgit