DSPRelated.com
Forums

matlab firpm

Started by Unknown June 14, 2005
Hi,

When I try to design an equiripple FIR with matlab, the script and
parameters at the end of this message results in a satisfying filter.
(0 dB at DC)
However, when I decrease Fpass to 120, the passband has a (flat) DC
attenuation +/- 33dB.

It seems that the passband suffers increasing attenuation when Fpass is
decreased below some threshold.

Has anyone an explanation for this?

thanks in advance,



Fs = 7200;  % Sampling Frequency

Fpass = 480;             % Passband Frequency
Fstop = 3000;            % Stopband Frequency
Dpass = 0.06;  % Passband Ripple
Dstop = 1e-007;          % Stopband Attenuation
dens  = 20;              % Density Factor

% Calculate the order from the parameters using FIRPMORD.
[N, Fo, Ao, W] = firpmord([Fpass, Fstop]/(Fs/2), [1 0], [Dpass,
Dstop]);


% Calculate the coefficients using the FIRPM function.
b  = firpm(N, Fo, Ao, W, {dens});
Hd = dfilt.dffir(b);

in article 1118766437.563081.50000@g47g2000cwa.googlegroups.com,
homerbebe@yahoo.com at homerbebe@yahoo.com wrote on 06/14/2005 12:27:

> b = firpm(N, Fo, Ao, W, {dens});
did they change the name of remez() to firpm()? good for MathWorks! now if only they'll allow us array indices that are less than 1. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
<homerbebe@yahoo.com> wrote in message 
news:1118766437.563081.50000@g47g2000cwa.googlegroups.com...
> Hi, > > When I try to design an equiripple FIR with matlab, the script and > parameters at the end of this message results in a satisfying filter. > (0 dB at DC) > However, when I decrease Fpass to 120, the passband has a (flat) DC > attenuation +/- 33dB.
I have no explanation for why the passband would vary over 66dB (+/-33dB) if the passband is set from zero to 120Hz. But, I didn't follow the method very well. If the filter is of length 7200/120=60 then 120Hz is about as good as it's going to do. To do better than 120Hz passband width, a filter longer than 60 is necessary. Does this maybe hint at what's going on? I can't tell.... fred