But Thigh
But Thigh
clc;
close all;
clear all;
D1=0.6;%PASSBAND RIPPLE
D2=0.1;%sTOPBAND ATTENUATION
wp=0.35*pi%digital passband
ws=0.7*pi%digital stopband
T=0.1;
os=2/T*tan(ws/2)%analog stopband frequency
op=2/T*tan(wp/2)%analog passband frequency
%Order of the filter
Rp=-20*log10(D1)%STOPBAND RIPPLE in decibel
Rs=-20*log10(D2)%PASSBAND RIPPLE in decibel
[N,CF]=buttord(op,os,Rp,Rs,'s')
% To get transfer function
disp('normailzed')
[n,d]=butter(N,1,'high','s')
s1=tf(n,d);
disp('Denormalized')
[n1,d1]=butter(N,CF,'high','s')
sys=tf(n1,d1);
[n2,d2] = bilinear(n1,d1,1/T)
tf(n2,d2,T)
w=0:0.01:pi;
h=freqz(n2,d2,w);
abs(h)
plot(w,abs(h))
title('Butterworth filter using Bilinear Technique')
xlabel('frequency')
ylabel('magnitude')
grid on
Butterworth filter using Bilinear Technique
1
0.9
0.8
m agnitude
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0.5
1.5
2
frequency
2.5
3.5