FIR FILTER DESIGN
#1

Procedure:-
1) Get the sampling frequency
2) Get the pass band frequency
3) Get the stop band frequency or transition width
4) Get the pass band ripple and stop band attenuation
5) Select the window suitable for the stop band attenuation
6) Calculate the order ,N, based on the Transition width
7) Find the N window coefficients
8) Find truncated impulse response of h[n]
9) Verify the frequency response of h[n]

MATLAB program for FIR filter
Code:
clear
clc
close all
% ENTER THE SAMPLING FREQUENCY
Fs = 8000;
%NORMALIZED FREQUENCY = Fs/2
Fn = Fs/2;
% ENTER THE PASSBAND FREQUENCY
fp = 1500;
% ENTER THE TRANSITION WIDTH
tw = 500;
%NORMALIZE THE TRANSITION WIDTH TO NYQUIST FREQUENCY
twn = tw/(Fs/2);
% ENTER THE STOPBAND ATTENUATION
As = 35

% CHECK WHICH WINDOW SATISFIES THE STOPBAND ATTENUATION AND
% CALCULATE THE ORDER, HERE OPTION FOR TWO WINDOWS IS GIVEN
if As <= 21
    N = ceil(2/twn)
    wn = bpxcar(N);
    disp('Rectangular window')
elseif As > 21
    N = ceil(6/twn)
    wn = blackman(N);
    disp('blackman window')
end

% CALCULATE NORMALIZED CUT-OFF FREQUENCY
fc = (fp+tw)/(Fs/2);

% truncated IDEAL IMPULSE RESPONSE COEFFICIENTS
hd = fir1(N-1,fc,boxcar(N))
%WINDOWED RESPONSE COEFFICIENTS
hn= fir1(N-1,fc,wn)
% PLOT THE WINDOWED RESPONSE COEFFICIENTS

plot(0:N-1,hn);
title('FIR filter coefficients')
% CALCULATE THE FREQUENCY RESPONSE AND PLOT IN A NEW FIGURE
[H,f] = freqz(hn,1,512,Fs);
mag = 20*log10(abs(H));
figure
plot(f,mag);
xlabel('frequency(Hz)-->');
ylabel('magnitude(dB)-->');
title('SMagnitude response');
grid on;

RESULT:- FIR FILTER DESIGN
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: c code of fir filter, telephine dailing syastem fir the blind pdf, anchoring fir farewell, two band hybrid fir iir filter for image compression source code, averaging fir filter verilog, air cooling system fir i c, verilog code for fir filter pdf free download,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  C PROGRAM TO IMPLEMENT FIR FILTER seminar class 0 2,674 06-05-2011, 04:09 PM
Last Post: seminar class
  Mat Lab Program to Generate ‘FIR Filter-Low Pass’ Coefficients seminar class 0 1,555 06-05-2011, 03:59 PM
Last Post: seminar class
  USING MATLAB TO DETERMINE FILTER COEFFICIENTS: Using FIR1 Function on Matlab seminar class 0 2,312 06-05-2011, 03:58 PM
Last Post: seminar class
  FINITE IMPULSE RESPONSE FILTER (FIR) seminar class 0 1,283 06-05-2011, 03:57 PM
Last Post: seminar class
  IIR FILTER DESIGN seminar class 0 1,519 06-05-2011, 03:43 PM
Last Post: seminar class

Forum Jump: