# What filter is better with -1/3 2/3 -1/3 or with -1/4 1/2 -1/4 coefficients?

Professor asked me what filter is better -1/3 2/3 -1/3 or -1/4 1/2 -1/4, the answer was second. But what those coefficients means? It was during discussion of linear filter but i'm not sure was it about it.

Both filters can be re-written in the form: \begin{equation} H(z) = \alpha ( 1 -2z^{-1} +z^{-2} ) \end{equation} Clearly, in the first case, $\alpha=-\frac{1}{3}$ and in the second $\alpha=-\frac{1}{4}$.

In other words, the shape of the filter's frequency response is the same, the only difference is the scaling.

I can think of two reasons of why the second filter may be preferred.

• In the case of the second filter, the maximum gain of the filter (occuring at the Nyquist frequency) is normalized to $1$, whereas the first filter has a maximum gain of $\frac{4}{3}$.

• The other more compelling reason however, is probably that the coefficients of the second filter can be expressed as powers of two ($\frac{1}{4}=2^{-2}$, $\frac{1}{2}=2^{-1}$) and therefore multiplication by these coefficients can be quickly implemented as bitwise operations on a computer or digital signal processor.

• Good answer. I'd add that the recurring decimal co-efficients required to represent $\frac{1}{3}$ will be truncated in any real implementation of the filter leading to inaccuracies in the response. – tobassist Oct 29 '13 at 14:08
• What is H(z)? Derived from this? postimg.org/image/sbgs9a27z – Олег Кривцов Nov 1 '13 at 14:26
• $H(z)$ is the transfer function which describes the difference equation that you link to. Specifically, $H(z) = \frac{Y(z)}{X(z)}$, where $X(z)$ and $Y(z)$ are the Z-transforms of $y[n]$ and $x[n]$. Check out: en.wikipedia.org/wiki/Z-transform – Kenneide Nov 1 '13 at 16:02