Saturday, July 2, 2011

MATLAB Programs 09: Design of FIR bandpass filter


In MATLAB the function fir1() is used for the design of FIR filter.You can refer the MATLAB product help for the syntax of these functions. The program for an FIR bandpass filter is given below.

% Program to design FIR bandpass filter .

close all;
clear all;

fp=input('Enter the start and stop frequency of the pass band');
f=input(' Enter the sampling frequency');
n=input(' Enter the order of the filter');

% Normalizing the frequencies

wp=(2/f).*fp;

%Calculation of filter coefficients

b=fir1(n,wp);

%Plotting the filter response

freqz(b,1,500,f);
TITLE('Magnitude and Phase response');


%output
%Enter the start and stop frequency of the pass band[1000 2000]
%Enter the sampling frequency5000
%Enter the order of the filter50




3 comments:

latha said...

can you please give me iir bandpass filter code?

Anu Velu said...

please give a code for fir1

hooi ng said...

may i ask which window for that coding used to design fir bandpass filter?

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes