# Question about zeroes of simple 2nd order FIR filter

I have a question about the zeroes in a simple second order FIR filter. I'll list out the major beat points of calculating where the zeroes are before asking the question (I'm following "Designing Audio Effect Plug-Ins in C++", section 5.17).

Starting with a simple second order FIR filter difference function:

$$y(n)=a_0x(n)+a_1x(n-1)+a_2x(n-2)$$

We can z transform it to:

$$Y(z) = X(z)(a_0+a_1z^{-1}+a_2z^{-2})$$

Which gives us the transfer function:

$$H(z) = a_0+a_1z^{-1}+a_2z^{-2}$$

We can factor out $$a_0$$ to make it a gain parameter, and replace $$a_1$$ with $$\alpha_1$$, and $$a_2$$ with $$\alpha_2$$, where $$\alpha_1 = \frac{a_1}{a_0}$$ and $$\alpha_2 = \frac{a_2}{a_0}$$:

$$H(z) = a_0(1+\alpha_1z^{-1}+\alpha_2z^{-2})$$

To find the zeros, we can ignore $$a_0$$ and just look at the part inside the parentheses.

$$0=1+\alpha_1z^{-1}+\alpha_2z^{-2}$$

We know that the zeroes need to be complex conjugates, so can change it to this:

$$0=(1-Z_1z^{-1})(1-Z_2z^{-1})$$

where $$Z_1=Re^{j\theta}$$ and $$Z_2=Re^{-j\theta}$$

Using Euler's equation, we can expand and do algebra to get this:

$$0=1-2R\cos(\theta)z^{-1}+R^2z^{-2}$$

Comparing that to the earlier equation:

$$0=1+\alpha_1z^{-1}+\alpha_2z^{-2}$$

We can see that this equation has a zero where:

$$R=\sqrt{\alpha_2}$$

$$\theta=cos^{-1}(\frac{\alpha_1}{-2R})$$

The other zero has the same radius $$R$$, but has a negative theta ($$-\theta$$).

Ok so my question is this. Using values $$a_0=1$$, $$a_1=-1.27$$, $$a_2=0.81$$, we get $$R=0.9$$ and $$\theta=\frac{\pi}{4}$$.

That seems to be correct and works well, but let's say that $$a_1=-3.6$$. We get the same radius $$R$$, but to calculate $$\theta$$ we have:

$$\theta=cos^{-1}(2.0)$$

... which is not a valid thing. cosine never has a value of 2, so acos(2.0) is not defined.

Where did i go wrong or how is this situation handled?

The reason for this is that the maths centres on a false assumption:

We know that the zeroes need to be complex conjugates

Do the zeros need to be complex conjugates? Can they not be 2 real zeros?

I sympathise here because I also read this book and the maths portion ended up utterly confusing me because of very odd methods.

A more general method would be at this point:

$$0=1+\alpha_1z^{-1}+\alpha_2z^{-2}$$

Rearrange thus:

$$0=\frac{z^{2}+\alpha_1z^{1}+\alpha_2}{z^{2}}$$

Here on the top we have a quadratic equation, which you can use any quadratic solver for.

For your first case, I arrive at 0.635 $$\pm$$ 0.637i, which is a pair of complex numbers denoting the conjugate zeros - correct.

For your second, I arrive at two real zeros, one at 3.36 and one at 0.24 - so it is most definitely able to be computed!

And finally, you will have noted the $$z^{2}$$ term lying on the bottom, which indicates that there is a square pole at 0+0i. If these zeros were poles then there would similarly be a square zero at 0+0i.

All of these results can be verified with the zplane function in MATLAB.

It took me some time with this book and checking results with the zplane function in matlab to realise that his methods of working really don't work on a general basis, and frankly overcomplicate things. It has however been awhile since I've looked at it so maybe I similarly misinterpreted his maths

• Thank you so much! I'm going to give this a go, and when it checks out experimentally, i will accept this answer. – Alan Wolfe Jan 5 '20 at 2:02
• Someone else told me that there is a complex domain inverse cosine, which may be what the author intended. I'm not sure though, and the quadratic equation is way more friendly and familiar. Thanks! – Alan Wolfe Jan 5 '20 at 4:10