Digital Filters
21
lowpass filter
and
H(
0
) = -
0
/2 .
(9)
These are respectively the magnitude and argument of the complex number
that is multiplied by the input function in (4). Therefore, we have verified a
general property of linear and time-invariant systems, i.e., sinusoidal inputs give
sinusoidal outputs, possibly with an amplitude rescaling and a phase shift
2
.
If the frequency of the input sine is thought of as a real variable in the
interval [0, ), the magnitude and phase responses become a function of such
variable and can be plotted as in fig. 1. At this point, the interpretation of such
curves as amplification and phase shift of sinusoidal inputs should be obvious.
(a)
(b)
0
1
2
3
0
0.2
0.4
0.6
0.8
frequency [rad/sample]
magnitude
0
1
2
3
-1.5
-1
-0.5
0
frequency [rad/sample]
phase [rad]
Figure 1: Frequency response (magnitude and phase) of an averaging filter
In order to plot curves such as those of fig. 1 it is not necessary to calculate
closed forms of the functions representing the magnitude (8) and the phase
response (9). Since with Octave/Matlab we can directly operate on arrays of
complex numbers, the following simple script will do the job:
global_decl; platform('octave');
w = [0:0.01:pi];
% frequency points
H = 0.5 + 0.5*exp(- i * w );
% complex frequency response
subplot(2,2,1); plot(w, abs(H));
% plot the magnitude
xlabel('frequency [rad/sample]');
ylabel('magnitude');
eval(myreplot);
subplot(2,2,2); plot(w, angle(H)); % plot the phase
xlabel('frequency [rad/sample]');
ylabel('phase [rad]');
eval(myreplot);
The averaging filter is the simplest form of lowpass filter. In a lowpass filter
the high frequencies are more attenuated than the low frequencies. Another
way to approach the analysis of a filter is to reason directly in the plane of the
complex variable z. In this plane (fig. 2) two families of points are marked: the
2
The reader can easily verify that this is true not only for complex sinusoids, but also for
real sinusoids. The real sinusoid can be expressed as a combination of complex sinusoids and
linearity can be applied.
Next Page >>
<< Previous Page
Back to the Table of Contents