In this article, I am showing the article on how to design Butterworth Filter and Chebyshev Filter using Matlab Code.
clc;
clear all;
close all;
rp = input('enter the passband atteunuation ');
rs = input('enter the stopband attenuation ');
wp = input('enter the passband frequency ');
ws = input('enter the stopband frequency ');
[n,wn] = buttord(wp,ws,rp,rs,'s');
display(n);
display(wn);
[z,p,k] = buttap(n);
display(z);
display(p);
display(k);
[b,a] = butter(n,1,'low','s');
display(b);
display(a);
[bt,at] = lp2lp(b,a,wn);
display(bt);
display(at);
H = tf(b,a);
display(H);
y = logspace(-10,10);
freqs(bt,at,y);
clc;
clear all;
close all;
rp = input('enter the input attenuation ');
rs = input('enter the stop band attenuation ');
wp = input('enter the passband frequency ');
ws = input('enter the stopband frequency ');
[n,wn] = cheb1ord(wp,ws,rp,rs,'s');
display(n);
display(wn);
[z,p,k] = cheb1ap(n,rp);
display(z);
display(p);
display(k);
[b,a] = cheby1(n,rp,1,'low','s');
display(b);
display(a);
h = tf(b,a);
display(h);
[bt,at] = lp2lp(b,a,wn);
display(bt);
display(at);
y = logspace(-10,10);
freqs(bt,at,y);
Matlab code for designing Butterworth Filter :
clc;
clear all;
close all;
rp = input('enter the passband atteunuation ');
rs = input('enter the stopband attenuation ');
wp = input('enter the passband frequency ');
ws = input('enter the stopband frequency ');
[n,wn] = buttord(wp,ws,rp,rs,'s');
display(n);
display(wn);
[z,p,k] = buttap(n);
display(z);
display(p);
display(k);
[b,a] = butter(n,1,'low','s');
display(b);
display(a);
[bt,at] = lp2lp(b,a,wn);
display(bt);
display(at);
H = tf(b,a);
display(H);
y = logspace(-10,10);
freqs(bt,at,y);
Chebyshev Filter using Matlab :
clc;
clear all;
close all;
rp = input('enter the input attenuation ');
rs = input('enter the stop band attenuation ');
wp = input('enter the passband frequency ');
ws = input('enter the stopband frequency ');
[n,wn] = cheb1ord(wp,ws,rp,rs,'s');
display(n);
display(wn);
[z,p,k] = cheb1ap(n,rp);
display(z);
display(p);
display(k);
[b,a] = cheby1(n,rp,1,'low','s');
display(b);
display(a);
h = tf(b,a);
display(h);
[bt,at] = lp2lp(b,a,wn);
display(bt);
display(at);
y = logspace(-10,10);
freqs(bt,at,y);
Design Butterworth and Chebyshev Filter using Matlab Code
Reviewed by TECH UPDATE
on
November 15, 2019
Rating:
Great post, informative blog. You cover a good topic of this era.
ReplyDeleteIt's really unique and informative article.
Best digital Marketing company in noida
Great.....Nice and very useful information you have shared in your post. I liked it so much thanks for sharing such a wonderful post
ReplyDeleteBest digital Marketing company in noida
Thanks for sharing amazing information!!!!!!
ReplyDeletePlease keep up sharing.
I read this article. I think you put a lot of effort to create this article. I appreciate your work. Best digital Marketing company in noida