# Group delay of $H(\omega)= 1- re^{j \theta}e^{ - j \omega}$

I'm studying chapter 5 of Discrete-Time Signal Processing 3rd edition by Alan Oppenheim and I'm having serious difficulties understanding how he obtained equation 5.57. For those who don't have this book I tell you that in this part it is analyzing the frequency, phase and group delay of

$$1- re^{j \theta} e^{-j \omega}$$

which could either be a pole or a zero depending on whether this factor is in the denominator or numerator of the frequency response. Here r is a random magnitude variable and theta is a random phase variable

So far I have been able to understand how is the phase expression obtained as it is defined as $$\arctan \frac {\Im}{\Re}$$

and

$$1- re^{j \theta} e^{-j \omega} = 1- r[ \cos (\theta - \omega) + j \sin(\theta - \omega) ]$$

and as cosine is even and sine is odd

$$= 1- r[ \cos (\omega- \theta) - j \sin(\omega- \theta) ] = 1- r\cos (\omega- \theta) + j r\sin(\omega- \theta)$$

the resulting phase expression is:

$$\arctan \frac {r \sin(\omega- \theta)}{1- r \cos (\omega- \theta)}$$

which coincides with equation 5.56 in the book

But when it comes to finding the group delay (which is the negative derivative of this expression) I'm not obtaining what it says in the book. Moreover I introduced the expression in Matlab and I'm obtaining the following result:

According to the book the group delay is;

$$\frac{r^2 - r\cos (\omega- \theta)}{1 + r^2 - 2r\cos (\omega- \theta)}$$

How did they get there? Can you help me?

• I haven't looked over your expressions in great detail, but have you tried to algebraically manipulate your result to arrive at the book's result? Try a trigonometric identity in the numerator and expanding the square in the denominator. – Jason R Aug 22 '17 at 14:47
• @ Jason R. Yes I have and I'm not getting a final so compact formula – VMMF Aug 22 '17 at 15:02

The book's formula is right.

Let $$H(w) = 1 - r e^{j(\theta - w)} = [1-r \cos(\theta - w)] + j [-r \sin(\theta - w)]$$ Since the group delay $\tau$ is the negative of the derivative of the phase of $H(w)$, we first define the phase as: $$\phi(w) = \tan^{-1}\left( \frac{-r \sin(\theta - w)}{1-r \cos(\theta - w)} \right)$$

Using the derivative rule for the inverse tangent as: $$\frac {d}{dw} \left( \tan^{-1}(u)\right) = \frac{u'}{1+u^2}$$

We shall compute the derivative of the phase as; $$\phi^{'}(w) = \frac{ \left( \frac{-r \sin(\theta - w)}{1-r \cos(\theta - w)} \right)^{'} }{ 1 + \left( \frac{-r \sin(\theta - w)}{1-r \cos(\theta - w)} \right)^2 }$$

which continues as:

