Real-Time Digital Signal Processing. Sen M Kuo, Bob H Lee
Copyright # 2001 John Wiley & Sons Ltd
ISBNs: 0-470-84137-0 (Hardback); 0-470-84534-1 (Electronic)
4
Frequency Analysis
Frequency analysis of any given signal involves the transformation of a time-domain
signal into its frequency components. The need for describing a signal in the frequency
domain exists because signal processing is generally accomplished using systems that are
described in terms of frequency response. Converting the time-domain signals and
systems into the frequency domain is extremely helpful in understanding the characteristics of both signals and systems.
In Section 4.1, the Fourier series and Fourier transform will be introduced. The
Fourier series is an effective technique for handling periodic functions. It provides a
method for expressing a periodic function as the linear combination of sinusoidal
functions. The Fourier transform is needed to develop the concept of frequency-domain
signal processing. Section 4.2 introduces the z-transform, its important properties, and
its inverse transform. Section 4.3 shows the analysis and implementation of digital
systems using the z-transform. Basic concepts of discrete Fourier transforms will be
introduced in Section 4.4, but detailed treatments will be presented in Chapter 7. The
application of frequency analysis techniques using MATLAB to design notch filters and
analyze room acoustics will be presented in Section 4.5. Finally, real-time experiments
using the TMS320C55x will be presented in Section 4.6.
4.1
Fourier Series and Transform
In this section, we will introduce the representation of analog periodic signals using
Fourier series. We will then expand the analysis to the Fourier transform representation
of broad classes of finite energy signals.
4.1.1 Fourier Series
Any periodic signal, x(t), can be represented as the sum of an infinite number of
harmonically related sinusoids and complex exponentials. The basic mathematical
representation of periodic signal x(t) with period T0 (in seconds) is the Fourier series
defined as
128
FREQUENCY ANALYSIS
x
t
1
X
ck e jkO0 t ,
4:1:1
k 1
where ck is the Fourier series coefficient, and V0 2p=T0 is the fundamental frequency
(in radians per second). The Fourier series describes a periodic signal in terms of infinite
sinusoids. The sinusoidal component of frequency kV0 is known as the kth harmonic.
The kth Fourier coefficient, ck , is expressed as
1
ck
x
te jkV0 t dt:
4:1:2
T0 T0
This integral can be evaluated over any interval of length T0 . For an odd function, it is
easier to integrate from 0 to T0 . For an even function, integration from T0 =2 to T0 =2
is commonly
used. The term with k 0 is referred to as the DC component because
c0 T10 T0 x
tdt equals the average value of x(t) over one period.
Example 4.1: The waveform of a rectangular pulse train shown in Figure 4.1 is a
periodic signal with period T0 , and can be expressed as
x
t
kT0 t=2 t kT0 t=2
otherwise,
A,
0,
4:1:3
where k 0, 1, 2, . . . , and t < T0 . Since x(t) is an even signal, it is convenient to select the integration from T0 =2 to T0 =2. From (4.1.2), we have
ck
1
T0
kV0 t
t #
sin
2
A e jkV0 t
2
At
2
jkV0 t
:
Ae
dt
T0
kV0 t
T0
T0
jkV0
t
2
2
2
"
T0
4:1:4
This equation shows that ck has a maximum value At=T0 at V0 0, decays to 0 as
V0 ! 1, and equals 0 at frequencies that are multiples of p. Because the
periodic signal x(t) is an even function, the Fourier coefficients ck are real values.
For the rectangular pulse train with a fixed period T0 , the effect of decreasing t is to
spread the signal power over the frequency range. On the other hand, when t is fixed but
the period T0 increases, the spacing between adjacent spectral lines decreases.
x(t)
A
−T0
2
−T0
Figure 4.1
−
T0
2
t 0 t
2
2
t
T0
Rectangular pulse train
129
FOURIER SERIES AND TRANSFORM
A periodic signal has infinite energy and finite power, which is defined by Parseval's
theorem as
Px
1
T0
T0
1
X
x
t
2 dt
ck
2 :
4:1:5
k 1
Since jck j2 represents the power of the kth harmonic component of the signal, the total
power of the periodic signal is simply the sum of the powers of all harmonics.
The complex-valued Fourier coefficients, ck , can be expressed as
ck jck je jfk :
4:1:6
A plot of jck j versus the frequency index k is called the amplitude (magnitude) spectrum,
and a plot of fk versus k is called the phase spectrum. If the periodic signal x(t) is real
valued, it is easy to show that c0 is real valued and that ck and c k are complex
conjugates. That is,
ck c k ,
j c k j j ck j
and
f
k
fk :
4:1:7
Therefore the amplitude spectrum is an even function of frequency V, and the phase
spectrum is an odd function of V for a real-valued periodic signal.
If we plot jck j2 as a function of the discrete frequencies kV0 , we can show that the
power of the periodic signal is distributed among the various frequency components.
This plot is called the power density spectrum of the periodic signal x(t). Since the power
in a periodic signal exists only at discrete values of frequencies kV0 , the signal has a line
spectrum. The spacing between two consecutive spectral lines is equal to the fundamental frequency V0 .
Example 4.2: Consider the output of an ideal oscillator as the perfect sinewave
expressed as
x
t sin
2pf0 t,
f0
V0
:
2p
We can then calculate the Fourier series coefficients using Euler's formula
(Appendix A.3) as
sin
2pf0 t
1 j2pf0 t
e
2j
e
j2pf0 t
1
X
ck e jk2pf0 t :
k 1
We have
8
< 1=2j,
ck
1=2j,
:
0,
k1
k 1
otherwise.
4:1:8
130
FREQUENCY ANALYSIS
This equation indicates that there is no power in any of the harmonic k 6 1.
Therefore Fourier series analysis is a useful tool for determining the quality
(purity) of a sinusoidal signal.
4.1.2 Fourier Transform
We have shown that a periodic signal has a line spectrum and that the spacing between
two consecutive spectral lines is equal to the fundamental frequency V0 2p=T0 . The
number of frequency components increases as T0 is increased, whereas the envelope of
the magnitude of the spectral components remains the same. If we increase the period
without limit (i.e., T0 ! 1), the line spacing tends toward 0. The discrete frequency
components converge into a continuum of frequency components whose magnitudes
have the same shape as the envelope of the discrete spectra. In other words, when the
period T0 approaches infinity, the pulse train shown in Figure 4.1 reduces to a single
pulse, which is no longer periodic. Thus the signal becomes non-periodic and its
spectrum becomes continuous.
In real applications, most signals such as speech signals are not periodic. Consider the
signal that is not periodic (V0 ! 0 or T0 ! 1), the number of exponential components
in (4.1.1) tends toward infinity and the summation becomes integration over the entire
continuous range ( 1, 1. Thus (4.1.1) can be rewritten as
1
x
t
2p
1
1
X
Ve jVt dV:
4:1:9
This integral is called the inverse Fourier transform. Similarly, (4.1.2) can be rewritten
as
X
V
1
1
x
te
jVt
dt,
4:1:10
which is called the Fourier transform (FT) of x(t). Note that the time functions
are represented using lowercase letters, and the corresponding frequency functions are
denoted by using capital letters. A sufficient condition for a function x(t) that possesses
a Fourier transform is
1
1
jx
tjdt < 1:
4:1:11
That is, x(t) is absolutely integrable.
Example 4.3: Calculate the Fourier transform of the function x
t e
a > 0 and u(t) is the unit step function. From (4.1.10), we have
at
u
t, where
131
FOURIER SERIES AND TRANSFORM
X
V
1
11
e
e
0
at
u
te
ajVt
jVt
dt
dt
1
:
a jV
The Fourier transform X
V is also called the spectrum of the analog signal x(t). The
spectrum X
V is a complex-valued function of frequency V, and can be expressed as
X
V
X
V
e jf
V ,
4:1:12
where jX
Vj is the magnitude spectrum of x(t), and f
V is the phase spectrum of x(t).
In the frequency domain, jX
Vj2 reveals the distribution of energy with respect to the
frequency and is called the energy density spectrum of the signal. When x(t) is any finite
energy signal, its energy is
Ex
1
1
jx
tj dt
2p
1
2
1
1
jX
Vj2 dV:
4:1:13
This is called Parseval's theorem for finite energy signals, which expresses the principle
of conservation of energy in time and frequency domains.
For a function x(t) defined over a finite interval T0 , i.e., x
t 0 for jtj > T0 =2, the
Fourier series coefficients ck can be expressed in terms of X
V using (4.1.2) and (4.1.10) as
1
X
kV0 :
T0
ck
4:1:14
For a given finite interval function, its Fourier transform at a set of equally spaced
points on the V-axis is specified exactly by the Fourier series coefficients. The distance
between adjacent points on the V-axis is 2p=T0 radians.
If x(t) is a real-valued signal, we can show from (4.1.9) and (4.1.10) that
FTx
t X
V
and
X
V X
V:
4:1:15
jX
Vj jX
Vj
and
f
V
4:1:16
It follows that
f
V:
Therefore the amplitude spectrum jX
Vj is an even function of V, and the phase
spectrum is an odd function.
If the time signal x(t) is a delta function d
t, its Fourier transform can be calculated as
X
V
1
1
d
te
jVt
dt 1:
4:1:17
132
FREQUENCY ANALYSIS
This indicates that the delta function has frequency components at all frequencies. In
fact, the narrower the time waveform, the greater the range of frequencies where the
signal has significant frequency components.
Some useful functions and their Fourier transforms are summarized in Table 4.1. We
may find the Fourier transforms of other functions using the Fourier transform properties listed in Table 4.2.
Table 4.1
Common Fourier transform pairs
Time function x
t
Fourier transform X
V
d
t
1
d
t
t
1
e
at
jVt
e
2pd
V
1
a jV
u
t
e jV0 t
sin
V0 t
cos
V0 t
1, t 0
sgn
t
1, t < 0
2pd
V
V0
jpd
V V0
d
V
V0
pd
V V0 d
V
V0
2
jV
Table 4.2 Useful properties of the Fourier transform
Time function x
t
Property
Fourier transform X
V
a1 x1
t a2 x2
t
dx
t
dt
Linearity
a1 X1
V a2 X2
V
Differentiation in time
domain
jVX
V
tx
t
Differentiation in
frequency domain
j
x
t
Time reversal
X
V
Time shifting
e
x
t
a
x
at
Time scaling
x
t sin
V0 t
Modulation
x
t cos
V0 t
Modulation
e
at
x
t
Frequency shifting
dX
V
dV
jVa
X
V
1
V
X
jaj
a
1
X
V V0 X
V V0
2j
1
X
V V0 X
V V0
2
X
V a
THE Z-TRANSFORM
133
Example 4.4: Find the Fourier transform of the time function
ajtj
y
t e
,
a > 0:
This equation can be written as
y
t x
t x
t,
where
at
x
t e
u
t,
a > 0:
From Table 4.1, we have X
V 1=
a jV. From Table 4.2, we have
Y
V X
V X
V. This results in
Y
V
4.2
1
a
jV
1
2a
:
2
a jV a V2
The z-Transform
Continuous-time signals and systems are commonly analyzed using the Fourier transform and the Laplace transform (will be introduced in Chapter 6). For discrete-time
systems, the transform corresponding to the Laplace transform is the z-transform. The
z-transform yields a frequency-domain description of discrete-time signals and systems,
and provides a powerful tool in the design and implementation of digital filters. In this
section, we will introduce the z-transform, discuss some important properties, and show
its importance in the analysis of linear time-invariant (LTI) systems.
4.2.1 Definitions and Basic Properties
The z-transform (ZT) of a digital signal, x
n,
series
X
z
1
X
1 < n < 1, is defined as the power
x
nz n ,
4:2:1
n 1
where X
z represents the z-transform of x
n. The variable z is a complex variable, and
can be expressed in polar form as
z re jy ,
4:2:2
where r is the magnitude (radius) of z, and y is the angle of z. When r 1, jzj 1 is
called the unit circle on the z-plane. Since the z-transform involves an infinite power
series, it exists only for those values of z where the power series defined in (4.2.1)
134
FREQUENCY ANALYSIS
converges. The region on the complex z-plane in which the power series converges is
called the region of convergence (ROC).
As discussed in Section 3.1, the signal x
n encountered in most practical applications
is causal. For this type of signal, the two-sided z-transform defined in (4.2.1) becomes a
one-sided z-transform expressed as
X
z
1
X
x
nz n :
4:2:3
n0
Clearly if x
n is causal, the one-sided and two-sided z-transforms are equivalent.
Example 4.5: Consider the exponential function
x
n an u
n:
The z-transform can be computed as
X
z
1
X
an z n u
n
n 1
1
X
az 1 n :
n0
Using the infinite geometric series given in Appendix A.2, we have
X
z
1
1
az
if jaz 1 j < 1:
1
The equivalent condition for convergence (or ROC) is
jzj > jaj:
Thus we obtain X
z as
X
z
z
z
a
,
jzj > jaj:
There is a zero at the origin z 0 and a pole at z a. The ROC and the pole±zero
plot are illustrated in Figure 4.2 for 0 < a < 1, where `' marks the position of the
pole and `o' denotes the position of the zero. The ROC is the region outside
the circle with radius a. Therefore the ROC is always bounded by a circle since the
convergence condition is on the magnitude jzj. A causal signal is characterized by
an ROC that is outside the maximum pole circle and does not contain any pole.
The properties of the z-transform are extremely useful for the analysis of discrete-time
LTI systems. These properties are summarized as follows:
1. Linearity (superposition). The z-transform is a linear transformation. Therefore the
z-transform of the sum of two sequences is the sum of the z-transforms of the
individual sequences. That is,
135
THE Z-TRANSFORM
Im[z]
|z| = a
|z| = 1
Re[z]
Figure 4.2 Pole, zero, and ROC (shaded area) on the z-plane
ZTa1 x1
n a2 x2
n a1 ZTx1
n a2 ZTx2
n
a1 X1
z a2 X2
z,
4:2:4
2. where a1 and a2 are constants, and X1
z and X2
z are the z-transforms of the
signals x1
n and x2
n, respectively. This linearity property can be generalized for
an arbitrary number of signals.
2. Time shifting. The z-transform of the shifted (delayed) signal y
n x
n
Y
z ZTx
n
k z k X
z,
k is
4:2:5
2. where the minus sign corresponds to a delay of k samples. This delay property states
that the effect of delaying a signal by k samples is equivalent to multiplying its
z-transform by a factor of z k . For example, ZTx
n 1 z 1 X
z. Thus the unit
delay z 1 in the z-domain corresponds to a time shift of one sampling period in the
time domain.
3. Convolution. Consider the signal
x
n x1
n x2
n,
4:2:6
2. where denotes the linear convolution introduced in Chapter 3, we have
X
z X1
zX2
z:
4:2:7
2. Therefore the z-transform converts the convolution of two time-domain signals to
the multiplication of their corresponding z-transforms.
Some of the commonly used signals and their z-transforms are summarized in
Table 4.3.