0% found this document useful (0 votes)
38 views9 pages

Analog Filters

Analog Filter College Notes

Uploaded by

yash.blue20000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views9 pages

Analog Filters

Analog Filter College Notes

Uploaded by

yash.blue20000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Introduction

This experiment enables a student to learn


•Basics of filter designs and different types of filter designing techniques.
• Draw the frequency response of the designed filter

Fundamental conceptual theory and virtual simulator Reference

http://vlabs.iitkgp.ernet.in/dsp/exp8/index.html#
Algorithm

1. Get the passband and stopband ripples


2. Get the passband and stopband edge frequencies
3. Get the sampling frequency
4. Calculate the order and cut-off frequency of the proposed filter
5. Find the filter transfer function coefficients
6. Draw the magnitude and phase response
MATLAB functions
1. buttord

Syntax [n,Wn] = buttord(Wp,Ws,Rp,Rs)


Description
calculates the minimum order of a digital or analog Butterworth filter required to meet a set of filter design
specifications.

Parameters Description
Wp Passband corner frequency
Ws Stopband corner frequency
Rp Passband ripple, in decibels
Rs Stopband attenuation, in decibels
n the lowest order the proposed Butterworth filter
Wn corresponding cut-off frequency
2. butter
Syntax
[b,a] = butter(n,Wn)
[b,a] = butter(n,Wn,'ftype’)
[b,a] = butter(n,Wn,'s’)

Description
Designs lowpass, bandpass, highpass, and bandstop digital and analog Butterworth filters. Butterworth filters
are characterized by a magnitude response that is maximally flat in the passband and monotonic overall.
1. Program for the design of Butterworth analog low pass filter
clc; clear all; close all;
format long;
wp=input('Please enter the first pass band frequency (Hz): ');
ws=input('Please enter the first stop band frequency (Hz): ');
rp=input('Please enter the pass band ripple: ');
rs=input('Please enter the stop band ripple: ');
fs=input('Please enter the sampling frequency: (Hz)');
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);
ylim([-300 50]);
ylabel('gain in dB');
xlabel('Normalised frequency');
subplot(2,1,2);plot(om/pi,an);
ylabel('Phase in Radian');
xlabel('Normalised frequency');
Frequency response of the designed filter
2. Program for the design of Butterworth High pass filter
clc; clear all; close all;
format long;
wp=input('Please enter the first pass band frequency (Hz): ');
ws=input('Please enter the first stop band frequency (Hz): ');
rp=input('Please enter the pass band ripple: ');
rs=input('Please enter the stop band ripple: ');
fs=input('Please enter the sampling frequency: (Hz)');
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);
ylim([-300 50]);
ylabel('gain in dB');
xlabel('Normalised frequency');
subplot(2,1,2);plot(om/pi,an); ylabel('Phase in Radian’); xlabel('Normalised frequency');
Frequency response of the designed filter
Practice Problems

1. Write a program for the design of Butterworth band pass filter.


2. Write a program for the design of Butterworth stop pass filter.
3. Write a program for the design of Chebyshev type-1 low pass filter.
4. Write a program for the design of Chebyshev type-1 High pass filter

You might also like