0% found this document useful (0 votes)
18 views1 page

All All: 1 Butterworth Filter Using BILINEAR

This document contains MATLAB code to design and analyze a Butterworth filter. It specifies passband and stopband ripple values, calculates the filter order using buttord, designs the filter transfer function using butter, converts it to the bilinear transform and plots the magnitude response. The code designs a Butterworth lowpass filter, transforms it to the bilinear domain and plots the magnitude response.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

All All: 1 Butterworth Filter Using BILINEAR

This document contains MATLAB code to design and analyze a Butterworth filter. It specifies passband and stopband ripple values, calculates the filter order using buttord, designs the filter transfer function using butter, converts it to the bilinear transform and plots the magnitude response. The code designs a Butterworth lowpass filter, transforms it to the bilinear domain and plots the magnitude response.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

clc;

close all;
clear all;
D1=0.6;%PASSBAND RIPPLE
D2=0.1;%STOPBAND ATTENUATION
wp=0.7*pi%digital passband
ws=0.35*pi%digital stopband
T=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,'s')
tf(n,d);
disp('Denormalized')
[n1,d1]=butter(N,CF,'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);
plot(w,abs(h))
title('Butterworth filter using BILINEAR')
xlabel('frequency')
ylabel('magnitude')
grid on

Butterworth filter using BILINEAR

1
0.9
0.8

m a gnitude

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

You might also like