# Gain at given frequency from $z$-plane zero-pole plot. Two methods gives different results

I have two zeros at $z=-1$ and two complex conjugate poles at $z=A\cos\theta\pm jA\sin\theta$

This gives me the next transfer function

$$H(z)=\frac{1+2z^{-1}+z^{-2}}{1-2A\cos\theta z^{-1}+A^2z^{-2}}$$

To get filter's DC gain I'm trying to substitute $z$ with $1$:

$$G=\frac{4}{1-2A\cos\theta+A^2}$$

Following graphical method described here (gain as a product of lengths of vectors from every zero to given point divided by product of lengths of vectors from every pole to given point) I've got next formula:

$$G=\frac{2}{\sqrt{1-2A\cos\theta+A^2}}$$

Where is my mistake? Why I've lost square root in the first case?

I think you lost the square root somewhere in your graphical method: Considering the nominator (product of lengths of vectors from every zero given point), I end up with

$$N=2*2$$

i.e. you have two vectors of length 2 (two zeros at z=-1).

Then, for the denominator you have

$$D = \sqrt{(A\sin\theta)^2+(A\cos\theta-1)^2}^2=A^2-2A\cos\theta+1$$

And finally $G=N/D$ yields the same result as your analytical solution.

• Oh, that was very stupid mistake. Instead of squaring the square root I've multiplied it by two. – e_asphyx Dec 25 '16 at 16:07