Chapter 1
Chapter 1
Processing
Digital Signal
Processing
10 9 8 7 6 5 4 3 2 1
KeyWords
List of Figures ix
List of Tables xv
Preface xvii
Acknowledgments xxi
1 Discrete-Time Signals and Systems 1
1.1 Introduction 1
1.2 Properties of Discrete-Time Signals 2
1.3 The Unit Step and Unit Impulse Signals 8
1.4 Complex Exponential and Sinusoidal Signals 10
1.5 Discrete-Time Systems 13
1.6 Linear Shift-Invariant Systems 19
1.7 Chapter Overview 22
2 Discrete-Time Signal Transforms 23
2.1 Introduction 23
2.2 Signals as Linear Combinations of Complex Exponentials 24
2.3 Fourier Series for Periodic Signals 25
2.4 The Fourier Transform 26
2.5 The z Transform 37
2.6 Chapter Overview 53
3 Sampling and Analog to Digital Conversion 55
3.1 Introduction 55
3.2 Signal Sampling and Reconstruction 55
3.3 Analog-to-Digital Conversion 59
3.4 Chapter Overview 65
4 Discrete Fourier Transform and Fast Fourier
Transform 65
4.1 Introduction 65
4.2 Discrete Fourier Transform 66
viii • Contents
transformation.94
Figure 5.14. Flow graph for an IIR Filter from Example 5.1. 95
Figure 5.15. Magnitude and phase responses of IIR Butterworth
lowpass filter of Example 5.2. 97
xii • List of Figures
Motivation for this book comes from the assessment that technological
knowledge transmission should not be restricted to the traditional sequence
of courses present in most undergraduate programs. Those courses have
and will maintain in the foreseeable future a vital role in the formation of
qualified professionals. Nevertheless, there is an ever-growing need for
texts written in a concise (although not less accurate) format to teach in a
few hours the basic theory and essential techniques of a subject, as well as
to provide understanding of some related applications. This book aims to
fill this gap, being directed to people who need to acquire the fundamen-
tals of digital signal processing (DSP) in a short time, during a three hours
flight, for example.
DSP works with digital representations of signals, modifying those
in order to improve their analysis, transmission, and reception. Starting in
the 1960s, the use of DSP has been growing continuously, because of the
development of powerful and efficient methods, particularly filter design
techniques and fast Fourier transform (FFT) algorithms, opening several
application areas. The advancement of integrated circuits technology
further contributes to the popularization of DSP, allowing for high-speed
implementations of complex processes.
In this book, we present the fundamentals of DSP in a concise format
accessible to anyone with an adequate mathematical background. We do
not assume a previous course on signals and systems, as is usually the
case with undergraduate textbooks. Knowledge of differential and integral
calculus and of finite and infinite sequences and series, as well as complex
numbers, is the basis needed to read and understand the present text.
Our book should be of interest to anyone with an engineering or
sciences background who must attend on a short notice a technical meet-
ing or who needs to use a DSP software tool, but does not have enough
time to learn all theory behind the involved methods. As an example,
DSP textbooks typically describe in details optimization techniques for
equiripple FIR filters parameters selection or for minimizing IIR filters
xviii • Preface
criteria, and many other textbooks and technical papers are available on
DSP-related subjects.
Finally, we hope that this book will be helpful to professionals and
students in need of an introduction to the area of DSP.
João Marques de Carvalho, Edmar Candeia Gurjão, Luciana Ribeiro
Veloso, and Carlos Danilo Miranda Regis
Acknowledgments
The authors express their gratitude to all those who made this book
possible, especially to their families for the continuous support.
The authors are thankful to professor Orlando Baiocchi from the
University of Washington, Tacoma, United States, who supported this
project from the beginning and helped with the reviewing process.
The authors also acknowledge the support of Joel Stein from
Momentum Press who provided the documents and guidance required
during the writing process.
CHAPTER 1
Discrete-Time Signals
and Systems
1.1 Introduction
s(t)
−4 −3 −2 −1 0 1 2 3 4 n
(b)
1.2.1 Periodicity
for any value of n. The integer N is called the period of the signal.
Discrete-Time Signals and Systems • 3
x(n)
2
... 1 ...
Equation 1.2 holds for any integer multiple of N. Figure 1.2 shows a
periodic signal where N0 is the smallest value that period N can assume,
called fundamental period. Thus, this signal is periodic for any period
N = kN 0, k integer. Equation 1.2, thus, generalizes to:
E= ∑ | x(n) |2 . (1.4)
n =−∞
P = lim
N →∞ N
∑ | x(n) |2 .
(1.5)
n =− N2
If x(n) has finite energy (E < ∞), then P = 0, and the signal is called
an energy signal. If E is infinite and P is finite and non-null, then x(n) is
known as a power signal.
All finite duration signals with finite amplitude are energy signals. All
periodic signals are power signals, but not all power signals are necessar-
ily periodic.
If a signal is antisymmetric with respect to the vertical axis, that is, if:
x ( n) = − x ( − n)
The even and odd components of the signal can be obtained as:
1
xe (n) =
2
[ x(n) + x(− n)] (1.6)
and
1
xo (n) =
2
[ x(n) − x(− n)]. (1.7)
Example 1.1 Consider the following discrete-time signal:
1, 0 ≤ n ≤ 4
x ( n) =
0, otherwise.
The even and odd components of this signal can be obtained, respec-
tively, from Equations 1.6 and 1.7, yielding:
1
2 , 1 ≤| n |≤ 4
xe (n) = 1, n = 0
0, otherwise
and
1
2, 1≤ n ≤ 4
xo (n) = 1
− , − 4 ≤ n ≤ −1
2
0, otherwise.
Signals x(n), xe(n) and xo(n) for this example are shown in Figure 1.3.
Discrete-Time Signals and Systems • 5
x(n)
1
0.5
−6 −4 −2 0 2 4 6n
(a)
xe(n)
1
0.5
−6 −4 −2 0 2 4 6n
(b)
xo(n)
0.5
−4 −2
−6 0 2 4 6n
−0.5
(c)
1.2.4.1 Time Shifting
v(n) g(n)
4 4
3 3
2 2
−3 −2 −1 0 1 2 3 n −1 0 1 2 3 4 5 n
(a) (b)
Figure 1.4. Time shifting: (a) original signal v(n), (b) delayed signal
g(n) = v(n–2).
1.2.4.2 Time Reversal
1
g (− n) = [2(− n) 2 + −7(− n) + 6]
5
1
g ( − n ) = ( 2 n 2 + 7 n + 6)
5
1.2.4.3 Time Scaling
g(n) g(−n)
3 3
2 2
−1 0 1 2 3 4 n −4 −3 −2 −1 0 1 n
(a) (b)
Figure 1.5. Time reversal: (a) original signal g(n), (b) reversed
signal g(–n).
Example 1.4. Consider the discrete-time sinusoidal signal x(n) = sin( p6 )n,
(more on sinusoidal signals in Section 1.4). Compressing this signal by a
factor α = 2, we obtain the signal g (n) given by:
2p n pn
g (n) = x(2n) = sin = sin .
6 3
p n pn
x(n / 2) = sin ⋅ = sin , n even
v ( n) = 6 2 12
0,
n odd
Figure 1.6 shows signals x(n), g(n), and v(n) for 0 ≤ n ≤ 12 . One full
cycle of x(n) fits in that interval, as shown in Figure 1.6(a). Due to time
compression, two cycles of g(n) fit in the same interval. However, it can be
seen in Figure 1.6(b) that some samples of x(n) are lost to produce g(n).
In this example expansion is accomplished by inserting zero between each
two original values of x(n). As a result, only half cycle of v(n) fits in the
8 • Digital Signal Processing
x(n)
1
7 8 9 10 11
0 1 2 3 4 5 6 n
−1
(a)
g(n)
1
4 5 10 11
0 1 2 3 6 7 8 9 12 n
−1
(b)
v(n)
1
0 1 2 3 4 5 6 7 8 9 10 11 12 n
−1
(c)
pn
Figure 1.6. Time scaling: (a) original signal x(n) = sin ,
6
(b) compressed signal g(n), (c) expanded signal v(n).
interval, as shown in Figure 1.6(c). Other techniques can be used to fill the
gaps between samples, such as replication of the previous value or linear
interpolation.
The discrete-time unit step signal is called u (n) and is defined as:
0, n < 0
u ( n) = (1.8)
1, n ≥ 0
as shown in Figure 1.7(a).
The discrete-time unit impulse signal called δ(n) is shown in
Figure 1.7(b) and is defined as:
1, n = 0,
d ( n) = (1.9)
0, n ≠ 0.
Discrete-Time Signals and Systems • 9
u(n) δ(n)
1 1
... ... ... ...
−4 −2 0 2 4 n −4 −2 0 2 4 n
(a) (b)
Figure 1.7. (a) Unit step signal u(n), (b) unit impulse signal δ(n).
n
u ( n) = ∑ d (k ). (1.10)
k =−∞
Signals δ(n) and u(n) play a very important role in the study of
digital signals and systems. These signals can be used to express other
discrete-time signals, as shown in the following examples.
1 n −2
, n≥2
x ( n) = 2
0, n<2
n −2
1
x ( n) = u ( n − 2) .
2
x(n)
1
...
n
0 1 2 3 4 5 6
x(n)
2
1.5
1
0.5
0 1 2 3 4 5 6 n
Example 1.6. Consider the finite duration signal shown in Figure 1.9 and
given by:
n
, 0≤n≤4
x ( n) = 2
0, otherwise.
Signal x(n) can be expressed using two unit steps, one of which shifted
to n = 5
n
x ( n) = u (n) − u ( n − 5) .
2
Alternatively, this signal can be expressed in terms of a sum of shifted
weighted impulses:
x ( n) = 0 d ( n) + 0.5d ( n − 1) + d ( n − 2) + 1.5d ( n − 3) + 2 d ( n − 4) .
x ( n) = z n = r n e jwn (1.11)
jw
Of particular interest is the case | r |= 1 that implies z = e 0. From
Euler’s formula, we have:
where
1 jw0 n
cos(w0 n) = e + e − jw0 n , (1.13)
2
and
1 jw0 n − jw0 n
sin(w0 n) = e −e . (1.14)
2j
Equations 1.13 and 1.14 define, respectively, the discrete-time cosine
and sine signals, jointly known as sinusoidal signals. A general expression
for this class of signals is given by:
x(n)
1
7 8 9 10 11
0 1 2 3 4 5 6 12 n
−1
p
Figure 1.10. One period of sinusoidal signal x(n) = sin n .
6
12 • Digital Signal Processing
N 2p (1.17)
=
m w0
or
w0 m (1.18)
= .
2p N
The fundamental frequency defined as:
2p
w0 = m rad (1.19)
N
is inversely proportional to the fundamental period. As N is dimensionless
w0 is expressed in radian, the dimension of 2π.
Equation 1.18 states that the discrete-time complex exponential
w
e jw0 n is periodic if and only if 2p0 is a rational number, that is, a number
that can be expressed as the ratio between two integers m N ( )
. Due to the
equivalence between the exponential and sinusoidal signals, expressed in
Equations 1.12, 1.13, and 1.14, the condition of Equation 1.18 also applies
to the latter class of signals. That periodicity condition is characteristic of
discrete-time signals, as continuous-time complex exponentials, as well as
cosines and sines are always periodic.
x(n)
1
−15 −5 5 15
−20 −10 0 10 20 n
−1
2
Figure 1.11. Non-periodic cosine x(n) = cos n for Example 1.7.
3
Discrete-Time Signals and Systems • 13
j 2Np kn
fk ( n) = e , k = 0, ±1, ±2,⋅⋅⋅. (1.20)
j ( k + N ) 2Np n jk 2Npn
fk + N (n) = e =e e j 2pn = fk (n). (1.21)
Equation 1.21 shows that the signals are periodic with respect to the
variable k with period N. This periodicity implies that there are only N
distinct harmonic signals in the set defined by Equation 1.20; these signals
j 2 pn j 4 pn − j 2 pn
are f0(n)=1, f1(n) = e N , f2 (n) = e N ,⋅⋅⋅, fN −1(n) = e N . Any value of
k outside the interval [0, N − 1] leads to one of the signals aforemen-
tioned, that is, fN (n) = f0 (n), fN +1 (n) = f1 (n), fN + 2 (n) = f2 (n) , and so on.
Thus, the set of harmonically related discrete-time exponentials is finite of
size N. This is distinct from the continuous-time case where all harmoni-
j 2 p kt
cally related exponentials of the form e T (k is an integer) are unique,
and therefore, the set of signals fk (t ) is infinite.
Harmonically related exponentials form the base for represent-
ing periodic discrete-time signals by Fourier series, as described in
Chapter 2.
1.5 Discrete-Time Systems
y ( n) = T x ( n) . (1.22)
x(n) y(n)
T[·]
Figure 1.12. Representation of a discrete-time system.
u(n) y(n)
5
4
3
2
... 1 ... ... 1 ...
n −2 −1 0 1 2 3 4 n
−2 −1 0 1 2 3 4
(a) (b)
Figure 1.13. Accumulator of Example 1.8: (a) input signal x(n) = u(n),
(b) output signal y(n).
Example 1.8. The accumulator is a system that adds up past and present
values of x(n) to produce y(n). Its characteristic transformation is
given by:
n
y ( n) = T x ( n) = ∑ x ( k ) . (1.23)
k =−∞
Figure 1.13 shows the output signal y(n) produced by the accumula-
tor of Equation 1.23 for an unit step signal applied at the input.
1.5.1.1 Linearity
Homogeneity : T [ ax(n) ] = aT x ( n)
Additivity : T x1 ( n) + x2 ( n) = T x1 ( n) + T x2 ( n) .
Discrete-Time Signals and Systems • 15
Thus, the superposition principle states that, if the input signal x(n) to
a linear system can be decomposed into a weighted sum (or linear com-
bination) of components x1(n) and x2(n), the output of the system is the
weighted sum of the outputs produced individually by each component.
The sum weights (or coefficients of the linear combination) at the output
are the same as in the input.
Equation 1.24 holds for any number of signals combined at the input:
∞ ∞ ∞
T ∑ bi xi ( n) = ∑ biT xi ( n) = ∑ bi yi ( n) (1.25)
i =−∞ i =−∞ i =−∞
where
yi ( n) = T xi ( n) (1.26)
Equations 1.28 and 1.29 are distinct, and therefore, the system is
non-linear. Observe that the non-linearity of this system is due to the term
5 added to 3x(n) in Equation 1.27. If this term was null, the system
would became y (n) = 3 x(n) , which is a linear system.
n
y1 ( n) = ∑ x1 ( k )
k =−∞
n
y2 ( n ) = ∑ x2 ( k ) (1.30)
k =−∞
where x1(n) and x2(n) are two input signals. Therefore, for constant coef-
ficients a and b:
n n
ay1 (n) + by2 (n) = a ∑ x1 ( k ) + b ∑ x2 ( k )
k =−∞ k =−∞
n
= ∑ ax1 ( k ) + bx2 ( k ) . (1.31)
k =−∞
For input signal x3 (n) = ax1 (n) + bx2 (n) , the output y3 (n) is given
by:
n n
y3 ( n) = ∑ x3 ( k ) = ∑ ax1 ( k ) + bx2 ( k ) . (1.32)
k =−∞ k =−∞
Equations 1.31 and 1.32 are equal, which means that the accumulator
is a linear system.
Discrete-Time Signals and Systems • 17
Assuming that x(n) and y (n) are the input and output signals, respec-
tively, for a shift invariant system:
n − n0
T x ( n − n0 ) = ∑ x ( k ) = y ( n − n0 ) .
k =−∞
y ( n) = n 2 x ( n) .
T [ x(n − n0 )] = n 2 x(n − n0 )
y (n − n0 ) = (n − n0 ) 2 x(n − n0 ).
18 • Digital Signal Processing
1.5.1.3 Causality
Causality implies that the output of the system at a given instant n only
depends on past and/or present values of the input signal. Thus, for a
causal system, there is a cause-and-effect relationship between the input
and output signals. There must be a present or past event at the input for
any event produced at the system output. Causal systems are also known
as non-anticipative as the output does not depend on future input values.
Any physical system is causal because future inputs cannot be processed
in the real world.
The accumulator is an example of a causal system, as its output is the
sum of all past inputs and present input value.
1.5.1.4 Stability
x ( n) ≤ B ⇒ y ( n) ≤ L ⋅ B (1.35)
1.5.1.5 Invertibility
A system is invertible when the input signal can be recovered from the
output signal. Thus, for any invertible system T[⋅] , there exists an inverse
system G[⋅] such that G[⋅] = T −1[⋅] . Invertibility implies that distinct
inputs produce distinct outputs; otherwise, input recovery would not
be possible.
G x ( n) = x ( n) − x ( n − 1) .
Discrete-Time Signals and Systems • 19
h(n) = T [ d (n)].
It can be shown that the output y(n) of an LSI system to any input
signal x(n) is the result of the discrete-time convolution between x(n) and
the impulse response h(n). This operation is defined as:
∞
y ( n) = x ( n) ∗ h( n) = ∑ x(k )h(n − k ). (1.36)
k =−∞
x(n) y(n)
h(n)
Figure 1.14. LSI system represented by its impulse
response h(n).
20 • Digital Signal Processing
∞
g ( n) ∗ v ( n) = ∑ g (k )v(n − k ).
k =−∞
g ( n) ∗ v ( n) = v ( n) ∗ g ( n) = ∑ v(k ) g (n − k )
k =−∞
associative:
g ( n) ∗ [v ( n) ∗ z ( n) ] = [ g ( n) ∗ v ( n) ] ∗ z ( n)
and distributive:
g ( n) ∗ [v ( n) + z ( n) ] = [ g ( n) ∗ v ( n) ] + [ g ( n) ∗ z ( n) ] .
x(n) y(n)
h1(n) h2(n)
(a)
x(n) y(n)
h2(n) h1(n)
(b)
x(n) y(n)
h(n) = h1(n) ∗ h2(n)
(c)
h1(n)
x(n) y(n)
+
x(n) y(n)
h2(n) h(n) = h1(n) + h2(n)
(a) (b)
Example 1.14. The LSI system with impulse response h1 (n) = (1 / 2) n u (n)
is stable, while the LSI system with impulse response h2 (n) = u (n) is
unstable. To verify for h1 (n) , we can calculate:
∞ ∞
∑ h1 (n) = ∑ (1 / 2)n = 2 < ∞.
n =−∞ n=0
∞ ∞
∑ h2 (n) = ∑ 1 = ∞. (1.38)
n =−∞ n=0
This property derives from the fact that causal systems are non-
anticipative. As the impulse signal is null for n < 0, no event occurs at the
input of the LSI system before n = 0 to cause an output event. Thus, h(n)
must be 0 for n < 0.
1.7 Chapter Overview
F H
fast Fourier transform (FFT), 73 half-power frequency, 96
FIR filters, 80 harmonically related complex
alternation theorem, 115 exponentials, 25
Bartlett window, 110 harmonic interference, 127
Blackman window, 110 Hilbert transformer, 122
Chebyshev approximation, 115
equiripple design, 114 I
frequency sampling, 115 IIR filters, 80
Gibbs phenomenon, 107 bilinear transformation, 88, 92
Hamming window, 110 Butterworth filter, 96
Hanning window, 110 Chebyshev filter, 97
Kaiser window, 113 Elliptic filter, 98
linear-phase, 103 impulse response, 19
Parks and McClellan, 115 interpolation, 62
rectangular window, 105
Remez exchange algorithm, L
115 linear shift-invariant systems, 19
windowing, 104 discrete time convolution, 19
Fourier’ properties, 27 impulse response, 19
periodicity, 29 properties, 20
shifting, 29 low pass filter, 34
symmetry, 30
Fourier series, 23, 25 N
analysis equation, 25 non-anticipative, 18
synthesis equation, 25 non-recursive filters, 81
Fourier transform, 26 non-uniform quantization, 60
inverse Fourier transform, 26 Nyquist theorem, 57
Index • 143
O superposition property/
odd signal, 3 superposition principle, 15
order of the filter, 81 system function, 24
overlap-add method, 72
T
P transducers, 1
Parseval, 32 transfer function, 51
partial fractions, 36 transforms, 23
periodic convolution, 108 Fourier transform, 23, 25
pole-zero plot, 39 z transform, 23
polynomial multiplication, 131
power signal, 3 U
prewarp, 92 unit impulse signal, 8
unit step signal, 8
Q unniform quantization, 60
quantization, 60
R W
recovered signal, 55 waterfall graph, 132
recursive filters, 81 windowing, 73
region of convergence (ROC),
38
Z
S z transform, 37
sampled signal, 55 analysis of LSI systems, 51
sampling interval/sampling period, causal and stable LSI system, 51
1 causal signals, 41
sampling rate/sampling frequency, convergence, 38
1 finite duration signals, 41
short-time Fourier transform left-sided signals, 42
(STFT), 132 pole-zero cancelation, 50
signal envelope detection, 122 pole-zero plot, 39
signals, 55 properties, 48
A/D conversion, 59 region of convergence, 38
sampling and reconstruction, 55 right-sided signals, 42
sinusoidal signals, 10, 11, 25 ROC, 39
software-defined radio (SDR), two-sided signals, 43
130 unit circle, 37
spectrum peak detection, 121 z plane, 37