Professional Documents
Culture Documents
Expt. No.9
Name :- Akshay Dhawale
Roll No :- 7
Hardware used : PC
Theory : Matlab contains various routines for design and analyzing digital filter IIR. Most of
these are part of the signal processing tool box. A selection of these filters is listed below
[N, Wn] = BUTTORD(Wp, Ws, Rp, Rs) returns the order N of the lowest order digital
Butterworth filter that loses no more than Rp dB in the pass band and has at least Rs dB of
attenuation in the stop band. Wp and Ws are the pass band and stop band edge frequencies,
normalized from 0 to 1 (where 1 corresponds to pi radians/sample). For example
BUTTORD also returns Wn, the Butterworth natural frequency (or, the "3 dB frequency") to use
with BUTTER to achieve the specifications. [N, Wn] = BUTTORD(Wp, Ws, Rp, Rs, 's') does
the computation for an analog filter, in which case Wp and Ws are in radians/second. When Rp
is chosen as 3 dB, the Wn in BUTTER is equal to Wp in BUTTORD
Code:
%Design of FIR filter
clc;
clear all;
close all;
Fs = 1000;
F1 = 10;
F2 = 50;
F3 = 80;
F4 = 120;
Ts = 1/Fs;
t = 0:Ts:1;
x = sin(2*pi*F1*t)+sin(2*pi*F2*t)+sin(2*pi*F3*t)+sin(2*pi*F4*t);
subplot(2,1,1)
plot(x);
xlabel('time');
ylabel('amplitude');
subplot(2,1,2)
plot(abs(fft(x)));
xlabel('frequency');
ylabel('Amplitude of FI');
title('Magnitude spectrum of original signal');
Results:
Conclusion: In this experiment , we have successfully designed and tuned an
Infinite Impulse Response filter using MATLAB FDA Tool and we have used
BUTTORD filter to design IIR filter.