FIR Digital Filter Design
FIR Fractional Delay Filter Design
Example 3: Unwrapped PhaseSearch Spectral Audio Signal Processing
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
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
, for example, to
obtain a single linear segment sloping from
to
(crossing 0 at 0), then a scaling by
(Example 1) or
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
. Matlab's unwrap function converts
this three-segment phase response to a single-segment phase response.
The unwrapped phase can now be multiplied by
The resulting phase response is shown in Fig.B.25c on
page
. From frequencies 0 to
, 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
and continues unwrapping through the point at
(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
to
. We must therefore either write
our own phase unwrapping algorithm, or somehow use it only for positive
and negative frequencies separately.
