# Downsample Equiripple FIR filter

I am designing some Downsampling filters using the remez exchange algorithm (Matlab FDAtool). I see that some times i get a spike at the first and last coefficients. does anybody knows why is that? my intuition seems to be that this can introduce some artifacts to the signal.. What will be the consequance of multiplying the filter by a window (hamming and so on) to reduce this edge effects?

• Could you show a plot, or at least some MATLAB code that generates the filters that you speak of? "Spike" isn't a very precise term. Aug 5, 2012 at 14:07

The "spikes" (they are quite small in magnitude, but large compared to the nearby filter taps) at the beginning and end are part of how the equiripple property is achieved. In his book "Multirate Signal Processing for Communication Systems" (a book that I recommend quite highly), fredric harris indicates that it is sometimes advantageous to eliminate the spikes because it causes the frequency response to continue to decrease after the cut-off frequency instead of staying constant. The price you pay is that the filter is no longer equiripple which appears to cause (see example below and comments by JasonR) the transition band to be not as sharp.

EDIT: I created a low-pass filter in Octave using remez. I intentionally made the transition-band very small to get it to create a decent spike. The filter taps are plotted below.

Here is the frequency response of the filter.

As you can see, the frequency response is pretty poor due to the short transition-band, but the point is that it is an equiripple filter. Below I plot the exact same filter, only I have zeroed out the two spike taps.

Below is the frequency response of the "no spikes" version of the filter.

The frequency response shows the continued drop beyond the cutoff frequency. It also clearly shows the non-equiripple response in the pass-band. This is entirely expected. The one thing that is unexpected is that the "no spike" filter appears to be better than the "spike" filter at every point. I assume that this is because of some flaw in Octave's remez algorithm.

• Nice answer - why are you saying the non-spike filter looks better than spike one?... Aug 6, 2012 at 2:26
• Because the pass-band ripple is less than the spiked version, and the attenuation is greater in the stop band. The transition band is probably wider, which is why remez didn't come up with the non-spike version in the first place, but in every other respect the non-spiked version seems to be clearly better to me. Aug 6, 2012 at 3:16
• @JimClay I don't think it's a flaw in remez, it's just the nature of the change in the approximation. By sacrificing some localized error tolerance (probably around the transition), you gain much better approximation over the entire range (cf. "Myth 3" in eprints.maths.ox.ac.uk/1352). Aug 6, 2012 at 3:30
• @JimClay: What parameters did you use to design the above filter? The Octave source code would do; I've not noticed this particular phenomenon before, but then again, I've never really looked for it either. Aug 7, 2012 at 1:04
• @JimClay: Thanks. I duplicated the example in MATLAB. If you plot the two filter responses on top of one another, you'll see that there are regions where the equiripple filter is better, namely in the region just around the specified stopband frequency of 0.51. The modified filter has a slightly longer transition region, such that it may not meet the stopband specification any longer. Nice trick, though, as you do end up with much less passband ripple at a relatively small cost in cutoff sharpness. Aug 7, 2012 at 14:02