# Connection between filter equation in frequency domain and difference equation in time domain?

I know that the frequency response of a filter is described by equation:

H(w) = 1-1.176*e^(-jw) + e^(-j2w) , where w is the angular frequency.

Then in time domain I have a filter that is described by difference equation:

y(k) = x(k)-1.176*x(k-1)+x(k-2)


Now I'm asked to explain the connection between these equations and why the coefficients for the both equations are the same [1 -1.176 1]?

I've been reading books and trying to find information around the internet but without any solutions for this. Could someone explain me the connection of these equations? Why are the coefficients same?

I have an idea that these two equations might represent the same filter but in different domains (time and frequency). Does convolution have something to do with this?

Hint:

The transfer function $H(\omega)$ is equal to the ratio of output and input spectra:

$$H(\omega)=\frac{Y(\omega)}{X(\omega)}$$

So your first equation can be rewritten as

$$Y(\omega)=X(\omega) - 1.176X(\omega)e^{-j\omega} + X(\omega)e^{-2j\omega}$$

What do you get if you transform this equation to the time-domain?

Or put another way, what would be the result of the filter if the input is the test sinusoid $x(k)=e^{jkω}$?

$$y(k)=e^{jkω}-1.176e^{j(k-1)ω}+6e^{j(k-2)ω}=(1-1.176e^{−jω}+e^{−2jω})e^{jkω}=H(ω)x(k)$$

An alternative explanation is to remember that the frequency response is obtained by letting $z=e^{j\omega}$. So you use similar mathematics to the previous answers.

So we have
$$H(z)= \frac{Y(z)}{X(z)} = 1-1.176z^{-1} + z^{-2}$$ $$Y(z)=X(z) -1.176X(z)z^{-1}+X(z)z^{-2}$$ Now you can use the property of z-transforms i.e. $z^{-1}$ is merely a delay element, to obtain the time domain difference equation.