Sei sulla pagina 1di 48

Digital Signal ProceSSing

Digital Signal ProceSSing

João MarqueS De carvalho, eDMar canDeia gurJão, luciana ribeiro veloSo, anD carloS Danilo MiranDa regiS

De carvalho, eDMar canDeia gurJão, luciana ribeiro veloSo, anD carloS Danilo MiranDa regiS MOMENTUM PRESS, LLC,

MOMENTUM PRESS, LLC, NEW YORK

Digital Signal Processing

Copyright © Momentum Press ® , LLC, 2019.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means— electronic, mechanical, photocopy, recording, or any other—except for brief quotations, not to exceed 400 words, without the prior permission of the publisher.

First published by Momentum Press ® , LLC 222 East 46th Street, New York, NY 10017 www.momentumpress.net

ISBN-13: 978-1-94708-390-5 (print) ISBN-13: 978-1-94708-391-2 (e-book)

Momentum Press Communications and Signal Processing Collection

Collection ISSN: 2377-4223 (print) Collection ISSN: 2377-4231 (electronic)

Cover and interior design by Exeter Premedia Services Private Ltd., Chennai, India

10 9 8 7 6 5 4 3 2 1

Printed in the United States of America

AbstrAct

In this book, we present the fundamentals of digital signal processing (DSP) in a format which is both concise and accessible to anyone with an engineering or sciences background. Without sacrificing the fundamental theory and concepts, we provide the reader with knowledge that capaci- tates him or her for further reading or for using available DSP tools. The initial chapters provide the background for proper understanding of DSP techniques. We start by presenting discrete-time (digital) signals and systems, with emphasis on the class of linear shift invariant (LSI) systems, as those are used to model most systems of practical interest. In the sequence, we introduce the Fourier and the z transforms, which are essential signals and systems analysis tools, followed by signal sampling and analog-to-digital (A/D) conversion. The discrete Fourier transform (DFT) and its computationally effi- cient form, the fast Fourier transform (FFT), are examined next. FFT algorithms have been widely used in different DSP applications, either in software or in hardware implementation, for real-time signal processing in the frequency domain at very high sampling rates. The largest chapter of this book is dedicated to digital filters, which are an essential component of most DSP systems. We analyze and com- pare the two main filter classes: infinite impulse response (IIR) and finite impulse response (FIR) and the structures used for their implementation. We also describe how to specify a digital filter and the main design tech- niques for both IIR and FIR filters. Examples are presented throughout the chapter. In the final chapter, we present examples of DSP techniques appli- cations to practical problems from several areas, including time and frequency analysis of signals, biomedical signal processing, audio pro- cessing, and digital communications.

vi

   AbstrAct

KeyWords

A/D conversion; digital signal processing; digital filters; fast fourier transform; fourier transform; signals sampling

contents

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

viii

   contents

4.3 Circular Convolution

68

4.4 Overlap-Add Method

70

4.5 Windowing

73

4.6 The Fast Fourier Transform

73

4.7 Chapter Overview

78

5 Digital Filters

79

5.1

Introduction

79

5.2

FIR and IIR Filters

80

5.3

Magnitude and Phase of Digital Filters

84

5.4

Comparing FIR and IIR Filters

88

5.5

Specifying a Digital Filter

89

5.6

IIR Filter Design with the Bilinear Transformation

91

5.7

Designing FIR Filters

103

5.8

Chapter Overview

119

6 Applications

121

6.1

Introduction

121

6.2

Spectrum Peak Detection

121

6.3

Signal Envelope Detection

122

6.4

Processing Electromyographic Signals

123

6.5

Generating Audio Effects

124

6.6

Removing Harmonic Interference

127

6.7

Digital Down Converter

129

6.8

Decimation in Software-Defined Radios

130

6.9

Polynomial Multiplication

131

6.10

Fourier Analysis of Signals with Time-Varying Spectral Components

132

6.11

Chapter Overview

133

Recommended Readings

137

About the Author

139

Index

141

List of figures

Figure 1.1.

