Study BUTTERWORTH Analog Filters (Low Pass Filter) .: AIM:-Apparatus Req. Theory: - Algorithm
Study BUTTERWORTH Analog Filters (Low Pass Filter) .: AIM:-Apparatus Req. Theory: - Algorithm
EXPERIMENT NO:-05
Theory:_
Algorithm:-
Program:-
clc;
close all; clear all;
format long;
rp=input('enter the pass band ripple....');
rs=input('enter the stop band ripple');
wp=input('enter the pass band frequency...');
ws=input('enter the stop band frequency...');
fs=input('enter the sampling frequency...');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
[j,p,k]=butter(n,wn);
[b,a]=butter(n,wn,'s');
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain in DB->');
xlabel('(a)normalised frequency...->');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b)normalised frequency...->');
ylabel('phase in radian..->');
As an Example:-
Theory:_
Algorithm:-
Program:-
clc;
close all;
clear all;
format long
rp=input('Enter the passband ripple....');
rs=input('Enter the stopband ripple...');
wp=input('Enter the passband ripple....');
ws=input('Enter the stopband ripple...');
fs=input('Enter the smpling frequency...');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
[b,a]=butter(n,wn,'high','s');
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('Gain in decibel----->');
xlabel('(a)normalised frequency---->');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b)normalised frequency---->');
ylabel('Phase in radians----->');
Output Waveform