Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Ads

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 4: Phase Unwrapping, Forced Odd Phase Symmetry

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 $ f_s/2$ is often needed when performing nonlinear spectral modifications.

Figure B.29: Matlab program for computing the frequency response of a fractional delay FIR filter by separately processing the positive-frequency amplitude response and unwrapped phase response, generating the negative-frequency response at the end via conjugate symmetry.

 
% 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);


Order a Hardcopy of Spectral Audio Signal Processing

Previous: Example 3: Unwrapped Phase
Next: Summary of Methods Tried So Far

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? )