Chủ Nhật, 9 tháng 2, 2014

Tài liệu Real Time Digital Signal Processing pptx

Contents
Preface xv
1 Introduction to Real-Time Digital Signal Processing 1
1.1 Basic Elements of Real-Time DSP Systems 2
1.2 Input and Output Channels 3
1.2.1 Input Signal Conditioning 3
1.2.2 A/D Conversion 4
1.2.3 Sampling 5
1.2.4 Quantizing and Encoding 7
1.2.5 D/A Conversion 9
1.2.6 Input/Output Devices 9
1.3 DSP Hardware 11
1.3.1 DSP Hardware Options 11
1.3.2 Fixed- and Floating-Point Devices 13
1.3.3 Real-Time Constraints 14
1.4 DSP System Design 14
1.4.1 Algorithm Development 14
1.4.2 Selection of DSP Chips 16
1.4.3 Software Development 17
1.4.4 High-Level Software Development Tools 18
1.5 Experiments Using Code Composer Studio 19
1.5.1 Experiment 1A ± Using the CCS and the TMS320C55x Simulator 20
1.5.2 Experiment 1B ± Debugging Program on the CCS 25
1.5.3 Experiment 1C ± File Input and Output 28
1.5.4 Experiment 1D ± Code Efficiency Analysis 29
1.5.5 Experiment 1E ± General Extension Language 32
References 33
Exercises 33
2 Introduction to TMS320C55x Digital Signal Processor 35
2.1 Introduction 35
2.2 TMS320C55x Architecture 36
2.2.1 TMS320C55x Architecture Overview 36
2.2.2 TMS320C55x Buses 39
2.2.3 TMS320C55x Memory Map 40
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)
2.3 Software Development Tools 40
2.3.1 C Compiler 42
2.3.2 Assembler 44
2.3.3 Linker 46
2.3.4 Code Composer Studio 48
2.3.5 Assembly Statement Syntax 49
2.4 TMS320C55x Addressing Modes 50
2.4.1 Direct Addressing Mode 52
2.4.2 Indirect Addressing Mode 53
2.4.3 Absolute Addressing Mode 56
2.4.4 Memory-Mapped Register Addressing Mode 56
2.4.5 Register Bits Addressing Mode 57
2.4.6 Circular Addressing Mode 58
2.5 Pipeline and Parallelism 59
2.5.1 TMS320C55x Pipeline 59
2.5.2 Parallel Execution 60
2.6 TMS320C55x Instruction Set 63
2.6.1 Arithmetic Instructions 63
2.6.2 Logic and Bits Manipulation Instructions 64
2.6.3 Move Instruction 65
2.6.4 Program Flow Control Instructions 66
2.7 Mixed C and Assembly Language Programming 68
2.8 Experiments ± Assembly Programming Basics 70
2.8.1 Experiment 2A ± Interfacing C with Assembly Code 71
2.8.2 Experiment 2B ± Addressing Mode Experiments 72
References 75
Exercises 75
3 DSP Fundamentals and Implementation
Considerations 77
3.1 Digital Signals and Systems 77
3.1.1 Elementary Digital Signals 77
3.1.2 Block Diagram Representation of Digital Systems 79
3.1.3 Impulse Response of Digital Systems 83
3.2 Introduction to Digital Filters 83
3.2.1 FIR Filters and Power Estimators 84
3.2.2 Response of Linear Systems 87
3.2.3 IIR Filters 88
3.3 Introduction to Random Variables 90
3.3.1 Review of Probability and Random Variables 90
3.3.2 Operations on Random Variables 92
3.4 Fixed-Point Representation and Arithmetic 95
3.5 Quantization Errors 98
3.5.1 Input Quantization Noise 98
3.5.2 Coefficient Quantization Noise 101
3.5.3 Roundoff Noise 102
3.6 Overflow and Solutions 103
3.6.1 Saturation Arithmetic 103
3.6.2 Overflow Handling 104
3.6.3 Scaling of Signals 105
3.7 Implementation Procedure for Real-Time Applications 107
viii CONTENTS
3.8 Experiments of Fixed-Point Implementations 108
3.8.1 Experiment 3A ± Quantization of Sinusoidal Signals 109
3.8.2 Experiment 3B ± Quantization of Speech Signals 111
3.8.3 Experiment 3C ± Overflow and Saturation Arithmetic 112
3.8.4 Experiment 3D ± Quantization of Coefficients 115
3.8.5 Experiment 3E ± Synthesizing Sine Function 117
References 121
Exercises 122
4 Frequency Analysis 127
4.1 Fourier Series and Transform 127
4.1.1 Fourier Series 127
4.1.2 Fourier Transform 130
4.2 The z-Transforms 133
4.2.1 Definitions and Basic Properties 133
4.2.2 Inverse z-Transform 136
4.3 System Concepts 141
4.3.1 Transfer Functions 141
4.3.2 Digital Filters 143
4.3.3 Poles and Zeros 144
4.3.4 Frequency Responses 148
4.4 Discrete Fourier Transform 152
4.4.1 Discrete-Time Fourier Series and Transform 152
4.4.2 Aliasing and Folding 154
4.4.3 Discrete Fourier Transform 157
4.4.4 Fast Fourier Transform 159
4.5 Applications 160
4.5.1 Design of Simple Notch Filters 160
4.5.2 Analysis of Room Acoustics 162
4.6 Experiments Using the TMS320C55x 165
4.6.1 Experiment 4A ± Twiddle Factor Generation 167
4.6.2 Experiment 4B ± Complex Data Operation 169
4.6.3 Experiment 4C ± Implementation of DFT 171
4.6.4 Experiment 4D ± Experiment Using Assembly Routines 173
References 176
Exercises 176
5 Design and Implementation of FIR Filters 181
5.1 Introduction to Digital Filters 181
5.1.1 Filter Characteristics 182
5.1.2 Filter Types 183
5.1.3 Filter Specifications 185
5.2 FIR Filtering 189
5.2.1 Linear Convolution 189
5.2.2 Some Simple FIR Filters 192
5.2.3 Linear Phase FIR Filters 194
5.2.4 Realization of FIR Filters 198
5.3 Design of FIR Filters 201
5.3.1 Filter Design Procedure 201
5.3.2 Fourier Series Method 202
5.3.3 Gibbs Phenomenon 205
CONTENTS ix
5.3.4 Window Functions 208
5.3.5 Frequency Sampling Method 214
5.4 Design of FIR Filters Using MATLAB 219
5.5 Implementation Considerations 221
5.5.1 Software Implementations 221
5.5.2 Quantization Effects in FIR Filters 223
5.6 Experiments Using the TMS320C55x 225
5.6.1 Experiment 5A ± Implementation of Block FIR Filter 227
5.6.2 Experiment 5B ± Implementation of Symmetric FIR Filter 230
5.6.3 Experiment 5C ± Implementation of FIR Filter Using Dual-MAC 233
References 235
Exercises 236
6 Design and Implementation of IIR Filters 241
6.1 Laplace Transform 241
6.1.1 Introduction to the Laplace Transform 241
6.1.2 Relationships between the Laplace and z-Transforms 245
6.1.3 Mapping Properties 246
6.2 Analog Filters 247
6.2.1 Introduction to Analog Filters 248
6.2.2 Characteristics of Analog Filters 249
6.2.3 Frequency Transforms 253
6.3 Design of IIR Filters 255
6.3.1 Review of IIR Filters 255
6.3.2 Impulse-Invariant Method 256
6.3.3 Bilinear Transform 259
6.3.4 Filter Design Using Bilinear Transform 261
6.4 Realization of IIR Filters 263
6.4.1 Direct Forms 263
6.4.2 Cascade Form 266
6.4.3 Parallel Form 268
6.4.4 Realization Using MATLAB 269
6.5 Design of IIR Filters Using MATLAB 271
6.6 Implementation Considerations 273
6.6.1 Stability 274
6.6.2 Finite-Precision Effects and Solutions 275
6.6.3 Software Implementations 279
6.6.4 Practical Applications 280
6.7 Software Developments and Experiments Using the TMS320C55x 284
6.7.1 Design of IIR Filter 285
6.7.2 Experiment 6A ± Floating-Point C Implementation 286
6.7.3 Experiment 6B ± Fixed-Point C Implementation Using Intrinsics 289
6.7.4 Experiment 6C ± Fixed-Point C Programming Considerations 292
6.7.5 Experiment 6D ± Assembly Language Implementations 295
References 297
Exercises 297
7 Fast Fourier Transform and Its Applications 303
7.1 Discrete Fourier Transform 303
7.1.1 Definitions 304
7.1.2 Important Properties of DFT 308
7.1.3 Circular Convolution 311
x CONTENTS
7.2 Fast Fourier Transforms 314
7.2.1 Decimation-in-Time 315
7.2.2 Decimation-in-Frequency 319
7.2.3 Inverse Fast Fourier Transform 320
7.2.4 MATLAB Implementations 321
7.3 Applications 322
7.3.1 Spectrum Estimation and Analysis 322
7.3.2 Spectral Leakage and Resolution 324
7.3.3 Power Density Spectrum 328
7.3.4 Fast Convolution 330
7.3.5 Spectrogram 332
7.4 Implementation Considerations 333
7.4.1 Computational Issues 334
7.4.2 Finite-Precision Effects 334
7.5 Experiments Using the TMS320C55x 336
7.5.1 Experiment 7A ± Radix-2 Complex FFT 336
7.5.2 Experiment 7B ± Radix-2 Complex FFT Using Assembly Language 341
7.5.3 Experiment 7C ± FFT and IFFT 344
7.5.4 Experiment 7D ± Fast Convolution 344
References 346
Exercises 347
8 Adaptive Filtering 351
8.1 Introduction to Random Processes 351
8.1.1 Correlation Functions 352
8.1.2 Frequency-Domain Representations 356
8.2 Adaptive Filters 359
8.2.1 Introduction to Adaptive Filtering 359
8.2.2 Performance Function 361
8.2.3 Method of Steepest Descent 365
8.2.4 The LMS Algorithm 366
8.3 Performance Analysis 367
8.3.1 Stability Constraint 367
8.3.2 Convergence Speed 368
8.3.3 Excess Mean-Square Error 369
8.4 Modified LMS Algorithms 370
8.4.1 Normalized LMS Algorithm 370
8.4.2 Leaky LMS Algorithm 371
8.5 Applications 372
8.5.1 Adaptive System Identification 372
8.5.2 Adaptive Linear Prediction 373
8.5.3 Adaptive Noise Cancellation 375
8.5.4 Adaptive Notch Filters 377
8.5.5 Adaptive Channel Equalization 379
8.6 Implementation Considerations 381
8.6.1 Computational Issues 381
8.6.2 Finite-Precision Effects 382
8.7 Experiments Using the TMS320C55x 385
8.7.1 Experiment 8A ± Adaptive System Identification 385
8.7.2 Experiment 8B ± Adaptive Predictor Using the Leaky LMS Algorithm 390
References 396
Exercises 396
CONTENTS xi
9 Practical DSP Applications in Communications 399
9.1 Sinewave Generators and Applications 399
9.1.1 Lookup-Table Method 400
9.1.2 Linear Chirp Signal 402
9.1.3 DTMF Tone Generator 403
9.2 Noise Generators and Applications 404
9.2.1 Linear Congruential Sequence Generator 404
9.2.2 Pseudo-Random Binary Sequence Generator 406
9.2.3 Comfort Noise in Communication Systems 408
9.2.4 Off-Line System Modeling 409
9.3 DTMF Tone Detection 410
9.3.1 Specifications 410
9.3.2 Goertzel Algorithm 411
9.3.3 Implementation Considerations 414
9.4 Adaptive Echo Cancellation 417
9.4.1 Line Echoes 417
9.4.2 Adaptive Echo Canceler 418
9.4.3 Practical Considerations 422
9.4.4 Double-Talk Effects and Solutions 423
9.4.5 Residual Echo Suppressor 425
9.5 Acoustic Echo Cancellation 426
9.5.1 Introduction 426
9.5.2 Acoustic Echo Canceler 427
9.5.3 Implementation Considerations 428
9.6 Speech Enhancement Techniques 429
9.6.1 Noise Reduction Techniques 429
9.6.2 Spectral Subtraction Techniques 431
9.6.3 Implementation Considerations 433
9.7 Projects Using the TMS320C55x 435
9.7.1 Project Suggestions 435
9.7.2 A Project Example ± Wireless Application 437
References 442
Appendix A Some Useful Formulas 445
A.1 Trigonometric Identities 445
A.2 Geometric Series 446
A.3 Complex Variables 447
A.4 Impulse Functions 449
A.5 Vector Concepts 449
A.6 Units of Power 450
Reference 451
Appendix B Introduction of MATLAB for DSP
Applications 453
B.1 Elementary Operations 453
B.1.1 Initializing Variables and Vectors 453
B.1.2 Graphics 455
B.1.3 Basic Operators 457
B.1.4 Files 459
B.2 Generation and Processing of Digital Signals 460
B.3 DSP Applications 463
B.4 User-Written Functions 465
xii CONTENTS
B.5 Summary of Useful MATLAB Functions 466
References 467
Appendix C Introduction of C Programming for DSP
Applications 469
C.1 A Simple C Program 470
C.1.1 Variables and Assignment Operators 472
C.1.2 Numeric Data Types and Conversion 473
C.1.3 Arrays 474
C.2 Arithmetic and Bitwise Operators 475
C.2.1 Arithmetic Operators 475
C.2.2 Bitwise Operators 476
C.3 An FIR Filter Program 476
C.3.1 Command-Line Arguments 477
C.3.2 Pointers 477
C.3.3 C Functions 478
C.3.4 Files and I/O Operations 480
C.4 Control Structures and Loops 481
C.4.1 Control Structures 481
C.4.2 Logical Operators 483
C.4.3 Loops 484
C.5 Data Types Used by the TMS320C55x 485
References 486
Appendix D About the Software 487
Index 489
CONTENTS xiii
Preface
Real-time digital signal processing (DSP) using general-purpose DSP processors is very
challenging work in today's engineering fields. It promises an effective way to design,
experiment, and implement a variety of signal processing algorithms for real-world
applications. With DSP penetrating into various applications, the demand for high-
performance digital signal processors has expanded rapidly in recent years. Many
industrial companies are currently engaged in real-time DSP research and development.
It becomes increasingly important for today's students and practicing engineers to
master not only the theory of DSP, but equally important, the skill of real-time DSP
system design and implementation techniques.
This book offers readers a hands-on approach to understanding real-time DSP
principles, system design and implementation considerations, real-world applications,
as well as many DSP experiments using MATLAB, C/C++, and the TMS320C55x. This
is a practical book about DSP and using digital signal processors for DSP applications.
This book is intended as a text for senior/graduate level college students with emphasis
on real-time DSP implementations and applications. This book can also serve as a
desktop reference for practicing engineer and embedded system programmer to learn
DSP concepts and to develop real-time DSP applications at work. We use a practical
approach that avoids a lot of theoretical derivations. Many useful DSP textbooks with
solid mathematical proofs are listed at the end of each chapter. To efficiently develop a
DSP system, the reader must understand DSP algorithms as well as basic DSP chip
architecture and programming. It is helpful to have several manuals and application
notes on the TMS320C55x from Texas Instruments at http://www.ti.com.
The DSP processor we will use as an example in this book is the TMS320C55x, the
newest 16-bit fixed-point DSP processor from Texas Instruments. To effectively illustrate
real-time DSP concepts and applications, MATLAB will be introduced for analysis and
filter design, C will be used for implementing DSP algorithms, and Code Composer
Studio (CCS) of the TMS320C55x are integrated into lab experiments, projects, and
applications. To efficiently utilize the advanced DSP architecture for fast software
development and maintenance, the mixing of C and assembly programs are emphasized.
Chapter 1 reviews the fundamentals of real-time DSP functional blocks, DSP hard-
ware options, fixed- and floating-point DSP devices, real-time constraints, algorithm
development, selection of DSP chips, and software development. In Chapter 2, we
introduce the architecture and assembly programming of the TMS320C55x. Chapter
3 presents some fundamental DSP concepts in time domain and practical considerations
for the implementation of digital filters and algorithms on DSP hardware. Readers who
are familiar with these DSP fundamentals should be able to skip through some of these
sections. However, most notations used throughout the book will be defined in this
chapter. In Chapter 4, the Fourier series, the Fourier transform, the z-transform, and
the discrete Fourier transforms are introduced. Frequency analysis is extremely helpful
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)
in understanding the characteristics of both signals and systems. Chapter 5 is focused on
the design, implementation, and application of FIR filters; digital IIR filters are covered
in Chapter 6, and adaptive filters are presented in Chapter 8. The development,
implementation, and application of FFT algorithms are introduced in Chapter 7. In
Chapter 9, we introduce some selected DSP applications in communications that have
played an important role in the realization of the systems.
As with any book attempting to capture the state of the art at a given time, there will
necessarily be omissions that are necessitated by the rapidly evolving developments in
this dynamic field of exciting practical interest. We hope, at least, that this book will
serve as a guide for what has already come and as an inspiration for what will follow. To
aid teaching of the course a Solution Manual that presents detailed solutions to most of
the problems in the book is available from the publisher.
Availability of Software
The MATLAB, C, and assembly programs that implement many DSP examples and
applications are listed in the book. These programs along with many other programs
for DSP implementations and lab experiments are available in the software package
at http://www.ceet.niu.edu/faculty/kuo/books/rtdsp.html and http://pages.prodigy.net/
sunheel/web/dspweb.htm. Several real-world data files for some applications introduced
in the book also are included in the software package. The list of files in the software
package is given in Appendix D. It is not critical you have this software as you read the
book, but it will help you to gain insight into the implementation of DSP algorithms, and it
will be required for doing experiments at the last section of each chapter. Some of these
experiments involve minor modification of the example code. By examining, studying and
modifying the example code, the softwarecanalsobe used as a prototypeforother practical
applications. Every attempt has been madeto ensure the correctness ofthe code. We would
appreciate readers bringing to our attention (kuo@ceet.niu.edu) any coding errors so that
we can correct and update the codes available in the software package on the web.
Acknowledgments
We are grateful to Maria Ho and Christina Peterson at Texas Instruments, and Naomi
Fernandes at Math Works, who provided the necessary support to write the book in a
short period. The first authorthanks many of his studentswho have taken his DSPcourses,
Senior Design Projects, and Master Thesis courses. He is indebted to Gene Frentz, Dr.
Qun S. Lin, and Dr. Panos Papamichalis of Texas Instruments, John Kronenburger of
Tellabs, and Santo LaMantia of Shure Brothers, for their support of DSP activities at
Northern Illinois University. He also thanks Jennifer Y. Kuo for the proofreading of the
book. The second author wishes to thank Robert DeNardo, David Baughman, and Chuck
Brokish of Texas Instruments, for their valuable inputs, help, and encouragement during
the course of writing this book. We would like to thank Peter Mitchell, editor at Wiley, for
his support of this project. We also like to thank the staff at Wiley for the final preparation
of the book. Finally, we thank our parents and families for their endless love, encourage-
ment, and the understanding they have shown during the whole time.
Sen M. Kuo and Bob H. Lee
xvi PREFACE
1
Introduction to Real-Time
Digital Signal Processing
Signals can be divided into three categories ± continuous-time (analog) signals,
discrete-time signals, and digital signals. The signals that we encounter daily are mostly
analog signals. These signals are defined continuously in time, have an infinite range
of amplitude values, and can be processed using electrical devices containing both
active and passive circuit elements. Discrete-time signals are defined only at a particular
set of time instances. Therefore they can be represented as a sequence of numbers that
have a continuous range of values. On the other hand, digital signals have discrete
values in both time and amplitude. In this book, we design and implement digital
systems for processing digital signals using digital hardware. However, the analysis
of such signals and systems usually uses discrete-time signals and systems for math-
ematical convenience. Therefore we use the term `discrete-time' and `digital' inter-
changeably.
Digital signal processing (DSP) is concerned with the digital representation of signals
and the use of digital hardware to analyze, modify, or extract information from these
signals. The rapid advancement in digital technology in recent years has created the
implementation of sophisticated DSP algorithms that make real-time tasks feasible. A
great deal of research has been conducted to develop DSP algorithms and applications.
DSP is now used not only in areas where analog methods were used previously, but also
in areas where applying analog techniques is difficult or impossible.
There are many advantages in using digital techniques for signal processing rather
than traditional analog devices (such as amplifiers, modulators, and filters). Some of the
advantages of a DSP system over analog circuitry are summarized as follows:
1. Flexibility. Functions of a DSP system can be easily modified and upgraded with
software that has implemented the specific algorithm for using the same hardware.
One can design a DSP system that can be programmed to perform a wide variety of
tasks by executing different software modules. For example, a digital camera may
be easily updated (reprogrammed) from using JPEG ( joint photographic experts
group) image processing to a higher quality JPEG2000 image without actually
changing the hardware. In an analog system, however, the whole circuit design
would need to be changed.
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)

Không có nhận xét nào:

Đăng nhận xét