# How to estimate taps required for Parks-McClellan filters

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.

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.