# Signal processing question (phase response of a digital filter)

3 vues (au cours des 30 derniers jours)
Paul Mennen le 10 Août 2023
Commenté : Paul le 12 Août 2023
Suppose I have a digital filter with length(b)=8 and length(a)=6 (i.e. 7th order numerator and 5th order denominator).
If I look at freqz (or fvtool), before computing the frequency response, the denominator will be padded with two extra zeros at the end so that the two polynomials are the same length. The two extra poles at the origin won't change the magnitude response but it will change the phase response. Why is this the phase response (displayed by fvtool) the one we want vs. what we would get if we simply evaluated the ratio of the numerator and denominator polynomials (unpadded) around the unit circle?
For a FIR filter with 20 zeros, fvtool shows 20 poles added at the origin again affecting the frequency response. I suppose this is the same as my first question, but why are the 20 poles added and why is this the desired phase response to display?
Thanks for any insights you may have on this question.
~Paul
##### 0 commentairesAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

Paul le 10 Août 2023
Modifié(e) : Paul le 10 Août 2023
Hi Paul,
Can you provide a simple concrete, example that illustrates your concern?
I suspect that you're seeing the difference between how the numerator and denominator are entered into freqz and how they are evaluated inside of freqz.
The b,a inputs to freqz are defined in ascending powers of z^-1. So, for a filter like
H(z) = (1 + 2*z^1 + 3*z^-2) / (1 + 5*z^-1)
we'd call freqz with
freqz([1 2 3],[1 5])
Inside of freqz, for an IIR filter, the numerator and denominator polynomials are evaluated as a function of frequency in one of two ways: using polyval or fft.
polyval evaluates polynomials in descending powers of z. So if we multiply the numerator and denominator of H(z) by z^2, we get
H(z) = (z^2 + 2*z + 3) /(z^2 + 5*z)
and the Matlab polynomial representation of the denominator requires padding with one zero: [1 5 0]. The zero padding is needed to get the correct result using polyval, and is not adding an extra pole (the poles of H(z) are at z = 0 and z = -5 regardless).
If using fft, padding the denominator with one zero doesn't affect its fft.
A 20th order FIR filter does have 20 repeated poles at the origin, which you'll see by converting the FIR filter H(z) written in terms of z^-1 to a rational function of z, from which the zero and poles of H(z) are defined. I don't think freqz does any zero padding of b in the FIR case because the numerator coefficients are the same when H(z) is written in terms of z^-1 or z, but it does have to account for the fact that the b is defined in ascending powers of z^-1 when computing the frequency response.
##### 8 commentairesAfficher 7 commentaires plus anciensMasquer 7 commentaires plus anciens
Paul le 12 Août 2023
Whatever I was thinking when I rewrote H(z) was clearly incorrect. Was probably thinking about poles at -2 and -3.
For the FIR case, I think the poles and zeros are sufficient to determine impulse response, to within a gain, be it causal or noncausal. But for the IIR case, we’d need to know the region of convergence of H(z) to determine causality.
I’ll be sure to steer clear of the geology and economics crowds :)
Thanks for the discussion.

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Filter Analysis dans Help Center et File Exchange

R2023a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!