Figure 1.2.

Figure 1.3.

Figure 1.4.

Figure 1.5.

Figure 1.6.

(a) Continuos-time signal s(t), (b) discrete-time signal

s

Discrete-time periodic signal (segment) with period N 0 . (a) Signal x ( n ), (b) x e (n), even component of x(n),

(c) x o (n), odd component of x(n).

Time shifting: (a) original signal v(n), (b) delayed signal g(n) = v(n–2).

Time reversal: (a) original signal g(n), (b) reversed signal g(–n).

Time scaling: (a) original signal x(n) =

(b) compressed signal g(n), (c) expanded signal v(n).

(a) Unit step signal u(n), (b) unit impulse signal δ(n). Signal x(n) for Example 1.5.

d (n) = s(nT ).

pn

6

,

si n

Figure 1.7.

Figure 1.8.

Figure 1.9.

Figure 1.10. One period of sinusoidal signal x(n) =

Figure 1.11. Non-periodic cosine x(n) = co s

Figure 1.12. Representation of a discrete-time system.

Figure 1.13. Accumulator of Example 1.8: (a) input signal x(n) = u(n), (b) output signal y(n).

Figure 1.14. LSI system represented by its impulse response h(n).

Figure 1.15. Equivalences among serial connections of LSI systems.

Figure 1.16. (a) Parallel connection of two LSI systems,

Signal x(n) for Example 1.6.

p

6 n

.

si n

2

3 n

for Example 1.7.

Figure 2.1.

(b) equivalent single system.

Example 2.2 for N 1 = 2 and N = 20: (a) periodic impulse train, (b) Fourier series coefficients.

2

3

5

6

7

8

9

9

10

11

12

14

14

19

21

21

26

x

   List of figures

Figure 2.3.

Figure 2.4.

Figure 2.5.

Figure 2.6.

Figure 2.7.

Figure 2.8.

Figure 3.1.

Figure 3.2.

Figure 3.3.

Figure 3.4.

Figure 3.5.

Figure 3.6.

Example 2.4: Magnitude response of the average filter. The z plane and the unit circle. ROC representation: R < |z| = r < R + . ROC and pole-zero plot for Example 2.6. ROC and pole-zero plot for Example 2.7.

ROCs for Example 2.8: (a) X 1 (z)|z|>1/3,

(b) X 2 (z):|z| < 1/2, (c) X(z):1/3<|z|<1/2.

Block diagram of analog to digital conversion.

(a) Continuous-time signal x(t) and (b) frequency spectrum of x(t).

(a) Analog signal x(t), (b) impulse train s(t), and

(c)

Frequency spectrum of the impulse train s(t).

Spectrum of the sampled signal x

Signal reconstruction in the frequency domain

(a) X s (jΩ), (b) H LP (jΩ), and (c) X r (jΩ).

(a) Sampled signal x s (t) and (b) recovered signal x r (t). Quantization levels for uniform quantization. Quantization levels for non-uniform quantization.

product x

s ( ) =

t

x t s t ) .

( )

