Signals and Systems - Electrical Engineering

(avery) #1

592 C H A P T E R 10: Fourier Analysis of Discrete-Time Signals and Systems


Phase unwrapping
Another problem with phase computation has to do with the way the phase is displayed as a function
of frequency with values within [−π,π)—thewrapped phase. If the DTFT of a signal is zero or infi-
nite at some frequencies, the phase at those frequencies is not determined, as any value would be
as good as any other because the magnitude is zero or infinity. On the other hand, if there are
no zeros or poles on the unit circle to make the magnitude zero or infinite at some frequencies,
the phase is continuous. However, because of the way the phase is computed and displayed with
values between−πtoπ, it seems discontinuous. These phase discontinuities are 2πwide, mak-
ing the phase values right before and right after the discontinuity identical. Finding the frequencies
where these discontinuities occur and patching the phase, it is possible to obtain the continuous
phase. The process is called theunwrapping of the phase. The MATLAB functionunwrapis used for this
purpose.

nExample 10.10
Consider a sinusoidx[n]=sin(πn/ 2 )to which we add a Gaussian noiseη[n] generated by the
MATLAB functionrandn, which theoretically can take any real value. Use the significance of the
magnitude computed by MATLAB to estimate the phase.

Solution

The DTFT ofx[n] consists of two impulses, one atπ/2 and the other at−π/2. Thus, the phase
should be zero everywhere except at these frequencies. However, any amount of added noise (even
in noiseless cases, given the computational precision of MATLAB) would give nonzero phases in
places where it should be zero.

In this case, since we know that the magnitude spectrum is significant at the negative and the
positive values of the sinusoid frequency, we use the magnitude as a mask to indicate where
the phase computation can be considered important given the significance of the magnitude.
The following script is used to illustrate the masking using the significance of the magnitude.

%%%%%%%%%%%%%%%%%%%%%%%%%
% Example 10.10---phase of sinusoid in noise
%%%%%%%%%%%%%%%%%%%%%%%%%
n = 0:99; x = sin(pi∗n/2) + 0.1∗randn(1,100); % sine plus noise
X = fftshift(fft(x)); % fft of signal
X1 = abs(X); theta = angle(X); % magnitude and phase
theta1 = theta.∗X1/max(X1); % masked phase
L = length(X); w = 0:2∗pi/L:2∗pi - 2∗pi/L;w1 = (w - pi)/pi; % frequency range

Using the mask, the noisy phase (Figure 10.6(b)) is converted into the phase of the sine, which
occurs when the magnitude is significant (Figures 10.5(a) and 10.5(c)). n
Free download pdf