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?
  • 2
    $\begingroup$ Your output signal will be complex-valued, even if the input signal is real-valued, because you have a filter with complex coefficients. Are you sure about that transfer function? $\endgroup$
    – Matt L.
    Jun 6, 2016 at 13:31
  • $\begingroup$ yes I am sure. I want to have put my zero at certain frequencies and I wondered if that is possible with a structure like that $\endgroup$
    – c-a
    Jun 6, 2016 at 13:52
  • $\begingroup$ You also need to put a zero at the corresponding negative frequencies in order to get a real-valued filter. See my answer below. $\endgroup$
    – Matt L.
    Jun 6, 2016 at 14:06

1 Answer 1


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)&=\frac{(z-e^{j\pi/4})(z-e^{-j\pi /4})}{z^2}\\&=\frac{z^2-2z\cos(\pi/4)+1}{z^2}\\&=1-\sqrt{2}z^{-1}+z^{-2}\tag{1}\end{align}$$

The corresponding difference equation is


  • $\begingroup$ ok, thanks for your reply! So the cut-off frequency of a first oder highpass with transfer fcn $\frac{z-1}{z}$ is basically only determined by it's sample frequency, is that right? $\endgroup$
    – c-a
    Jun 6, 2016 at 14:54
  • $\begingroup$ @c-a: Yes, given the coefficients, the ratio of the cut-off frequency and the sampling frequency is fixed. $\endgroup$
    – Matt L.
    Jun 6, 2016 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.