Digital Signal Processing Reference
In-Depth Information
Program 6.2. MATLAB program for Example 6.12.
% Example 6.12
% Plot the frequency response and phase response
% Case a
figure (1)
[h w] ¼ freqz([1],[1 -0.5],1024); % Calculate frequency response
phi ¼ 180*unwrap(angle(h))/pi;
subplot(2,1,1), plot(w,abs(h)),grid; xlabel(
Frequency (radians)
),
'
'
ylabel(
)
subplot(2,1,2), plot(w,phi),grid; xlabel(
Magnitude
'
'
Frequency (radians)
), ylabel(
Phase
'
'
'
(degrees)
)
% Case b
figure (2)
[h w]
'
freqz([1 -0.5],[1],1024); % Calculate frequency response
phi ¼ 180*unwrap(angle(h))/pi;
subplot(2,1,1), plot(w,abs(h)),grid;xlabel( ' Frequency (radians) ' ),
ylabel( ' Magnitude ' )
subplot(2,1,2), plot(w,phi),grid; xlabel( ' Frequency (radians) ' ), ylabel( ' Phase
(degrees) ' )
% Case c
figure (3)
[h w] ¼ freqz([0.5 0 -0.32],[1 -0.5 0.25],1024); % Calculate frequency response
phi ¼ 180*unwrap(angle(h))/pi;
subplot(2,1,1), plot(w,abs(h)),grid;
xlabel( ' Frequency (radians) ' ),ylabel( ' Magnitude ' )
subplot(2,1,2), plot(w,phi),grid;
xlabel( ' Frequency (radians) ' ), ylabel( ' Phase (degrees) ' )
% Case d
figure (4)
[h w] ¼ freqz([1 -0.9 0.81], [1 -0.6 0.36],1024); % Calculate frequency response
phi ¼ 180*unwrap(angle(h))/pi;
subplot(2,1,1), plot(w,abs(h)),grid; xlabel( ' Frequency (radians) ' ),
ylabel( ' Magnitude ' )
subplot(2,1,2), plot(w,phi),grid; xlabel( ' Frequency (radians) ' ), ylabel( ' Phase
(degrees)
¼
)
'
%
6.6 REALIZATION OF DIGITAL FILTERS
In this section, basic realization methods for digital filters are discussed. Digital filters described by the
transfer function HðzÞ may be generally realized into the following forms:
• Direct-form I
• Direct-form II
• Cascade
• Parallel
(The reader can explore various lattice realizations in the textbook by Stearns and Hush [1990].)
Search WWH ::




Custom Search