Chapter 3
Chapter 3
It is a periodic function in the real variable w with a period of 21r. The DTFf is equiv-
alent to the representation of a signal as a sequence of samples, since the samples can
be computed from the DTFf and vice versa. The integral
x[n] = _.!._
211'
1,..
-11'
X (~w)~wn di.,; (3.2}
is used to evaluate the inverse DTFf. Note that the range of integration is limited to
one period of X(eiw). These two formulas resemble those that define the Fourier
64
Sec.3.1 The Discrete-Tlme Fourier Transform
series representation of a periodic function. In fact, the sample values x(n) can be
identified with the Fourier series coefficients of X(ei"'). Thble 3.1 contains an abbre-
viated list of discrete-time Fourier transform pairs.
x(n] X(ei..,)
1 2d((w))2,.
21r6((w- wa))2,.
cos won 1r6((w- wa))2,. + 1r6((w + Wo))2,.
11" 11'
sin won -:6((w- wa))2.. - -:6((w +wa))2,.
3 3
00
L 6[n-kN]
lc=-oo
1
1- ae-iw
x(n] = {
1
•
lni$N sin(w(N + l )]
0, lni>N sin( !f)
u[n]
c5(n- no]
1
(n + 1)a"u(n], lal <1
(n+k-1)1"
nl(k- 1)1 a u(n], lal <1
-nte DTFf is always periodic in w with period 211'. Thus impulses in the frequency domain
are actually impulse trains with a period of 211'. This is indicated by the notation ((·))2,.. c5(w) is a
Dirac delta function.
(3.3)
II The Frequency Domain
A number of similarities and differences between equations (3.1) and (3.3) become
evident when they are compared. For example, both are complex functions, and thus
are displayed in terms of real and imaginary parts or in terms of magnitude and phase.
Unlike the Fourier transform, however, the DTFf is periodic in frequency with period
27r. When x[n] is of finite length, the DTFf can be evaluated numerically for selected
frequencies, but the Fourier transform cannot, in general. The units of the frequency
variables are also different: w bas units of radians while n is measured in radians per
second.
The DTFf is used frequently because many signals, systems, and signal processing
operations can be described more conveniently in the frequency domain than in the
time domain. A number of properties of the DTFf are listed in Thble 3.2; these can
be very helpful in making difficult problems easy to solve.
"The symbo16((w)) 2 ,.. is the Dirac delta function. The notation ((-))2..
reflects the fact that the DTFf is always periodic in w with period 211'.
Sec. 3.1 The 01acrete-Time Fourier Transform 17
x[O) =
2~ [ X(ei'"') dw
00
X(ei 0 ) = L x[n]
n=-oo
are frequently useful for checking computations.
· The exercises in this section examine the frequen<-)' domain and the ways in which
the discrete-time Fourier transform may be used as an analysis tool.
(a) Examine and record the magnitude of each of the output sequences in the steady
state region, i.e., 4 ~ n ~ 128. The function x view2 can be used to examine
the magnitudes of these outputs one above the other. You will observe that the
outputs are essentially constant. The only differences are that the magnitudes
of the output sequences may differ from those of the inputs and that the output
sequences may have been shifted slightly in time.
(b) Construct a graph with amplitude along the vertical axis and frequency in the
range (0 ~ w ~ 1r) along the horizontal axis. Plot the peak magnitude values for
yt[n], y2 [n], .. . , y6 [n] on the graph-one point for each of the six frequencies.
88 The Frequency Domain I
Connect the points to form a continuous plot. Your result should approximate
the discrete-time Fourier transform magnitude, IH(ei"')l. . I
(c) The discrete-time Fourier transform, or DTFf, is a frequency-domain represen-
tation that is most often displayed in the frequency range -1r ~ w < 1r. Plots
of the DTFT are continuous curves. The computer is actually displaying discrete
I
sample values of the DTFT and connecting these points with straight lines. Use
the x dtft function to display the DTFT magnitude, IH(ei"')l. Sketch the trans-
form magnitude in the range 0 ~ w ~ 1r. How does it compare to your plot in
part (b)?
In this exercise the even and odd symmetry properties with respect to the discrete-time
I
Fourier transform are investigated. I
(a) Generate an arbitrary 5-point complex sequence, .X[n]. Do this by using x rgen
to create two random 5-point real sequences. Use x gain with the gain pa-
rameter equal to "0 1" (which represents the complex number j) to transform
I
one of the real sequences into a purely imaginary signal, then add the sequences
together using x add. Sketch the real and imaginary parts of .X[n}.
11
II
Sec. 3.1 The Discrete-Time Fourier Transform
(b) Using the computer, decompose x[n] into its four components, ae [n], a0 [n], be [n],
b0 [n], and provide a sketch for each. The functions x realpart and x imag-
part can be used to extract the real and imaginary parts, respectively. The even
and odd components can be obtained by using the x reverse, x add, x sub-
tract, and x gain functions. Next compute the DTFT of x[n]. Decompose
X(eiw) into its components Ce(eiw), C0 (&w), De(&w), and Do(&w) in the same
way. Recall from Chapter 1 that the function x dtft generates a 513 point file
"_dtft_" that contains samples of the transform. (Note that this file name begins
and ends with underbars.) You may reverse, add, and process this file appropri-
ately to generate Ce(&w), C0 (&w), De(&w), and Do(&w).
(c) Now individually take the discrete-time Fourier transform of ae[n], a0 [n], jbe[n],
and jb0 [n]. Summarize your findings by matching the time-domain and frequency-
domain components listed below.
Time Domain Frequency Domain
rul-v...., ae[n] Ce(&w) "e.a.l-e-v6At
.,.e,J-c.JJ a 0 [n]S x 5C0 (&w) re..l-oJJ
i ""a~I"'10 J -~be(n] 'De(ei_w) j....,«j; rt.,._•J- evevl
\""'llj~wt.,._v:J-JJjb0 [n] JDo(&w) ;"''lt}i".,-j -•JJ
These symmetry properties that you have observed apply for any arbitrary complex
sequence.
- EXERCISE 3.1.3. Proving the Symmetry Properties
In Chapter 2 and in the previous exercise the concept of a decomposition into
even and odd signal components was discussed. You saw that any arbitrary signal (real
or complex) could be expressed in terms of real-even, real-odd, imaginary-even, and
imaginary-odd components. In the previous exercise you were shown experimentally
that each of these components transforms to one of four related frequency-domain
components.
Consider the definitions for the even and odd components in the time domain and
the frequency domain:
ae[n] = !(a[n] + a[-n])
a0 [n] = !(a[n]- a[-n])
Ce(&w) = !(C(&w) + C(e-;w))
Co(&w) = !(C(&w)- C(e-;w))
I where a[n] and C(&w) are assumed to be purely real signals. Using the definition of
the DTFT, prove analytically that the relationships you found in the previous exercise
I are always true. (Hint: You may wish to use the fact that
00
L f[n] =0
I n=-oo
I
70 The Frequency Domain
if /[n) is odd. You may also wish to determine whether each of the components is
either even or odd. Then determine if each is real or imaginuy.)
(a) Using the function x dtft sketch the real and imaginuy parts of the DTFf of
the signal cc[n] contained in the file cc. Observe the symmetry in the real and
imaginary parts. What type of symmetry is present in the magnitude and phase
of the DTFf of this signal, i.e., which is an even function and which is odd?
(b) Now use X dtft to examine the DTFf of the complex signal, dd(n] contained
in the file dd. Sketch the real and imaginary parts of its DTFf. Also sketch the
magnitude and phase.
(c) It is very common to display the DTFf only over the range from 0 :S: w :S: 1r due
to Hermitian symmetry. Based on your observations in part (b), when would it
be inappropriate to display the transform in this limited range?
X(ei"') = L x[n)e-Jwn
n=-oo
= · · · + x[-l]ei"' + x[O) + x[l)e-;"' + x[2]e-;2w + · · ·.
Carefully examine each term in the DTFf and observe that it repeats in frequency
=
every 2w radians. This is because e-i2'"' 1 for n = 0, ±1, ±2, ....
Use x dtft to compute the DTFf of the signal aa[n) contained in the file aa By
examining the x d t ft display, estimate the numerical values for each of the following
using the periodicity property:
Note that X dtft only displays the DTFf in the range between -1r and 1r.
Sec. 3.1 The Discrete-Time Fourier Transform 71
(a) Display and sketch the 15-point signal ee[n] contained in the file ee using x
view. Using x dtft, display and sketch the imaginary part. Observe that
since ee[n] is an odd function, the DTFf is purely imaginary (i.e., its real part
is zero), and consequently only one sketch is necessary for its complete represen-
tation. Practically speaking, the real part of the DTFf shown in the plot is only
approximately zero due to limited numerical precision in the computation.
(b) Consider the signals
Yo[n] = ee[n- 1]
and
yi(n] = ee[n + 1].
Using the x lshift and x dtft functions, sketch their frequency responses. You
I will observe that the resulting frequency response is no longer purely imaginary.
Euler's formula states that
(3.4)
Display and sketch the real and imaginary parts of Yo(ei"') and Y1 (&"') and ob-
I serve the frequency-domain effects of shifting in time. ·
(c) By changing the summation variable, n in the DTFf definition (i.e., letting n -+
(a) Display and sketch IEE(el"')l the DTFf magnitude of ee[n], and also the DTFf
I magnitude of e;1rn/4 ee[n].
(b) Analytically derive the modulation property by explicitly taking the DTFf of
x[n]&an.
72 The Frequency Domain
(a) Display and sketch the magnitude responses of EE(ei111 ) and FF(ei111 ). Based on
these plots, sketch the magnitude of EE(ei111 ) FF(ei 111 ).
(b) Using the x convolve function, compute
y[n] = ee(n] * //(n].
Display and sketch the D1Ff magnitude of y[n].
(c) Consider deriving the convolution property. Recall that the convolution of two
signals x[n] and h[n] is defined by the convolution sum
00
Apply the DTFf definition to the convolution sum. Observe that this double
summation may be rewritten as
00 00
DTFf of la[n-mJ
since x(m] has no dependence on the variable n. Using the definition of the
DTFT and the shift property, show that this expression reduces to X (ei111 )H(& 111 ).
2~X(eJ
DTFT{x[n]h[n]} = 111 ) ® H(eJ111 )
where the circled star is used to denote a form of convolution called circular or periodic
convolution.
00
DTFT{x[n)h[n]} = L x[n)h[n)e-;"'".
n=-oo
By expressing x[n) as the inverse DTFf of X(&"') and substituting, this equation
becomes
DTFT{x[n)h[n]} = f,
n=-oo
~~·
211"
X(ei"')eifln dBh[n)e-;"'",
-•
z[n]
By interchanging the order of the sum and integration operations, show analyti-
cally. that the multiplication property is valid.
(b) Circular convolution is a topic that will be considered in more detail later in this
text. For the present we will consider only a simple example. Display and sketch
the DTFT magnitudes of the sequences f![n) and gg[n) contained in files ff and
gg. The circular convolution of FF(&"') and GG(&"') is very much like their
linear convolution except that the two signals are periodic and the integration is
confined to one period. Display and sketch the magnitude of
FF(ei"') ® GG(ei"')
using the multiplication property defined in equation (3.5), i.e., use the functions
x multiply and x dtft.
EXERCISE 3.1.10. The Initial Value Theorem
The initial value theorem states that
which is proportional to the area under a graph of the DTFT. The analogous relation-
ship with the domains reversed is
00
n=-oo
curve. Since x dtft produces an output file _dtft_containing the 513 samples
of the DTFf used in the graphics, the function x summer can be used to sum
the frequency domain samples. Th obtain the area under the curve, you must
multiply this sum by 21r /513. Now examine w(n) using x view and record the
value of vv(O). Verify that
1
vv[O) = 11' (area under VV(ei"')).
2
(a) Compute and sketch the DTFf magnitudes of the following finite length se-
quences using x ~iggen, x multiply, and x dtft:
(I) sin("'8n)(u[n)- u(n- 64)).
(II) cos( wan)( u(n) - u(n - 64)).
(Ill) u(n) - u[n - 32).
(lv) siu<;:/2 ) (u(n + 20)- u[n- 21]). You may use x fdesign with the rectan-
gular window option to create sin[(7rn/2)/7rn).
(v) A 64-point square wave with period 8.
(vi) A 64-point impulse train with period 8.
Notice that the discrete-time Fourier transforms of these signals are slightly dif-
ferent from the Fourier transforms of the related continuous-time signals. Ex-
plain the differences.
(b) It can be shown analytically that the discrete-time Fourier transform of a sine
wave is a pair of impulses; however, the results that you observed on the computer
were not impulses. Explain this apparent contradiction.
3.2 FILTERS
The term "filter" describes a very large variety of different systems. However, it is
commonly used to refer to LTI systems with frequency-selective frequency responses.
These filters allow certain regions of the spectrum to remaiJ! undisturbed while other
spectral regions are attenuated. Familiar examples include lowpass, highpass, and
bandpass filters.
Filters are specified by their frequency-domain magnitude characteristics. Ideally,
the frequency response of a filter should display only two types of behavior: it should
have one or more spectral regions of constant nonzero amplitude (called the pass-
band(s)) and one or more regions where the frequency response is zero (called the
Sec. 3.2 Filar! 71
stopband(s)). These ideal filters are not realizable in practice. Realizable filters will
also contain intermediate regions called transition bands. Because the frequency re-
sponse must be continuous, a transition band must lie between each passband and
stopband.
Realizable filters are designed to approximate ideal filters to within certain pre-
scribed tolerances. These tolerances are defined by the widths of the transition re-
gions, the maximum passband deviation, and the maximum stopband deviation. These
parameters are illustrated in Fig. 3.1 for a lowpass filter. The effect is to define are-
gion on the graph in which the magnitude response of the filter must lie. The ideal
frequency response is shown by the solid black line. The following parameters define
the match between the digital filter and the ideal:
6p passband ripple,
6. stopband ripple,
Wt lower cutoff frequency,
Wu upper cutoff frequency,
We nominal cutoff frequency.
For high-quality filters that closely approximate the ideal response, the ripples in the
stopband may not be visible in a plot of the magnitude response. In these cases, the log
magnitude response, defined as 20log10 IH{&w)l, may be more useful. The vertical
axis of the log magnitude plot is measured in decibels and clearly shows the variation
in the stopband region. Thus, an alternate way of specifying the maximum stopband
deviation is through the attenuation where
Since the phase function is a multivalued function, the principal value is generally
displayed. This results in a function with an amplitude that ranges between -11' and
+1r. The phase response of a filter can be important in certain applications, although
historically greater attention has been given to the magnitude response.
Digital filters can be divided into two general categories based on their lengths:
finite impulse response (FIR) filters and infinite impulse response (IIR) filters. FIR
filters have impulse responses that are finite in duration; they can be implemented
conveniently using convolution. IIR filters, on the other hand, are infinite in dura-
tion and are implemented using difference equations. Much can be said about digital
filters, their properties, and methods for their design, but this is the topic of the com-
panion text, Digital Filters: A Computer Laboratory Text. The few exercises that follow
try to provide some limited familiarity with this topic.
78 The Frequency Domain
I
I
I
I
L-------------
w
Wt
Figure 3.1. Tolerances for specifying the acceptable performance of a lowpass filter. The
ideal filter H(~..,) is shown by the solid line.
Give a rough sketch of this signal for w0 = 1r /2, 1r /4, 1r /6, and 1r /8. The function
x fdesign (using the rectangular window option) can be used to construct lowpass
filters that have this time domain characteristic.
(a) Design four 32-point lowpass filters with cutoff frequencies as specified above.
Examine them carefully in both the time domain and the frequency domain. In
the time domain each impulse response has a peaked cluster of samples centered
in the middle of the sequence. This cluster is called the main lobe. How is the
width of the main lobe in the impulse response related to the width of the pass-
band of the filter?
(b) The step response of a filter is the output when the input is an ideal unit step,
u[nJ. In this exercise, approximate the step function by a block of length 100 cre-
ated using x siggen. Sketch the step responses for the set of lowpass filters
used in part (a). lhlncate your result to 50 samples using x truncate to avoid
displaying the erroneous points due to the block approximation of the unit step.
Determine the relationship between the slope of the step response in the mid-
dle of the transition and the main lobe width of the impulse response. Observe
that the ripple heights (overshoot and undershoot) in the step response are not
significantly affected by the nominal cutoff frequency.
(a) Which window gives the greatest attenuation? What is the value of that attenu-
ation? Does it seem to depend on the filter length? ·
(b) Which option gives the narrowest transition band for a given filter length? How
does the transition band depend on the filter length?
An LTI system can be used to alter the spectral shape of the input. For the random I
signals generated by x rgen, the DTFf has energy that is uniformly distributed in
the frequency domain. Thus the frequency response of the LTI system shapes the
spectrum of the random signal. !I
3.3 LINEAR PHASE I
The DTFf is a complex function that can be expressed in terms of either its real and
imaginary parts or its magnitude and phase-the latter being more common. An im-
portant subclass of signals is the class for which the DTFf phase is linear. Real, linear I
phase signals have the property that their discrete-time Fourier transforms can be
written as A(ei"')e-Jwno where A(ei"') is either purely real or purely imaginary. In
this context, A(ei"') plays the role of an amplitude function and -wno plays the role I
of the phase. Since this phase component is a linear function of w, signals of this form
are termed linear-phase sequences.
The linear-phase condition imposes a well-defined symmetric structure on the sig- il
nal in the time domain. For odd length real sequences, the samples are either symmet-
ric or antisymmetric about a midpoint as shown in Fig. 3.2. For even length sequences,
the symmetry characteristics are similar, except that the point of symmetry lies mid-
way between two sample values. For finite length sequences that begin at N 1 and end
at N2 (Nt < N2), the midpoint, no is at
n .I I J:I I I . ., n
n
T n
real odd lengtht symmetric (even function) zero-phase sequence h(n] can always be
expressed as
L L
H(eiw) = L h(n]e-;wn = h(O] + 2 L h(n] coswn. (3.6)
n=-L n=l
Create an arbitrary 13-point zero-phase sequence, e(n]. There are many ways to do
this, one of which is to use x fdesign. Sketch the sequence and its DTFT. Now
create
/(n] = e(n] + 6(n]
and sketch F(&w). Compare E(&w) and F(&w) and explain why they have similar
spectral shapes.
Without the aid of the computer, give a rough sketch of the magnitude response
of h 3 [n]. Verify your answer by explicitly computing h 3 [n] using x add and
taking its DTFf magnitude.