Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Phase Response

The phase of the frequency response is called the phase response. Like the phase of any complex number, it is given by the arctangent of the imaginary part of $ H(e^{j\omega T})$ divided by its real part, and it specifies the delay of the filter at each frequency. The phase response is a good way to look at short filter delays which are not directly perceivable as causing an ``echo''.4.4 For longer delays in audio, it is usually best to study the filter impulse response, which is output of the filter when its input is $ [1,0,0,0,\ldots]$ (an ``impulse''). We will show later that the impulse response is also given by the inverse z transform of the filter transfer function (or, equivalently, the inverse Fourier transform of the filter frequency response).

In this example, the phase response is

$\displaystyle \angle{H(e^{j\omega T})} = \angle \left(1 + g_1 e^{-jM_1\omega T}\right)
- \angle \left ( 1 + g_2 e^{-jM_2\omega T} \right).

A specific case is plotted in Fig.3.10b, corresponding to the amplitude response in Fig.3.10a. The impulse response is plotted in Fig.3.8. The matlab code for producing these figures is shown in Fig.3.11. (The plotting utility plotfr is given in §J.4.) In Octave or the Matlab Signal Processing Toolbox, a figure similar to Fig.3.10 can be produced by typing simply freqz(B,A,Nspec).

Figure 3.11: Matlab script for computing and displaying the frequency response of the example filter $ y(n) = x(n) + 0.5^3 x(n-3) - 0.9^5 y(n-5)$ .

% efr.m - frequency response computation in Matlab/Octave

% Example filter:
g1 = 0.5^3; B = [1 0 0 g1];      % Feedforward coeffs
g2 = 0.9^5; A = [1 0 0 0 0 g2];  % Feedback coefficients

Nfft = 1024;         % FFT size
Nspec = 1+Nfft/2;    % Show only positive frequencies
f=[0:Nspec-1]/Nfft;  % Frequency axis
Xnum = fft(B,Nfft);  % Frequency response of FIR part
Xden = fft(A,Nfft);  % Frequency response, feedback part
X = Xnum ./ Xden;    % Should check for divide by zero!

clf; figure(1);      % Matlab-compatible plot
plotfr(X(1:Nspec),f);% Plot frequency response
cmd = 'print -deps ../eps/efr.eps'; disp(cmd); eval(cmd);

Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work]  [Order a printed hardcopy]  [Comment on this page via email]

``Introduction to Digital Filters with Audio Applications'', by Julius O. Smith III, (September 2007 Edition)
Copyright © 2024-05-20 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University