# What is the phase of the Fourier Transform of $h(n)={\frac13,\frac13,\frac13}$ (zero position is at 2nd element)

I am using Digital Signal Processing Principles, Algorithm and Applications, 4th edition written by Proakis and Manolakis. Here is s a part that I don't understand.

$h(n)={\frac13,\frac13,\frac13}$. The zero position is at the 2nd element. Hence, its Discrete-Time Fourier Transform (DTFT) is: $$H(\omega)= \frac13(e^{j\omega}+1+e^{-j\omega}) = \frac13(1+2\cos{\omega})\,.$$

Since only the real part exists, I assume that the phase $\tan^{-1}\frac{H_I(\omega)}{H_R(\omega)} = 0$, where $H_I(\omega)$ and $H_R(\omega)$ are the imaginary and real part, respectively. However the book says that the phase is $0$ for $0\leq\omega\leq\frac{2\pi}{3}$ and $\pi$ for $\frac{2\pi}{3}\leq\omega\leq\pi$.

Sorry that I'm not good at Latex.

• As you have correctly said: $H(\omega)$ is real, so the phase of a real number can be zero or $\pi$ (for positive and negative numbers), so you have to analyze from the expression, where is $H(\omega)$ positive and where is negative, and you can figure out from there how the phase is. I didn't check the math but I think the book is correct. – bone Dec 1 '15 at 14:26
• Welcome to DSP.SE! We are happy with homework or self-study questions here, but please tag them as such. You have asked the question in the right way: said what the exercise is, and shown what you've done to date, and explained what you don't understand. Well done! – Peter K. Dec 1 '15 at 15:41

The result on the phase comes from writing $H(\omega)$ as a modulus/phase product: $H(\omega) = |H(\omega)|e^{-\imath\phi(\omega)}$. The value of $\phi(\omega)$ is consistent with the sign of $(1+2\cos \omega)$.
There is a little inconsistency is your notation (maybe from the book!): the phase seems to takes both values $0$ and $\pi$ at $w=\frac{2\pi}{3}$. This is not vital as the modulus vanishes at this point.
What you might have forgotten in your reasoning is the fact that $t\to \tan t$ is $\pi$-periodic, and that $\tan \pi =0$ too.
Both the book's moving average (MA) example and Laurent's Answer# 1 are correct. The phase value of $\pi$ above the frequency of $\omega$ = $2\pi/3$ radians/sample corresponds to a phase shift of $\pm$180 degrees. This means if a filter's impulse response is the anti-causal $h(n)$ sequence then filter output tones whose frequencies are greater than $2\pi/3$ radians/sample will be 180 degrees out of phase relative to output tones whose frequencies are less than $2\pi/3$ radians/sample.
The author's decision to make the $n$ = 0 index value be at the 2nd element of $h(n)$ was done to keep the final $H(\omega)$ equation simple. However, it's worth knowing that if the $h(n)$ samples are used as coefficients of a tapped-delay line, causal MA filter, the filter's frequency-domain phase response will look like the following (where the x-axis value of 0.5 corresponds to a frequency of $\pi$ radians/sample or $f_s$ Hz):