noise reduction in fir filter

i want to design a bandpass fir filter with Bartlett or hamming window,and want to reduce the pass and stop band ripple.is there any math function to describe it. plz suggest.

Answers (3)

Hi Debalina, If you want to use the window method for a bandpass filter, you can do the following (of course you need to modify the specifications to match your needs)
% I'll assume a 10-kHz sampling frequency and pass 1000-1500 Hz
d = fdesign.bandpass('N,Fc1,Fc2',10,1000,1500,10000);
% Use a Hamming window
Hd = window(d,'window',@hamming);
fvtool(Hd);
However, if you really want to control the passband and stopband ripple, then I think a different FIR design is warranted, like a constrained equiripple design. See firceqrip() for example.
sir, i have tried following your specification firceqrip(). below is my code :
clear all
Fs = 100000;
Fn = Fs/2;
N = 200;
B = 16;
fc1 = 4911/Fn; %lower cutoff
fc2 = 5645/Fn;
Fc = [ fc1 fc2];
w = bartlett(N+1);
w = w/max(w);
w = round(w.*((2^(B-1))-1));
b = firceqrip(N,Fc,'bandpass',w);
Hd = dfilt.dffir(b);
Hd.arithmetic = 'fixed'; % Requires the Fixed-Point Toolbox
coewrite(Hd,16,'nrduce_bfcoefile');
Error in ==> firceqrip at 394
rs = [fo*(0:n1-1)/n1, fo, fo+(1-fo)*(1:n2)/n2]';
Error in ==> nooiserbar at 12
b = firceqrip(N,Fc,'bandpass',w);
please help

1 Comment

You seem to have trimmed out the basic message about what error it thinks is occurring ?

Sign in to comment.

debalina ghosh
debalina ghosh on 9 Jan 2012
sir,
my error is Error in ==> firceqrip at 394 rs = [fo*(0:n1-1)/n1, fo, fo+(1-fo)*(1:n2)/n2]'; Error in ==> nooiserbar at 12 b = firceqrip(N,Fc,'bandpass',w); sir, i could not understood how would i rectify it.please help

1 Comment

MATLAB never simply says that there is an error: it says what kind of error there is. For example, it might be displaying an error "vertcat error"

Sign in to comment.

Products

Tags

No tags entered yet.

Asked:

on 6 Jan 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!