FIR Digital Filter Design
FIR Fractional Delay Filter Design
Example 4: Phase Unwrapping, Forced Odd Phase SymmetrySearch Spectral Audio Signal Processing
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
To solve the problem with Example 3, we can simply unwrap the positive-frequency portion of the desired frequency response, and construct the negative-frequency frequency response as the conjugate-flip of the positive-frequency response.
The result of this approach is shown in Fig.B.25d on
page
, and the matlab code is given in Fig.B.29.
To illustrate separate processing of phase and magnitude data, this
example works in the linear domain instead of the log domain, but
either method works just as well.
As a fine point, note that the phase-response sample at exactly half
the sampling rate must be zeroed in order that the phase
response be an odd sequence. Forgetting to do this will result
in a prominent imaginary alternating sequence in the final impulse
response. Zeroing the imaginary part at
is often needed when
performing nonlinear spectral modifications.
% Example 4: Work on magnitude and phase separately, % and enforce spectral conjugate symmetry: No2 = N/2; Nspec = No2+1; % Index of fs/2 in all spectrum arrays Sh = S(1:Nspec); % Concentrate on (+) frequencies first Sm = abs(Sh); Sp = angle(Sh); Spu = unwrap(Sp); if Spu(1) ~= 0, error('DC phase should be zero'); end % Apply spectral transformation separately % to magnitude and phase: Stm = Sm .^ power; Stpu = Spu * power; Stu = Stm .* exp(j*Stpu); % Reassemble complex spectrum % Append negative-frequency spectrum: Stu = [Stu,conj(Stu(No2:-1:2))]; % append conjugate flip Stu(No2+1)=real(Stu(No2+1)); % enforce odd imag part Stpu = angle(Stu); plottitle = sprintf('angle(abs(S)^{%0.1f}',... '*exp(-j*%0.1f*unwrap(angle(S))), ',... 'oddified',power,power); phasesubplot(Stpu,plottitle,4,4); |
