# Determining type of filter given its equation

Given a general filter equation, how can one tell the type of filter that the same equation represents? Meaning how can I know if the filter is Low/High/Band Pass etc...?

For example, the following equation:

$y_{n} = x_{n} + x_{n-2}$

Represents a "Band Stop" filter, but why?

• gonna have to apply the Z transform. and set $z = e^{j\omega}$ to find out how this filter behaves. – robert bristow-johnson Jan 12 '16 at 20:00
• @robertbristow-johnson , i see a down vote ,whats wrong with my solution if you can point out – Ashik Anuvar Jan 13 '16 at 7:28

The $\mathcal Z$-transform of the given difference equation is :
$$H(z) = 1 + z^{-2}$$
Put $z= \exp(j\omega)$ and remember that in discrete time systems the low frequencies are at $2n\pi$ $(n=0,1,2, \ldots)$ and the high frequencies occur at $(2n+1)\pi$; this is just a consequence of the periodic behavior of the discrete time complex exponentials.
So, $H(z) = 1 + \exp(-2j\omega)$ at $z = \exp(j\omega)$.
When $\omega=0; H(z) = 2$ and $w = \pi$ gives $H(z)= 2$.
Thus, both at high and low frequencies the the system function provides same gain and hence the filter with the given $H(z)$ is a BAND REJECT/ NOTCH FILTER with $H(z) = 0$ at $\omega = \pi/2$.