Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books



Chapters

Chapter Contents:

Search Spectral Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Example 3: Unwrapped Phase

From the previous examples, we have learned that a problem is introduced when we modify the wrapped phase response. If we first unwrapped the phase response of $ z^{-N}$, for example, to obtain a single linear segment sloping from $ N\pi$ to $ -N\pi$ (crossing 0 at 0), then a scaling by $ 1.5$ (Example 1) or $ M$th root (Example 2) would no longer introduce the ``premature wrapping'' of the phase response we saw in the previous sections.

One convenient way to extract the phase of a complex function is to extract the imaginary part of its logarithm. Thus, in this example, we will compute, in matlab,

angle(exp(power*(real(log(S)) + j*unwrap(imag(log(S))))));
where S = exp(-j*3*omega*T)) as in Example 1. Let $ {\hat S}(z)$ denote the log of $ S(z)$:

$\displaystyle {\hat S}(z) \isdef \ln(S(z)) = \ln(z^{-3}) = -3\ln(z)
$

so that on the unit circle we have

$\displaystyle {\hat S}(e^{j\omega T}) = -3\ln(e^{j\omega T}) = -3 j\omega T.
$

Since the desired amplitude response is unity, the real part of $ {\hat S}(e^{j\omega T})$ is zero. The imaginary part contains the phase response, normally in wrapped form, as shown in Fig.B.28 on page [*]. Matlab's unwrap function converts this three-segment phase response to a single-segment phase response. The unwrapped phase can now be multiplied by $ \texttt{power}=1.5$ to set the phase slope to $ -4.5$ as desired.

The resulting phase response is shown in Fig.B.25c on page [*]. From frequencies 0 to $ \pi$, the phase looks perfect. However, we have a problem at negative frequencies. They are negated! The phase response is not even odd as is necessary to obtain a real impulse response in the time domain. The reason this happened is that the phase unwrapping algorithm starts at $ \omega
= 0$ and continues unwrapping through the point at $ \omega T=\pi$ (half the sampling rate). This is incorrect for our purposes. We require any phase discontinuity to occur when crossing half the sampling rate, because this is where the frequency axis itself jumps from $ +\pi$ to $ -\pi$. We must therefore either write our own phase unwrapping algorithm, or somehow use it only for positive and negative frequencies separately.


Order a Hardcopy of Spectral Audio Signal Processing

Previous: Example 2: Rational Approximation
Next: Example 4: Phase Unwrapping, Forced Odd Phase Symmetry

written by Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See http://ccrma.stanford.edu/~jos/ for details.


Comments


No comments yet for this page


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )