0
$\begingroup$

I have a symmetric lowpass FIR filter with 1149 time domain taps (all real coefficients). For implementation purposes, it would be easier if the filter had 1200 taps.

Since it has an odd number taps, can I zero pad it to 1200 time taps and keep the phase and magnitude response the same?

It seems like these are my options:

  • [25 zeros, 1149 taps, 26 zeros] which delays the filter but doesn't change the frequency response

  • [51 zeros, 1149 taps]

  • [1149 taps, 51 zeros]
$\endgroup$
  • $\begingroup$ i can't see what the even/odd symmetry of the FIR comes to be an issue here. i can't quite see how the content of the title of the question is reflected in the content of the body of the question. $\endgroup$ – robert bristow-johnson Apr 30 '17 at 3:57
  • $\begingroup$ Thanks for the input. I have revised the title of my question. $\endgroup$ – Seth Apr 30 '17 at 14:59
  • $\begingroup$ Could you simply resample the filter from 1149 samples to 1200? I am not sure if it would change the frequency response. $\endgroup$ – jeremy Jul 7 '17 at 17:52
1
$\begingroup$

The answers by Andy Walls and Matt L. are good answers and address many aspects of the question. They don't address the idea that I think was intended by the OP (and I might be mistaken). I believe the OP wants to zero pad the filter in a way that maintains the odd symmetry of the coefficients (presumably because the OP has a library function that speeds up the computation of odd symmetric filters). Algorthms that exploit odd symmetry result in subtracting two mirrored sample delays and multiplying them by the same coefficient, then summing up all of these products. This requires (about) half the number of multiplications as the naive approach.

As noted by the others, the magnitude response of all the filters will be the same no matter where you place the extra zeros. The phase response of these filters will all be different (equivalent up to a linear phase shift). However, you cannot maintain the odd symmetry of your odd length filter by zero padding it to an even length. This is because an odd length filter with odd symmetry has a single coefficient that is at the center (the odd symmetry is taken about this point). An even length filter with odd symmetry has no single coefficient at its center (the odd symmetry is taken about a point halfway between the two middle samples).

That's the bad news. The good news is that the center coefficient of a filter with odd symmetry is usually zero. So, if you have access to the "fast" algorithm, just delay the samples at the mirror-point by one additional delay prior to subtracting them and performing the chain of multiply-accumulate operations. This should be fairly easy to accomplish if you have access to the code. If not, then it probably isn't an option.

In general though, I'd do as Matt L. has suggested and simply redesign a filter with 1200 taps so that you can take full advantage of your processing, unless you have a good reason not to do so.

$\endgroup$
2
$\begingroup$

The three options you mention all result in the same magnitude response. The ones with zeros before (to the left) of the actual impulse response will just add delay (as many samples as there are zeros). The last option has exactly the same frequency response as the original filter, without any extra delay.

I think it's pointless to add extra delay by prepending zeros. Zero padding at the end is OK, if you have a good reason for it. If you really want a filter with $1200$ taps, why wouldn't you use the extra taps to get a better filter?

If you need a linear phase filter with an integer delay (in samples) then you could design a filter with $1199$ taps and append one zero tap at the end (if for whatever reason you need exactly $1200$ taps). This is because the delay in samples of a length $N$ linear phase filter equals $(N-1)/2$, which is only integer if $N$ is odd.

$\endgroup$
1
$\begingroup$

Assuming you are talking about taps in the time domain:

If you zero pad it that way, you will delay the filter response, but it will otherwise be the same.

If you zero pad it all at the end, your filter response will stay exactly the same.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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