You are on page 1of 7

Jaypee Institute of Information technology

MATLAB PROJECT
On
STEPPER MOTOR MODELLING USING SIMULINK

Submitted To:

Dr.Neetu Singh

Submitted By:
MAHESHWAR NEGI
Enroll. ID-15316018
M.tech (ECE-CS)

BUTTERWORTH FILTER DESIGN


The Butterworth filter is a type of signal processing filter designed to have as flat a frequency
response as possible in the passband. It is also referred to as a maximally flat magnitude filter.
Like all filters, the typical prototype is the low-pass filter, which can be modified into a high-pass
filter, or placed in series with others to form band-pass and band-stop filters, and higher order
versions of these.
The gain
of an n-order Butterworth low pass filter is given in terms of the transfer
function H(s) as

where

n = order of filter

c = cut-off frequency (approximately the -3dB frequency)

is the DC gain (gain at zero frequency)

It can be seen that as n approaches infinity, the gain becomes a rectangle function and frequencies
below c will be passed with gain

, while frequencies above c will be suppressed. For smaller

values of n, the cutoff will be less sharp.


We wish to determine the transfer function H(s) where
Because
,

(from Laplace transform).

and, as a general property of Laplace transforms at


, if we select H(s) such that:

then, for imaginary inputs,

, we have the frequency response of the Butterworth filter.

The n poles of this expression occur on a circle of radius c at equally-spaced points, and
symmetric around the imaginary axis. For stability, the transfer function, H(s), is therefore chosen
such that it contains only the poles in the negative real half-plane of s. The k-th pole is specified
by

and hence;

The transfer( or system) function may be written in terms of these poles as

The denominator is a Butterworth polynomial in s.


ADVANTAGES AND DISADVANTAGES OF BUTTERWORTH FILTERS
Advantage is that it has the most flat passband meaning that it is very good at simulating the
passband of an ideal filter.
The disadvantage is that it has a horrible stopband because it gradually goes to zero so some parts
of the stopband are still passed. However, for an nth-order Butterworth Filter, as n increases, the
closer it is to an ideal filter. However, it is highly impractical to build a ridiculously high order
Butterworth filter.
BUTTERWORTH FILTER DESIGN USING MATLAB
% program for butterworth digital low pass filter
clc;
clear all;
close all;
rp=0.5;
rs=50;
wp=1200;
ws=2400;
fs=10000;
w1=2.*wp/fs;
w2=2.*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs);
[b,a]=butter(n,wn);
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20.*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain');
xlabel('normalised frequency');
subplot(2,1,2); plot(om/pi,an);
ylabel('phase');
xlabel('normalised frequency');

% program for butterworth digital high pass filter


clc;
clear all;
close all;
rp=0.5;
rs=50;
wp=1200;
ws=2400;
fs=10000;
w1=2.*wp/fs;
w2=2.*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs);
[b,a]=butter(n,wn,'high');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20.*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain');
xlabel('normalised frequency');
subplot(2,1,2); plot(om/pi,an);
ylabel('phase');
xlabel('normalised frequency');

% program for butterworth bandpass filter


clc;
clear all;
close all;
rp=0.3;
rs=40;
wp=1500;
ws=2000;
fs=9000;
w1=2.*wp/fs;
w2=2.*ws/fs;
[n]=buttord(w1,w2,rp,rs);
wn=[w1,w2];
[b,a]=butter(n,wn,'bandpass');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20.*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain');
xlabel('normalised frequency');
subplot(2,1,2); plot(om/pi,an);
ylabel('phase');
xlabel('normalised frequency');

% program for bandstop filter


clc;
clear all;
close all;
rp=0.4;
rs=46;
wp=1100;
ws=2200;
fs=6000;
w1=2.*wp/fs;
w2=2.*ws/fs;
[n]=buttord(w1,w2,rp,rs);
wn=[w1,w2];
[b,a]=butter(n,wn,'stop');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20.*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain');
xlabel('normalised frequency');
subplot(2,1,2); plot(om/pi,an);
ylabel('phase');
xlabel('normalised frequency');

You might also like