(

s (

t ) with

s

> 2

x

.

Figure 3.7.

Figure 3.8.

Figure 3.9.

Figure 3.10. Block diagram for decimation.

Figure 3.11. Discrete-time interpolation: (a) original x(n),

(b) interpolated x i (n), using L =

T

T i

= 4.

Figure 3.12.

Block diagram for interpolation.

Figure 4.1.

Magnitude of the Fourier transform of signal x(n) in Example 4.1.

Figure 4.2.

N = 8 samples taken from X(e jw ) (dashed lines) of Example 4.1 producing X(k).

Figure 4.3.

Signal x(n) obtained with zero padding for N = 16.

Figure 4.4.

Magnitude of the DFT for Example 4.1 calculated with N = 16.

Figure 4.5.

Example 4.2: (a) Signal x(n) with L = 4, (b) signal h(n) with M = 4, and (c) result of circular convolution between x(n) and h(n).

Figure 4.6.

Linear convolution obtained with N + M + L – 1 in the circular convolution for Example 4.3.

35

37

38

40

41

45

55

56

56

57

57

58

59

60

61

63

63

64

66

67

67

68

69

69

List of figures      xi

Figure 4.7.

Application of the overlap-add method to a signal x(n) to calculate linear convolution between x(n) and h(n).

N = 16-point DFT of x ( n ) =

11

Figure 4.8.

p

2

n

p

20

.

n

.

co

co

s

s

Figure 4.9.

Figure 4.10. (a) Discrete hanning window, (b) DFT of the discrete hanning window.

Figure 4.11.

N = 16-point DFT of x ( n ) =

11

p

20

n

Magnitude of the N = 16-point DFT of x ( n ) = obtained with a hanning window.

Butterfly structure representation. Butterfly for N/2. Structure composed by butterflies for N = 8.

Frequency response of ideal filters: (a) lowpass and (b) highpass.

Effects of ideal filtering: (a) spectrum of a hypothetical signal, (b) lowpass filtered spectrum, and (c) highpass filtered spectrum.

Tapped delay line implementation of an FIR filter.

Canonic implementation of a recursive (IIR) filter of order N.

Flow graph for the FIR structure of Figure 5.3. Flow graph for the IIR structure of Figure 5.4. Flow graph for an IIR second-order section.

Illustration of filtering on the magnitude and phase of a signal.

Frequency response for an ideal lowpass filter.

co s

Figure 4.12.

Figure 4.13.

Figure 4.14.

Figure 5.1.

Figure 5.2.

Figure 5.3.

Figure 5.4.

Figure 5.5.

Figure 5.6.

Figure 5.7.

Figure 5.8.

Figure 5.9.

Figure 5.10. Example of frequency response for a real lowpass filter.

Figure 5.11. Example of lowpass filter specification.

Figure 5.12. Non-linear relation between w and W for bilinear transformation.

Figure 5.13. Mapping of H a (e jw ) into H(e jw ) with bilinear transformation.

Figure 5.14. Flow graph for an IIR Filter from Example 5.1.

Figure 5.15. Magnitude and phase responses of IIR Butterworth lowpass filter of Example 5.2.

71

72

72

74

74

76

76

77

80

80

82

82

83

83

83

85

87

87

90

93

94

95

97

xii

   List of figures

Figure 5.16. Magnitude and phase responses of IIR Chebyshev lowpass filter of Example 5.3.

99

Figure 5.17. Magnitude and phase responses of IIR Elliptic lowpass filter of Example 5.4.

100

Figure 5.18. Magnitude and phase responses of H(z) for Example 5.5.

103

Figure 5.19.

Rectangular window: w(n) and |W(e jw )|.

107

Figure 5.20.

Windowing in the time domain.

108

Figure 5.21.

Windowing in the frequency domain.

109

Figure 5.22. Commonly used windows for an FIR filter design.

111

Figure 5.23. Impulse and magnitude responses for Example 5.6 with Hanning window and N = 124.

112

Figure 5.24. Magnitude responses for Example 1.7 (a) rectangular with N = 36, (b) Bartlett with N = 122, (d) Hamming with N = 132, and (e) Blackman window with N = 220. 112

Figure 5.25. Impulse and magnitude responses for Example 5.7.

114

Figure 5.26. Frequency sampling design: (a) sampling H d (e jw ), (b) interpolating between samples to obtain H(e jw ).

116

Figure 5.27.

|H d (k)| for Example 5.8.

117

Figure 5.28. Impulse and magnitude responses for Example 5.8.

118

Figure 6.1.

Points to FFT interpolation to obtain the peak adjust factor d.

122

Figure 6.2.

AM-DSB Signal x(n) and its interpolated envelope signal e(n).

124

Figure 6.3.

Electromyographic signal representing three biceps contractions: (a) signal, (b) signal filtered with Butterworth filter, and (c) signal filtered with Hamming filter.

125

Figure 6.4.

Universal filter block diagram for delay generation.

126

Figure 6.5.

Block diagram for Schroeder reverb generation.

127

Figure 6.6.

Frequency response (magnitude) of a comb filter for D = 6.

128

Figure 6.7.

Magnitude of 256 points FFT for a 650 Hz signal plus 256 Hz and 512 Hz interference.

128

Figure 6.8.

256 points FFT magnitude of the signal filtered by a comb filter with D = 10 to remove interference.

129

List of figures      xiii

Figure 6.9.

Block diagram of a DDC.

130

Figure 6.10. STFT: (a) signal (b), (c), (d), and (e) windowed segments.

133

Figure 6.11. (a) 1,024 points FFT absolute value and (b) STFT of the signal in Figure 6.10 (a).

134

List of tAbLes

Table 2.1.

Basic Fourier transform pairs

28

Table 2.2.

Properties of the Fourier transform

33

Table 2.3. Some commonly found signals and their z transforms

44

Table 2.4.

Main z transform properties

49

Table 5.1. Transformations to map a prototype low-pass filter into other filter types

102

Table 5.2.

Impulse responses for linear-phase FIR filters

105

Table 5.3. Magnitude response |H d (e jw )| and impulse response h d (n) of standard frequency-selective filters with cutoff frequency w c and sample delay a.

106

Table 5.4. Commonly used windows for an FIR filter design

110

Table 5.5.

Windows features for an FIR filter design

110

Table 6.1. Configurations of a universal filter for the example of Figure 6.4.

127

PrefAce

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

frequency response mean-square error. Those details were originally justi- fied because the filter designer had often to implement those optimization algorithms. However, many software libraries and toolboxes are currently available with filter design and implementation modules, requiring only a set of specifications from the user. Thus, the designer can focus on deter- mining the best set of filter specifications for the problem at hand, instead of spending time to learn all involved methods. In addition, this book can also be used as a textbook for an advanced undergraduate or graduate course in DSP with emphasis on problem solving. This type of course usu- ally starts with the analysis of an application problem, from which theory is introduced only as required to progress toward a solution. We start the book in Chapter 1 looking at the fundamentals of dis- crete-time signals and systems. Signals properties are presented, and the unit step, unit impulse, and complex exponential signals are defined and analyzed. After describing the basic properties of discrete-time systems, we focus on linear shift invariant systems, as those are used to model most systems of practical interest. The discrete convolution operation is defined and its computation analyzed. Chapter 2 is dedicated to the discrete-time Fourier transform and the z transform. Those are the tools that allow analysis of discrete-time signals and systems in the frequency and z domains, respectively, providing the basis for most DSP techniques. Both transforms express signals as linear combinations of complex exponentials, as described in the chapter. The relationship between Fourier and z transforms, the concepts of conver- gence and region of convergence, frequency response, and examples of applying transforms to the analysis and implementation of discrete-time systems are also presented in Chapter 2. Signal sampling and analog to digital (A/D) conversion is the sub- ject of Chapter 3. We start by analyzing uniform time sampling of analog signals, establishing the fundamental limit of the Nyquist theorem and defining aliasing and the need for anti-aliasing filtering. Analog signal reconstruction from its samples is also described both in time and fre- quency domains. Next, quantization and encoding of sampled signals are examined in this chapter. Uniform and non-uniform quantization, binary representation of quantized samples, and intrinsic errors in analog to dig- ital conversion are analyzed and A/D converter parameters described. Finally, Chapter 3 analyzes sampling and reconstruction, or sampling rate reduction and increase, of discrete-time signals performed by the decima- tion and interpolation operations, respectively. In Chapter 4, we introduce the discrete Fourier transform (DFT). While the discrete-time Fourier transform presented in Chapter 2 is

PrefAce      xix

periodic and continuous in frequency, DFT provides a finite-length dis- crete frequency domain representation of a signal. We present the concept of circular convolution, show how DFT is applied to an infinite-length signal, and analyze effects of leakage and windowing on DFT. Despite its potential for DSP applications, DFT was initially of limited practical use due to its high computational complexity. The amount of complex multiplications required for a direct DFT calcula- tion of a size N signal is of order N  2 . Only with the advent of the family of algorithms known as fast Fourier transform (FFT), this complexity was reduced to order N log 2 N, making it feasible for implementation in DSP systems. The decimation in time formulation of the FFT is derived in Chapter 4, as well as the structure known as butterfly, which implements the basic computation for that FFT form. We show how butterflies can be combined to calculate larger-size FFTs. Filters are the main components of most DSP systems; thus, proper understanding of specification, design, and synthesis of digital filters is fundamental for a good understanding of those systems. This is the sub- ject of Chapter 5. We start by analyzing and comparing the two main filter classes: infinite impulse response (IIR) and finite impulse response (FIR) and the structures used for their implementation. Applying the bilinear transformation to design lowpass IIR filters from analog filter is exam- ined, followed by description of the z-domain transforms that allow to obtain other frequency selective filters from a lowpass prototype. Design examples are provided. Still in Chapter 5, we examine three linear phase FIR filters design techniques: windowing, optimal equiripple, and frequency sampling. We describe the main features of each method and provide design examples. Relative advantages and drawbacks are discussed, and a comparison among them is presented. We finally describe in Chapter 6 how DSP techniques can provide the solution to practical problems chosen from several application areas, which include time and frequency analysis of signals, biomedical signal processing, audio processing, and digital communications. Much has been written on the subjects presented in this book. Instead of inserting reference citations along the text, we opted for providing a set of Recommended Readings at the end. We believe that this approach makes for a more fluid reading, in tune with the objective of this book. By looking up at the indexes of the recommended texts, readers can further explore any of the topics here covered. Although it reflects our preference, the list of Recommended Readings is not exhaustive by any

xx

   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

A discrete-time signal is a sequence of values usually representing the behavior of a physical phenomenon. In electrical engineering problems, those values are samples of a continuous-time-varying electrical signal taken at uniform rate, called sampling rate or sampling frequency. The inverse of the sampling rate is called sampling interval or sampling period. Figure 1.1 shows the graphical representations of a continuous-time signal and its discrete-time uniformly sampled version. For the latter, time is normalized by the sampling period becoming the index n. This can be stated as:

s

d ( ) =

n

s n T )

