Difference equation with complex zero Let's assume I have the following transfer function:

$$
H(z)=\frac{z-\left(\frac{1}{\sqrt{2}}+i \cdot \frac{1}{\sqrt{2}}\right)}{z}
$$

It looks like a first order highpass-filter with a complex zero at $\frac{1}{\sqrt{2}} + i \cdot \frac{1}{\sqrt{2}}$.

If I do the inverse $z$-transform, I get the following difference equation:

$$
y(k)=x(k) - \frac{1}{\sqrt{2}} \cdot x(k-1) - i \cdot \frac{1}{\sqrt{2}} \cdot x(k-1)
$$
with $k$ as time step variable. My input signal is real valued and my output should be real valued as well. 


How do I implement that filter e.g. in C? 
How do I deal with that complex numbers in that case?
What you actually want to do is the following: you need a zero at $\omega=\pi/4$, but you also need to place a zero at $\omega=-\pi/4$ in order to get real-valued filter coefficients. So your transfer function becomes

$$\begin{align}H(z)&amp;=\frac{(z-e^{j\pi/4})(z-e^{-j\pi /4})}{z^2}\\&amp;=\frac{z^2-2z\cos(\pi/4)+1}{z^2}\\&amp;=1-\sqrt{2}z^{-1}+z^{-2}\tag{1}\end{align}$$

The corresponding difference equation is

$$y[n]=x[n]-\sqrt{2}x[n-1]+x[n-2]\tag{2}$$