5
$\begingroup$

Often it is more desirable to have a roll-off versus frequency of the rejection in the stopband; for example resampling filters where all the alias image locations fold into the first Nyquist Zone. What is a VERY simple change you can make to the coefficient solution provided by the Parks-McClellan algorithm that will convert the "equiripple" stopband to one that rolls off with greater rejection (at the expense of exceeding target limits near the transition, and increasing passband ripple)? Note: This is a great "trick" that I learned from fred harris.

Note- for full credit please explain why this "trick" works.

To help illustrate the end result, see the plot below showing a standard design using P-McC before and after the simple modification. Here we see the stop band rejection with a roll-off instead of being flat, but increased passband ripple and degraded rejection immediately near the beginning of the stopband, but overall significantly better rejection.

Before (blue) and after (red) modifcation to filter coeff. Note the region close to the transition where the stop band is worst, but overall rejection is much better:

enter image description here

Zoom in showing trade-off of degraded ripple in passband.

enter image description here

$\endgroup$
7
  • $\begingroup$ It would be interesting to see a plot of such a modified Parks McClellan filter, together with the original filter, just to get an idea. $\endgroup$
    – Matt L.
    Feb 18, 2017 at 19:44
  • $\begingroup$ Good idea, that will be helpful. Will create one now and add it. $\endgroup$ Feb 18, 2017 at 19:48
  • $\begingroup$ yeah, and i got my tricks with P-McC that are useful for interpolation/sample-rate-conversion because most of the energy in music and audio is in the bottom 5 octaves. $\endgroup$ Feb 18, 2017 at 19:50
  • $\begingroup$ Would love to hear your tricks @robertbristow-johnson $\endgroup$ Feb 18, 2017 at 20:04
  • 1
    $\begingroup$ Good to see you're spelling fred's name correctly. :-) $\endgroup$
    – Peter K.
    Feb 19, 2017 at 20:01

1 Answer 1

4
$\begingroup$

That trick must have to do with manipulating the first and the last tap of the Parks-McClellan (Chebyshev) solution. This is also explained in the last paragraph of this answer, which deals with a very extreme case. For equi-ripple designs the first and the last tap tend to be a bit larger in magnitude than what would be expected if one just extrapolated the impulse response. These two extremal taps correspond to time-domain echos and generate the equi-ripple behavior in the frequency domain. By decreasing the size of these two taps, the stop band ripple can be reduced. Any heuristic can be used to do so. I don't know what Harris suggested, but by simply choosing $h[0]=h[1]/2$ and $h[N-1]=h[N-2]/2$ (where $N$ is the filter length) I get an even faster roll-off (albeit a less regular one), at apparently no extra cost (compared to the solution in the question):

enter image description here enter image description here

Note that this trick only works well for filters with a relatively narrow pass band. Equi-ripple filters with wider pass bands usually do not show that irregularity in their impulse response.

$\endgroup$
2
  • $\begingroup$ Very good @MattL. Harris suggests just to truncate the filter which resulted in the plots I showed. Which is interesting in that we are reducing the number of taps, but your approach would likely have better performance I assume. You explained correctly; I want to add the view of describing the larger coefficients at the end as impulses, as two impulses separated in time will present as a constant ripple in frequency (no different than how a cosine or sine waveform in time is represented as two impulses in frequency, which is easier for some to relate) $\endgroup$ Feb 19, 2017 at 19:34
  • 2
    $\begingroup$ @DanBoschen: Note that the taps that "stick out" are not always the first and the last tap, but they could also be just close to the two ends of the impulse response. In that case, truncation would mean throwing away even more coefficients. I think that replacing these "irregular taps" by interpolation or extrapolation and thus keeping the filter length the same is probably the best solution. $\endgroup$
    – Matt L.
    Feb 19, 2017 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.