\begin{align} \phi^{'}(w) &= \frac{ r \cos(\theta-w) \cdot[1 -r \cos(\theta-w)] + r \sin(\theta-w) \cdot [-r \sin(\theta-w)]}{(1-r \cos(\theta-w))^2 \cdot \left( 1 + \left( \frac{-r \sin(\theta - w)}{1-r \cos(\theta - w)} \right)^2 \right) }\\ \phi^{'}(w) &= \frac{ r \cos(\theta-w) -r^2 \cos^2(\theta-w) - r^2 \sin^2(\theta-w) }{(1-r \cos(\theta-w))^2 \cdot \left( 1 + \left( \frac{-r \sin(\theta - w)}{1-r \cos(\theta - w)} \right)^2 \right) }\\ \phi^{'}(w) &= \frac{ r \cos(\theta-w) -r^2 } { (1-r \cos(\theta-w))^2 \cdot \left( \frac{ (1-r \cos(\theta-w))^2 + r^2 \sin^2(\theta - w)} { (1-r \cos(\theta-w))^2} \right) }\\ \phi^{'}(w) &= \frac{ r \cos(\theta-w) -r^2 } { (1-r \cos(\theta-w))^2 + r^2 \sin^2(\theta - w)}\\ \phi^{'}(w) &= \frac{ r \cos(\theta-w) -r^2 } { 1 - 2r\cos(\theta-w) + r^2 \cos^2(\theta - w) + r^2 \sin^2(\theta - w)}\\ \end{align}

Which finally simplifes to $$\phi^{'}(w) = \frac{ r \cos(\theta-w) -r^2 } { 1-2r \cos(\theta-w) + r^2}$$

Then since the group delay is the negative of this we finally have: $$\tau(w) = -\phi^{'}(w) = \frac{ r^2 - r \cos(\theta-w) } { 1 + r^2 -2r \cos(\theta-w) }$$

$$\tau(w) = -\phi^{'}(w) = \frac{ r^2 - r \cos(w-\theta) } { 1 + r^2 -2r \cos(w -\theta) }$$

Which is the same as the book's formula.

Coming to Matlab's output, you may try simplifications. But they are known to produce more verbose outputs than possible with simplifications.

• What a waste of time for at least one of us :) – Matt L. Aug 22 '17 at 15:26
• Haha yes :-) Perhaps you didn't see my answer while writing yours. I was struggling with the align command to look it better...and couldn't manage :-) The worst happens when one generally looks at the end of his long tex typing ! – Fat32 Aug 22 '17 at 15:30
• A +1 to both of you for your trouble. – Jason R Aug 22 '17 at 15:42
• True, let's double that @Jason R – Laurent Duval Aug 22 '17 at 19:49
• @PeterK.: yes, and we're getting quite good at it! :) – Matt L. Aug 29 '17 at 18:28

This is a slightly tedious but nevertheless straightforward exercise in computing the derivative of a function:

\begin{align}\tau(\omega)&=-\frac{d\phi(\omega)}{d\omega}=-\frac{d}{d\omega}\arctan(f(\omega))\tag{1}\end{align}

with

$$f(\omega)=\frac{r\sin(\omega-\theta)}{1-r\cos(\omega-\theta)}\tag{2}$$

From $(1)$ we have

$$\tau(\omega)=-\frac{f'(\omega)}{1+f^2(\omega)}\tag{3}$$

where the derivative $f'(\omega)$ is

\begin{align}f'(\omega)&=\frac{r\cos(\omega-\theta)(1-r\cos(\omega-\theta))-r\sin(\omega-\theta)r\sin(\omega-\theta)}{(1-r\cos(\omega-\theta))^2}\\&=\frac{r\cos(\omega-\theta)-r^2}{(1-r\cos(\omega-\theta))^2}\tag{4}\end{align}

Plugging $(2)$ and $(4)$ into $(3)$ gives

\begin{align}\tau(\omega)&=\frac{r^2-r\cos(\omega-\theta)}{(1-r\cos(\omega-\theta))^2}\frac{1}{1+\left(\frac{r\sin(\omega-\theta)}{1-r\cos(\omega-\theta)}\right)^2}\\&=\frac{r^2-r\cos(\omega-\theta)}{(1-r\cos(\omega-\theta))^2+r^2\sin^2(\omega-\theta)}\\&=\frac{r^2-r\cos(\omega-\theta)}{1-2r\cos(\omega-\theta)+r^2}\tag{5}\end{align}

Using the logarithmic derivative of the transfer function, as detailed in Julius O. Smith's Numerical Computation of Group Delay, the following computations seem to involve a little less of derivatives (and less risks of mistakes), which could be useful for more complicated frequency responses and related group delays (like rational fractions). And you can (partially) save the computation of the modulus and the phase. Plus, it is always beneficial to have (at least) two different calculation methods, to cross-check results.

So you can express the group delay as:

$$\tau(\omega) = - \Im \left( \frac{H'(\omega)}{H(\omega)}\right)$$

Luckily here, $H'$ is relatively simple : $$H'(\omega) = -j\left(-re^{j(\theta-\omega)}\right)$$

Hence, writing $\psi = \theta-\omega$ to lighten notations:

$$\tau(\omega) = \Im \left( \frac{jre^{j\psi }}{1 - re^{j\psi }}\right) = -\Re \left( \frac{re^{j\psi }}{1 - re^{j\psi }}\right)$$

Then, conjugating the denominator:

$$\tau(\omega) = -\Re \left( \frac{ r\cos \psi +jr \sin \psi }{1 - r\cos \psi -jr \sin \psi}\cdot \frac{1 - r\cos \psi +jr \sin \psi}{1 - r\cos \psi +jr \sin \psi}\right)$$

Now, only the numerator is complex, hence the real part comes from summing the products of the real parts and the imaginary parts:

$$\tau(\omega) = - \left( \frac{ r\cos \psi (1 - r\cos \psi ) +(jr \sin \psi)^2 }{(1- r\cos \psi)^2 + (r \sin \psi)^2} \right)$$

and finally replacing $\psi$:

$$\tau(\omega) = \left( \frac{r^2 - r \cos (\theta-\omega)}{r^2 -2r \cos( \theta-\omega)+1 } \right)$$

• +1 Wow thank you very much! This alternative technique was very impressive – VMMF Aug 29 '17 at 15:45
• Do you mind expanding the third equation in which imag (jx) = -real(x). I'm not sure how you did that. Thanks – VMMF Aug 29 '17 at 19:15
• $a$ and $b$ real, $j(a+jb) = -b+ja$. Multiply a complex by $j$, turn its im part into a minus real part – Laurent Duval Aug 29 '17 at 19:22
• interesting method ! – Fat32 Aug 30 '17 at 19:01
• @Fat32 Indeed, felt happy this question helped my revive almost dead memories :) – Laurent Duval Aug 30 '17 at 19:31