# Can the magnitude of a discrete-time Fourier transform be negative?

Consider the discrete-time system $$H(z) = 1 + z^{-1} + z^{-2} + z^{-3}$$ To obtain the magnitude of the discrete-time Fourier transform, I substitute $$z = e^{j\omega}$$ to get \begin{align} H(\omega) &= 1 + e^{-j\omega} + e^{-2j\omega} + e^{-3j\omega} \\ &= e^{-\frac{3}{2}j\omega} \cdot \left(e^{\frac{3}{2}j\omega} + e^{\frac{1}{2}j\omega} + e^{-\frac{1}{2}j\omega} + e^{-\frac{3}{2}j\omega}\right) \\ &= e^{-\frac{3}{2}j\omega} \cdot \left(2 \cos\left(\frac{3}{2}\omega\right) + 2 \cos\left(\frac{1}{2}\omega\right)\right) \end{align} As $$H(\omega)$$ is now in polar form, such that \begin{align} r(\omega) &= 2 \cos\left(\frac{3}{2}\omega\right) + 2 \cos\left(\frac{1}{2}\omega\right) \\ \theta(\omega) &= -\frac{3}{2}\omega \end{align} Then the magnitude of $$H(\omega)$$ is just $$r(\omega)$$. However, $$r(\omega)$$ can be negative for some $$\omega$$, which does not make sense to me, as the magnitude of a complex number can't be negative. What am I missing?

• Not every number $xe^\theta$ is in polar form. You need to find the magnitude and phase of $H(\omega)$.
– MBaz
Dec 1, 2021 at 1:45
• @MBaz not sure what you mean. $H(\omega)$ is a complex input-complex output function, so if I can express it in polar form, i.e. $H(\omega) = Ae^{j\theta}$, then why isn't $A$ the magnitude of $H(\omega)$? Dec 1, 2021 at 1:47
• I meant $H(\omega)$ is a real input-complex output function. Dec 1, 2021 at 2:06
• I just want to say that, although the answers are correct, that I think it would be nice to represent the Fourier Transforms of signals or system responses as a bipolar, real magnitude, $r(\omega)$ multiplied by a phase $e^{j \phi(\omega)}$ where $\phi(\omega)$ is the phase in radians. Then when the bipolar real magnitude $r(\omega)$ passes through 0, it can just change polarity and the phase $\phi(\omega)$ does not have to have a step discontinuity of $\pm\pi$ radians. I think that would be better for minimum-phase filters and the Hilbert Transform relationship of phase and magnitude. Dec 1, 2021 at 4:14

You can't conclude that the magnitude response is $$r(\omega)$$ and the phase response is $$\theta(\omega)$$.

Note that $$e^{j\pi}=-1$$, at the frequencies that $$r(\omega) < 0$$, let $$\phi(\omega) = \theta(\omega) + \pi$$ and you get the non-negative magnitude response.

The real magnitude response is $$|r(\omega)|$$ and the phase response is

\phi(\omega)=\left\{ \begin{aligned} &\theta(\omega) , & r(\omega)\geq 0 \\ &\theta(\omega) + \pi , & r(\omega)<0 \end{aligned} \right.

• Ahh I get it. My $H(\omega)$ was not yet in polar form because my $r(\omega)$ was allowed to be negative. Thanks. Dec 1, 2021 at 3:50

Then the magnitude of H(ω) is just r(ω).

No.

By definition, the magnitude of a complex number is always non-negative.

Let's look at something simple: $$z = -1$$. The real part is -1, the imaginary part is 0, the magnitude is 1 and the phase is $$\pi$$ (or $$\pi + k \cdot 2\pi , k \in\mathbb{Z}$$ to be precise), i.e

$$z = -1 + j \cdot 0 = 1 \cdot e^{j \pi}$$