I have some code based on Jake Janovetz's Parks-McClellan (Remez) filter generating code. How can I estimate the number of taps required to build a lowpass filter given requirements for pass band ripple and stop band attenuation? I already know how to convert from these requirements back to the filter error deviation.
1 Answer
If you're using MATLAB, the function firpmord
exists to help you with that. Like some other MATLAB functions, it doesn't link to any libraries or mex files, it's simply MATLAB code that runs. The only reason I mention it is that when you open this function (open firpmord
), it has a subfunction remlpord
that was written by (ta-daaaaa!) J. H. McClellan himself. It's using a matrix of hardcoded numbers and references Rabiner & Gold, Theory and Appications of DSP, pp. 156-7. The method therefore must be somewhat empirical, though I won't argue one way or the other. In any case, you can study this function (it's very short) and write your own based on it. I failed to find any specific papers that address the problem though, but perhaps there are books.
-
$\begingroup$ I don't have access to matlab at the moment, but I do have a copy of Rabiner and Gold. $\endgroup$ Dec 23, 2011 at 13:50
-
1$\begingroup$ After reading the book and playing around a bit, I find that for my problem set, simply using N = 1.9/transition_bandwidth + 2 gives very good results. Thanks for the reference. $\endgroup$ Dec 23, 2011 at 16:36
-
$\begingroup$ That very much may be the case. If I find any reference with the actual method MATLAB uses in it, I will make sure to update my answer. $\endgroup$– PhononDec 23, 2011 at 16:39