(

(1.1)

where T is the sampling period. In practice, continuous-time or analog signals are electrical events (voltage or current) representing the behavior of some physical phenomenon such as speech or temperature as a function of time. Devices known as transducers are utilized to convert physical variations (of pressure or temperature, for example) into voltage or electrical current changes, thus creating an electrical signal. To be digitally processed, electrical signals have to be sampled, time discretized, quantized, and encoded, thus becoming a digital signal. Therefore, a digital signal is a discrete-time signal, as represented in Figure 1.1(b), for which the amplitude is quantized, that is, it is constrained to assume values in a finite set. Quantization is usually accomplished by rounding or truncating the amplitude sample to the nearest value in the discrete set. It is always present in digital signal processing, as samples

2

•   digitAL signAL Processing

s ( t )
s ( t )
t − 4 T − 3 T − 2 T − 1T 0 1T 2
t
− 4 T
− 3 T
− 2 T
− 1T
0
1T
2 T
3T
4T
(a)
s d ( n )
n
− 4
− 3
− 2
− 1
0
123
4
(b)

Figure 1.1. (a) Continuous-time signal s(t), (b) Discrete-time signal s d (n) = s(nT ).

must be stored in finite length registers. Chapter 3 analyzes the sampling and quantization processes. In this chapter, we present the main properties of discrete-time signals, demonstrate how those signals are affected by operations on the independent variable, and introduce some signals that are important in digital signal processing.

1.2  ProPerties of discrete-time signALs

Most properties of continuous-time (analog) signals are also common to discrete-time (digital) signals. In this section, we review some relevant properties to digital signal processing.

1.2.1

Periodicity

A discrete-time signal is periodic if there exists an integer N such that:

x ( n ) = x ( n + N )

(1.2)

for any value of n. The integer N is called the period of the signal.

discrete-time signALs And systems    •  3

 
  x ( n )  

x( n )

x ( n )
 
 
  2  
  2  

2

 
  2  
  2  
1  
1  
1  
1  
1  
1  

1

 
1  
1  
1  
1  
1  
1  
                   
                   
 

2 N 0

 

N 0

 

0

N 0

 

2 N 0

 

n

Figure 1.2. Discrete-time periodic signal (segment) with period N 0 .

Equation 1.2 holds for any integer multiple of N. Figure 1.2 shows a periodic signal where N 0 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:

x ( n ) = x ( n + kN ) n, k Z .

0

1.2.2 Power and energy

(1.3)

The energy of a discrete-time signal x(n) is defined as:

E

= |

n =−∞

x ( n )

|

2

.

(1.4)

The average power of a discrete-time signal is defined as:

P =

li m

N →∞

1

N

N

2

1

n =−

N

2

|

x n

(

)

|

2

.

(1.5)

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.

1.2.3 even and odd SignalS

An even signal is symmetric with respect to the vertical axis. Therefore, for an even signal, we have:

x ( n ) = x ( n ).

4

•   digitAL signAL Processing

If a signal is antisymmetric with respect to the vertical axis, that is, if:

x ( n ) = − x ( n )

it is called an odd signal. Any signal x(n) can be expressed as the sum of an even component x e (n) and an odd component x o (n) such that:

( ) =

x n

( ) +

x n

e

( ).

x n

o

The even and odd components of the signal can be obtained as:

and

x

e ( ) =

n

x

o ( ) =

n

1

2

[

x n

(

) + (

x

n

)

]

1

2

[

x n

(

) (

x n ) ].

(1.6)

(1.7)

Example 1.1 Consider the following discrete-time signal:

x ( n ) =



1 0

,

n

4

0 otherwis e

,

.

The even and odd components of this signal can be obtained, respec- tively, from Equations 1.6 and 1.7, yielding:

and

e ( ) =

x n

o ( ) =

x n

1

2

, 1 ≤|



n | ≤

4

1

0 , otherwis e

,

n =

0

1

, 2 1
,
2
1

1

4

n

4

≤ −

1

otherwis e

.

2

0 ,

, − ≤

n

discrete-time signALs And systems    •  5

x( n )
x( n )
 

1

   
  1    
  1    
  1    

0.5

     
 
 
 
 
 
 
 
 
 
 

6

 

4

2

   

0

 

246

n

 

(a)

 
  x e ( n )  
 

x

e ( n )

 
 
 

1

1
   
 
  0.5    
  0.5    
  0.5    
  0.5    

0.5

   
  0.5    
  0.5    
  0.5    
  0.5    
     
     
     
     
     
     

6

 

4

2

   

0

 

246

n

 

(b)

 
   
 

0.5

 
x o ( n )
x
o ( n )
x o ( n )
  0.5   x o ( n )
  0.5   x o ( n )
− 4 − 2        
− 4 − 2        

4

2

− 4 − 2        
       
− 4 − 2        
− 4 − 2        
− 4 − 2        

6

         

0

246

n

 
  − 0.5
  − 0.5
  − 0.5
  − 0.5

0.5

   

(c)

Figure 1.3. (a) Signal x(n), (b) x e (n), even component of x(n), (c) x o (n), odd component of x(n).

1.2.4 oPerationS on the indePendent variable

Discrete-time signals are functions of the discrete variable n. Therefore, all operations defined for functions, such as sum and multiplication, are also valid for signals. More specific to our interest is how signals are affected by operations performed on the independent variable, which we examine next.

1.2.4.1 time Shifting

Time shifting of a signal is accomplished by replacing the independent variable n by n n 0 . If n 0 is a positive integer, the signal is delayed; other- wise, (negative n 0 ) the signal is advanced. Delaying means that the signal is right-shifted, whereas advancing implies a left shift.

Example 1.2. Consider v ( n ) = means to delay it by 2:

2

5

n

2

+

1

5

n . Shifting

g ( n

g n

(

)

)

=

=

v ( n

n

0

)

=

v ( n

2

)

1

[

(

2

n

2

)

2

+

(

n

1

5

5

2

)]

=

(

2

v ( n )

n

2

7

by

n

+

n 0 = +2

6

)

6

•   digitAL signAL Processing

v (n ) g (n ) 4 4 3 3 2 2 1 1 n
v
(n )
g
(n )
4
4
3
3
2
2
1
1
n
n
− 3 − 2 −1
0
123
− 1
0 1
2
345
(a)
(b)

Figure 1.4. Time shifting: (a) original signal v(n), (b) delayed signal g(n) = v(n–2).

A segment of the delayed signal g ( n ) = v ( n 2 ) is illustrated Figure 1.4.

1.2.4.2 time reversal

Time reversing a signal consists in changing the sign of the independent variable n. Thus, the time-reversed version of a discrete-time signal x(n) is x(−n). This reversion has the effect of reflecting the signal about the vertical axis.

Example 1.3. Let us time-revert the signal g ( n ) = Example 1.2:

1 2 g ( − ( n ) = [ 2 − n ) +
1
2
g
(
− (
n
)
=
[
2
n
)
+ − 7 ( −
5
1
2
g
(
− (
n
)
=
2
n
+
7
n
+
6
)
5

n )

+

6

1

5

]

(

2

2

n

7

n + )

6

from

Both g(n) and g(−n) are illustrated in Figure 1.5.

1.2.4.3 time Scaling

Time scaling by an integer factor α is achieved by multiplying or dividing the independent variable n by α, with |α| > 1. Multiplication implies in time compression, whereas division implies in time expansion. Therefore,

discrete-time signALs And systems    •  7

g ( n ) g( − n ) 3 3 2 2 1 1 n
g
( n )
g( − n )
3
3
2
2
1
1
n
n
− 1
0
1
2
3
4
− 4 − 3 − 2 −1
0 1
(a
)
(b)

Figure 1.5. Time reversal: (a) original signal g(n), (b) reversed signal g(–n).

x(αn) and x(n/α) are, respectively, time-compressed and time-expanded versions of x(n). For discrete-time, compression corresponds to sampling the signal at rate α, meaning that, for each α samples, one is preserved and the others are discarded. Inversely, expansion in discrete-time means that α 1 samples are inserted between two original ones. The values of the inserted samples must be estimated by some interpolation technique.

p

Example 1.4. Consider the discrete-time sinusoidal signal x ( n ) = sin( ) n , (more on sinusoidal signals in Section 1.4). Compressing this signal by a factor α = 2, we obtain the signal g ( n ) given by:

6

g n

(

) =

(

x 2 n

) = si n

2 n

p

n

3

6

= s in

p

.

Expansion of x ( n ) by factor 2 corresponds to signal v ( n ):

(

)

v n =

 

x

(

)

n / 2 =

0

,

si n

p

n

n 12   ,

p

6

2

=

s in

n even

n odd

Figure 1.6 shows signals x(n), g(n), and v(n) for 0 n 1 2 . 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 1 0 11 n 0 123456 −1 (a)
x
(n )
1
7
8
9
1 0 11
n
0
123456
−1
(a)
g
(n )
1
4
5
10 11
n
0
1
2
3
6
7
8
9
12
−1
(b)
v
(n )
1
n
0
12345678
9
1 0
1 1
1 2
−1
(c)
pn
Figure 1.6. Time scaling: (a) original signal x(n)
= si n
,
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.

1.3  tHe unit steP And unit imPuLse signALs

The discrete-time unit step signal is called u ( n ) and is defined as:

u ( n ) =

0

1 ,

,

n

n

<

0

0

as shown in Figure 1.7(a).

The

discrete-time

unit

impulse

signal

Figure 1.7(b) and is defined as:

d ( n ) =

1

0

,

,

n

n

=

0

0

,

.

called

δ(n)

is

(1.8)

shown

in

(1.9)

discrete-time signALs And systems    •  9

 
  u ( n )   δ ( n )

u

( n )

 
  u ( n )   δ ( 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).

Signals δ(n) and u(n) are related by the following equation:

(

u n

) =

n

k =−∞

d ( )

k

.

(1.10)

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.

Example 1.5. Consider the following signal:

(

x n

) =


1

2

n 2

,

n

2

0

,

n

<

2

shown in Figure 1.8. An alternative expression for this signal can be obtained with a shifted unit step signal as:

n − 2 1  x n ( ) =  u n ( −
n − 2
1 
x n
(
) = 
u n
(
− 2
) .
 
2
x
( n
)
1
n
0 12345
6

Figure 1.8. Signal x(n) for Example 1.5.

10   •   digitAL signAL Processing

x ( n ) 2 1.5 1 0.5 n 0 123456
x
( n )
2
1.5
1
0.5
n
0
123456

Figure 1.9. Signal x(n) for Example 1.6.

Example 1.6. Consider the finite duration signal shown in Figure 1.9 and given by:

(

x n

) =

  n

,

2

 

0 ,

4

otherwis e

n

0

.

Signal x(n) can be expressed using two unit steps, one of which shifted to n = 5

x

(

n ) =

n

2

u ( n ) u (n )

5   .

Alternatively, this signal can be expressed in terms of a sum of shifted weighted impulses:

x (n ) = 0 d (n ) + 0 .5 d (n 1) + d (n 2 ) + 1. 5 d (n 3) + 2 d (n 4 ) .

1.4   comPLex exPonentiAL And sinusoidAL  signALs

A discrete-time complex exponential signal is defined as:

(

x n

) =

z

n

=

n

r e

j n

w

(1.11)

where z is a complex parameter given by z

imaginary component of z is null, and the complex exponential becomes

n . In this case, for | r | > 1 , we have

an increasing exponential, whereas for | r | < 1 , x (n ) is a decreasing exponential.

a real exponential signal x n r

j w . When w = 0, the

= r e

(

) =

discrete-time signALs And systems    •   11

Of particular interest is the case | r | = 1 that implies z e j w 0 . From

=

Euler’s formula, we have:

where

and

(

x n

) =

e

j

w

0

n

=

cos(

w

0

n

cos( w ) =

0

n

1

2

j

e

w

0

n

sin( w ) =

0

n

1

2 j

j

e

w

0

n

)

+

j

s in(

w

0

+

e

j

w

0

n

,

e

j

w

0

n

.

n )

(1.12)

(1.13)

(1.14)

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 ) = co s (w n + f ) ,

0

where

f

is the phase of the sinusoidal signal. For

p

2

f = 0 ,

implies that x ( n ) = sin( w n ) .

x ( n ) = cos( w n ) , whereas f =

0

0

Figure 1.10 shows one period ( N = 12 ) of x ( n ) = si n (

p

6

n ) .

(1.15)

we have

1.4.1 Periodicity of diScrete-time exPonentialS

Assuming the existence of a period N such that x ( n ) = x ( n + N ) (Section 1.2.1) for the complex exponential defined in Equation 1.12, we have:

(

x n N

+

) = j w ( n N + ) j w n j w N
) =
j
w
(
n N
+
)
j
w
n
j
w
N
e
0
=
e
0
e
0
= x(n)
x
( n )
1
7
8
9
1 0 11
n
0
123456
12
1
p
Figure 1.10. One period of sinusoidal signal x(n)
= si n
 
6 n


.

12   •   digitAL signAL Processing

which leads to:

e

j w n

0

e

j w N

0

=

e

j w n

0

.

(1.16)

Equation 1.16 implies that, if x(n) is periodic, then w 0 N must be

0 N = 2 m , where m

is an integer, that is, for values of w 0 N that are integer multiples of 2p. The fundamental period is, thus, given by:

such that e j w N = 1 . This condition is satisfied for w

0

p

or

N

= 2

p

m

w 0

(1.17)

w

0

m

=

2

p

N

.

(1.18)

The fundamental frequency defined as:

w