Você está na página 1de 16

Real-Time Digital Signal Processing

Second Edition

Real-Time Digital Signal Processing: Implementations and Applications, 2nd Edition S.M. Kuo, B.H. Lee, and W. Tian 2006 John Wiley & Sons, Ltd ISBN: 0-470-01495-4

Real-Time Digital Signal Processing


Implementations and Applications
Second Edition

Sen M Kuo
Northern Illinois University, USA

Bob H Lee
Ingenient Technologies Inc., USA

Wenshun Tian
UTStarcom Inc., USA

Copyright

2006

John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England Telephone (+44) 1243 779777

Email (for orders and customer service enquiries): cs-books@wiley.co.uk Visit our Home Page on www.wileyeurope.com 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, photocopying, recording, scanning or otherwise, except under the terms of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London W1T 4LP, UK, without the permission in writing of the Publisher. Requests to the Publisher should be addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England, or emailed to permreq@wiley.co.uk, or faxed to (+44) 1243 770620. Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The Publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the Publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional should be sought. Other Wiley Editorial Ofces John Wiley & Sons Inc., 111 River Street, Hoboken, NJ 07030, USA Jossey-Bass, 989 Market Street, San Francisco, CA 94103-1741, USA Wiley-VCH Verlag GmbH, Boschstr. 12, D-69469 Weinheim, Germany John Wiley & Sons Australia Ltd, 42 McDougall Street, Milton, Queensland 4064, Australia John Wiley & Sons (Asia) Pte Ltd, 2 Clementi Loop #02-01, Jin Xing Distripark, Singapore 129809 John Wiley & Sons Canada Ltd, 22 Worcester Road, Etobicoke, Ontario, Canada M9W 1L1 Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.

Library of Congress Cataloging-in-Publication Data Kuo, Sen M. (Sen-Maw) Real-time digital signal processing : implementations, applications and experiments with the TMS320C55X / Sen M Kuo, Bob H Lee, Wenshun Tian. 2nd ed. p. cm. Includes bibliographical references and index. ISBN 0-470-01495-4 (cloth) 1. Signal processingDigital techniques. 2. Texas Instruments TMS320 series microprocessors. I. Lee, Bob H. II. Tian, Wenshun. III. Title. TK5102 .9 .K86 2006 621.382 2-dc22 British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library ISBN-13 978-0-470-01495-0 ISBN-10 0-470-01495-4 Typeset in 9/11pt Times by TechBooks, New Delhi, India Printed and bound in Great Britain by Antony Rowe Ltd, Chippenham, Wiltshire This book is printed on acid-free paper responsibly manufactured from sustainable forestry in which at least two trees are planted for each one used for paper production. 2005036660

Contents
Preface 1 Introduction to Real-Time Digital Signal Processing
1.1 1.2 Basic Elements of Real-Time DSP Systems Analog Interface 1.2.1 Sampling 1.2.2 Quantization and Encoding 1.2.3 Smoothing Filters 1.2.4 Data Converters 1.3 DSP Hardware 1.3.1 DSP Hardware Options 1.3.2 DSP Processors 1.3.3 Fixed- and Floating-Point Processors 1.3.4 Real-Time Constraints 1.4 DSP System Design 1.4.1 Algorithm Development 1.4.2 Selection of DSP Processors 1.4.3 Software Development 1.4.4 High-Level Software Development Tools 1.5 Introduction to DSP Development Tools 1.5.1 C Compiler 1.5.2 Assembler 1.5.3 Linker 1.5.4 Other Development Tools 1.6 Experiments and Program Examples 1.6.1 Experiments of Using CCS and DSK 1.6.2 Debugging Program Using CCS and DSK 1.6.3 File I/O Using Probe Point 1.6.4 File I/O Using C File System Functions 1.6.5 Code Efciency Analysis Using Proler 1.6.6 Real-Time Experiments Using DSK 1.6.7 Sampling Theory 1.6.8 Quantization in ADCs References Exercises

xv 1
2 3 3 7 8 9 10 10 13 15 16 17 18 19 20 21 22 22 23 24 25 25 26 29 32 35 37 39 42 44 45 45

vi

CONTENTS

2 Introduction to TMS320C55x Digital Signal Processor


Introduction TMS320C55x Architecture 2.2.1 Architecture Overview 2.2.2 Buses 2.2.3 On-Chip Memories 2.2.4 Memory-Mapped Registers 2.2.5 Interrupts and Interrupt Vector 2.3 TMS320C55x Peripherals 2.3.1 External Memory Interface 2.3.2 Direct Memory Access 2.3.3 Enhanced Host-Port Interface 2.3.4 Multi-Channel Buffered Serial Ports 2.3.5 Clock Generator and Timers 2.3.6 General Purpose Input/Output Port 2.4 TMS320C55x Addressing Modes 2.4.1 Direct Addressing Modes 2.4.2 Indirect Addressing Modes 2.4.3 Absolute Addressing Modes 2.4.4 Memory-Mapped Register Addressing Mode 2.4.5 Register Bits Addressing Mode 2.4.6 Circular Addressing Mode 2.5 Pipeline and Parallelism 2.5.1 TMS320C55x Pipeline 2.5.2 Parallel Execution 2.6 TMS320C55x Instruction Set 2.6.1 Arithmetic Instructions 2.6.2 Logic and Bit Manipulation Instructions 2.6.3 Move Instruction 2.6.4 Program Flow Control Instructions 2.7 TMS320C55x Assembly Language Programming 2.7.1 Assembly Directives 2.7.2 Assembly Statement Syntax 2.8 C Language Programming for TMS320C55x 2.8.1 Data Types 2.8.2 Assembly Code Generation by C Compiler 2.8.3 Compiler Keywords and Pragma Directives 2.9 Mixed C-and-Assembly Language Programming 2.10 Experiments and Program Examples 2.10.1 Interfacing C with Assembly Code 2.10.2 Addressing Modes Using Assembly Programming 2.10.3 Phase-Locked Loop and Timers 2.10.4 EMIF Conguration for Using SDRAM 2.10.5 Programming Flash Memory Devices 2.10.6 Using McBSP 2.10.7 AIC23 Congurations 2.10.8 Direct Memory Access References Exercises 2.1 2.2

49
49 50 50 53 53 55 55 58 60 60 61 62 65 65 65 66 68 70 70 71 72 73 73 74 76 76 77 78 78 82 82 84 86 86 87 89 90 93 93 94 97 103 105 106 109 111 115 115

CONTENTS

vii

3 DSP Fundamentals and Implementation Considerations


Digital Signals and Systems 3.1.1 Elementary Digital Signals 3.1.2 Block Diagram Representation of Digital Systems 3.2 System Concepts 3.2.1 Linear Time-Invariant Systems 3.2.2 The z-Transform 3.2.3 Transfer Functions 3.2.4 Poles and Zeros 3.2.5 Frequency Responses 3.2.6 Discrete Fourier Transform 3.3 Introduction to Random Variables 3.3.1 Review of Random Variables 3.3.2 Operations of Random Variables 3.4 Fixed-Point Representations and Quantization Effects 3.4.1 Fixed-Point Formats 3.4.2 Quantization Errors 3.4.3 Signal Quantization 3.4.4 Coefcient Quantization 3.4.5 Roundoff Noise 3.4.6 Fixed-Point Toolbox 3.5 Overow and Solutions 3.5.1 Saturation Arithmetic 3.5.2 Overow Handling 3.5.3 Scaling of Signals 3.5.4 Guard Bits 3.6 Experiments and Program Examples 3.6.1 Quantization of Sinusoidal Signals 3.6.2 Quantization of Audio Signals 3.6.3 Quantization of Coefcients 3.6.4 Overow and Saturation Arithmetic 3.6.5 Function Approximations 3.6.6 Real-Time Digital Signal Generation Using DSK References Exercises 3.1

121
121 121 123 126 126 130 132 135 138 141 142 142 144 147 147 151 151 153 153 154 157 157 158 158 159 159 160 161 162 164 167 175 180 180

4 Design and Implementation of FIR Filters


4.1 Introduction to FIR Filters 4.1.1 Filter Characteristics 4.1.2 Filter Types 4.1.3 Filter Specications 4.1.4 Linear-Phase FIR Filters 4.1.5 Realization of FIR Filters Design of FIR Filters 4.2.1 Fourier Series Method 4.2.2 Gibbs Phenomenon 4.2.3 Window Functions

185
185 185 187 189 191 194 196 197 198 201

4.2

viii

CONTENTS 4.2.4 Design of FIR Filters Using MATLAB 4.2.5 Design of FIR Filters Using FDATool 4.3 Implementation Considerations 4.3.1 Quantization Effects in FIR Filters 4.3.2 MATLAB Implementations 4.3.3 Floating-Point C Implementations 4.3.4 Fixed-Point C Implementations 4.4 Applications: Interpolation and Decimation Filters 4.4.1 Interpolation 4.4.2 Decimation 4.4.3 Sampling-Rate Conversion 4.4.4 MATLAB Implementations 4.5 Experiments and Program Examples 4.5.1 Implementation of FIR Filters Using Fixed-Point C 4.5.2 Implementation of FIR Filter Using C55x Assembly Language 4.5.3 Optimization for Symmetric FIR Filters 4.5.4 Optimization Using Dual MAC Architecture 4.5.5 Implementation of Decimation 4.5.6 Implementation of Interpolation 4.5.7 Sample Rate Conversion 4.5.8 Real-Time Sample Rate Conversion Using DSP/BIOS and DSK References Exercises 206 207 213 213 216 218 219 220 220 221 221 224 225 226 226 228 230 232 233 234 235 245 245

5 Design and Implementation of IIR Filters


5.1 Introduction 5.1.1 Analog Systems 5.1.2 Mapping Properties 5.1.3 Characteristics of Analog Filters 5.1.4 Frequency Transforms Design of IIR Filters 5.2.1 Bilinear Transform 5.2.2 Filter Design Using Bilinear Transform Realization of IIR Filters 5.3.1 Direct Forms 5.3.2 Cascade Forms 5.3.3 Parallel Forms 5.3.4 Realization of IIR Filters Using MATLAB Design of IIR Filters Using MATLAB 5.4.1 Filter Design Using MATLAB 5.4.2 Frequency Transforms Using MATLAB 5.4.3 Design and Realization Using FDATool Implementation Considerations 5.5.1 Stability 5.5.2 Finite-Precision Effects and Solutions 5.5.3 MATLAB Implementations

249
249 249 251 252 254 255 256 257 258 258 260 262 263 264 264 267 268 271 271 273 275

5.2

5.3

5.4

5.5

CONTENTS Practical Applications 5.6.1 Recursive Resonators 5.6.2 Recursive Quadrature Oscillators 5.6.3 Parametric Equalizers 5.7 Experiments and Program Examples 5.7.1 Floating-Point Direct-Form I IIR Filter 5.7.2 Fixed-Point Direct-Form I IIR Filter 5.7.3 Fixed-Point Direct-Form II Cascade IIR Filter 5.7.4 Implementation Using DSP Intrinsics 5.7.5 Implementation Using Assembly Language 5.7.6 Real-Time Experiments Using DSP/BIOS 5.7.7 Implementation of Parametric Equalizer 5.7.8 Real-Time Two-Band Equalizer Using DSP/BIOS References Exercises 5.6

ix 279 279 282 284 285 285 286 287 289 290 293 296 297 299 299

6 Frequency Analysis and Fast Fourier Transform


Fourier Series and Transform 6.1.1 Fourier Series 6.1.2 Fourier Transform 6.2 Discrete Fourier Transform 6.2.1 Discrete-Time Fourier Transform 6.2.2 Discrete Fourier Transform 6.2.3 Important Properties 6.3 Fast Fourier Transforms 6.3.1 Decimation-in-Time 6.3.2 Decimation-in-Frequency 6.3.3 Inverse Fast Fourier Transform 6.4 Implementation Considerations 6.4.1 Computational Issues 6.4.2 Finite-Precision Effects 6.4.3 MATLAB Implementations 6.4.4 Fixed-Point Implementation Using MATLAB 6.5 Practical Applications 6.5.1 Spectral Analysis 6.5.2 Spectral Leakage and Resolution 6.5.3 Power Spectrum Density 6.5.4 Fast Convolution 6.6 Experiments and Program Examples 6.6.1 Floating-Point C Implementation of DFT 6.6.2 C55x Assembly Implementation of DFT 6.6.3 Floating-Point C Implementation of FFT 6.6.4 C55x Intrinsics Implementation of FFT 6.6.5 Assembly Implementation of FFT and Inverse FFT 6.6.6 Implementation of Fast Convolution 6.6.7 Real-Time FFT Using DSP/BIOS 6.6.8 Real-Time Fast Convolution References Exercises 6.1

303
303 303 304 305 305 307 310 313 314 316 317 317 317 318 318 320 322 322 323 325 328 332 332 332 336 338 339 343 345 347 347 348

CONTENTS

7 Adaptive Filtering
Introduction to Random Processes Adaptive Filters 7.2.1 Introduction to Adaptive Filtering 7.2.2 Performance Function 7.2.3 Method of Steepest Descent 7.2.4 The LMS Algorithm 7.2.5 Modied LMS Algorithms 7.3 Performance Analysis 7.3.1 Stability Constraint 7.3.2 Convergence Speed 7.3.3 Excess Mean-Square Error 7.3.4 Normalized LMS Algorithm 7.4 Implementation Considerations 7.4.1 Computational Issues 7.4.2 Finite-Precision Effects 7.4.3 MATLAB Implementations 7.5 Practical Applications 7.5.1 Adaptive System Identication 7.5.2 Adaptive Linear Prediction 7.5.3 Adaptive Noise Cancelation 7.5.4 Adaptive Notch Filters 7.5.5 Adaptive Channel Equalization 7.6 Experiments and Program Examples 7.6.1 Floating-Point C Implementation 7.6.2 Fixed-Point C Implementation of Leaky LMS Algorithm 7.6.3 ETSI Implementation of NLMS Algorithm 7.6.4 Assembly Language Implementation of Delayed LMS Algorithm 7.6.5 Adaptive System Identication 7.6.6 Adaptive Prediction and Noise Cancelation 7.6.7 Adaptive Channel Equalizer 7.6.8 Real-Time Adaptive Line Enhancer Using DSK References Exercises 7.1 7.2

351
351 354 354 355 358 360 361 362 362 363 363 364 364 365 365 366 368 368 369 372 374 375 377 377 379 380 383 387 388 392 394 396 397

8 Digital Signal Generators


8.1 Sinewave Generators 8.1.1 Lookup-Table Method 8.1.2 Linear Chirp Signal Noise Generators 8.2.1 Linear Congruential Sequence Generator 8.2.2 Pseudo-Random Binary Sequence Generator Practical Applications 8.3.1 Siren Generators 8.3.2 White Gaussian Noise 8.3.3 Dual-Tone Multifrequency Tone Generator 8.3.4 Comfort Noise in Voice Communication Systems Experiments and Program Examples 8.4.1 Sinewave Generator Using C5510 DSK 8.4.2 White Noise Generator Using C5510 DSK

401
401 401 404 405 405 407 409 409 409 410 411 412 412 413

8.2

8.3

8.4

CONTENTS 8.4.3 Wail Siren Generator Using C5510 DSK 8.4.4 DTMF Generator Using C5510 DSK 8.4.5 DTMF Generator Using MATLAB Graphical User Interface References Exercises

xi 414 415 416 418 418

9 Dual-Tone Multifrequency Detection


Introduction DTMF Tone Detection 9.2.1 DTMF Decode Specications 9.2.2 Goertzel Algorithm 9.2.3 Other DTMF Detection Methods 9.2.4 Implementation Considerations 9.3 Internet Application Issues and Solutions 9.4 Experiments and Program Examples 9.4.1 Implementation of Goertzel Algorithm Using Fixed-Point C 9.4.2 Implementation of Goertzel Algorithm Using C55x Assembly Language 9.4.3 DTMF Detection Using C5510 DSK 9.4.4 DTMF Detection Using All-Pole Modeling References Exercises 9.1 9.2

421
421 422 422 423 426 428 431 432 432 434 435 439 441 442

10 Adaptive Echo Cancelation


10.1 10.2 Introduction to Line Echoes Adaptive Echo Canceler 10.2.1 Principles of Adaptive Echo Cancelation 10.2.2 Performance Evaluation 10.3 Practical Considerations 10.3.1 Prewhitening of Signals 10.3.2 Delay Detection 10.4 Double-Talk Effects and Solutions 10.5 Nonlinear Processor 10.5.1 Center Clipper 10.5.2 Comfort Noise 10.6 Acoustic Echo Cancelation 10.6.1 Acoustic Echoes 10.6.2 Acoustic Echo Canceler 10.6.3 Subband Implementations 10.6.4 Delay-Free Structures 10.6.5 Implementation Considerations 10.6.6 Testing Standards 10.7 Experiments and Program Examples 10.7.1 MATLAB Implementation of AEC 10.7.2 Acoustic Echo Cancelation Using Floating-Point C 10.7.3 Acoustic Echo Canceler Using C55x Intrinsics 10.7.4 Experiment of Delay Estimation References Exercises

443
443 444 445 446 447 447 448 450 453 453 453 454 454 456 457 459 459 460 461 461 464 468 469 472 472

xii

CONTENTS

11 Speech-Coding Techniques
11.1 11.2 Introduction to Speech-Coding Overview of CELP Vocoders 11.2.1 Synthesis Filter 11.2.2 Long-Term Prediction Filter 11.2.3 Perceptual Based Minimization Procedure 11.2.4 Excitation Signal 11.2.5 Algebraic CELP 11.3 Overview of Some Popular CODECs 11.3.1 Overview of G.723.1 11.3.2 Overview of G.729 11.3.3 Overview of GSM AMR 11.4 Voice over Internet Protocol Applications 11.4.1 Overview of VoIP 11.4.2 Real-Time Transport Protocol and Payload Type 11.4.3 Example of Packing G.729 11.4.4 RTP Data Analysis Using Ethereal Trace 11.4.5 Factors Affecting the Overall Voice Quality 11.5 Experiments and Program Examples 11.5.1 Calculating LPC Coefcients Using Floating-Point C 11.5.2 Calculating LPC Coefcients Using C55x Intrinsics 11.5.3 MATLAB Implementation of Formant Perceptual Weighting Filter 11.5.4 Implementation of Perceptual Weighting Filter Using C55x Intrinsics References Exercises

475
475 476 477 481 481 482 483 484 484 488 490 492 492 493 496 496 497 497 497 499 504 506 507 508

12 Speech Enhancement Techniques


12.1 12.2 Introduction to Noise Reduction Techniques Spectral Subtraction Techniques 12.2.1 Short-Time Spectrum Estimation 12.2.2 Magnitude Subtraction 12.3 Voice Activity Detection 12.4 Implementation Considerations 12.4.1 Spectral Averaging 12.4.2 Half-Wave Rectication 12.4.3 Residual Noise Reduction 12.5 Combination of Acoustic Echo Cancelation with NR 12.6 Voice Enhancement and Automatic Level Control 12.6.1 Voice Enhancement Devices 12.6.2 Automatic Level Control 12.7 Experiments and Program Examples 12.7.1 Voice Activity Detection 12.7.2 MATLAB Implementation of NR Algorithm 12.7.3 Floating-Point C Implementation of NR 12.7.4 Mixed C55x Assembly and Intrinsics Implementations of VAD 12.7.5 Combining AEC with NR References Exercises

509
509 510 511 511 513 515 515 515 516 516 518 518 519 519 519 522 522 522 526 529 529

CONTENTS

xiii

13 Audio Signal Processing


13.1 13.2 Introduction Basic Principles of Audio Coding 13.2.1 Auditory-Masking Effects for Perceptual Coding 13.2.2 Frequency-Domain Coding 13.2.3 Lossless Audio Coding 13.3 Multichannel Audio Coding 13.3.1 MP3 13.3.2 Dolby AC-3 13.3.3 MPEG-2 AAC 13.4 Connectivity Processing 13.5 Experiments and Program Examples 13.5.1 Floating-Point Implementation of MDCT 13.5.2 Implementation of MDCT Using C55x Intrinsics 13.5.3 Experiments of Preecho Effects 13.5.4 Floating-Point C Implementation of MP3 Decoding References Exercises

531
531 531 533 536 538 539 540 541 542 544 544 544 547 549 549 553 553

14 Channel Coding Techniques


14.1 14.2 Introduction Block Codes 14.2.1 ReedSolomon Codes 14.2.2 Applications of ReedSolomon Codes 14.2.3 Cyclic Redundant Codes 14.3 Convolutional Codes 14.3.1 Convolutional Encoding 14.3.2 Viterbi Decoding 14.3.3 Applications of Viterbi Decoding 14.4 Experiments and Program Examples 14.4.1 ReedSolomon Coding Using MATALB 14.4.2 ReedSolomon Coding Using Simulink 14.4.3 Verication of RS(255, 239) Generation Polynomial 14.4.4 Convolutional Codes 14.4.5 Implementation of Convolutional Codes Using C 14.4.6 Implementation of CRC-32 References Exercises

555
555 556 558 562 563 564 564 564 566 569 569 570 571 572 573 575 576 577

15 Introduction to Digital Image Processing


15.1 Digital Images and Systems 15.1.1 Digital Images 15.1.2 Digital Image Systems RGB Color Spaces and Color Filter Array Interpolation Color Spaces 15.3.1 YCb Cr and YUV Color Spaces 15.3.2 CYMK Color Space

579
579 579 580 581 584 584 585

15.2 15.3

xiv

CONTENTS 15.3.3 YIQ Color Space 15.3.4 HSV Color Space 15.4 YCb Cr Subsampled Color Spaces 15.5 Color Balance and Correction 15.5.1 Color Balance 15.5.2 Color Adjustment 15.5.3 Gamma Correction 15.6 Image Histogram 15.7 Image Filtering 15.8 Image Filtering Using Fast Convolution 15.9 Practical Applications 15.9.1 JPEG Standard 15.9.2 2-D Discrete Cosine Transform 15.10 Experiments and Program Examples 15.10.1 YCb Cr to RGB Conversion 15.10.2 Using CCS Link with DSK and Simulator 15.10.3 White Balance 15.10.4 Gamma Correction and Contrast Adjustment 15.10.5 Histogram and Histogram Equalization 15.10.6 2-D Image Filtering 15.10.7 Implementation of DCT and IDCT 15.10.8 TMS320C55x Image Accelerator for DCT and IDCT 15.10.9 TMS320C55x Hardware Accelerator Image/Video Processing Library References Exercises 585 585 586 586 587 588 589 590 591 596 597 597 599 601 601 604 607 610 611 613 617 621 623 625 625

Appendix A Some Useful Formulas and Denitions


A.1 Trigonometric Identities A.2 Geometric Series A.3 Complex Variables A.4 Units of Power References

627
627 628 628 630 631

Appendix B Software Organization and List of Experiments Index

633 639

Preface
In recent years, digital signal processing (DSP) has expanded beyond ltering, frequency analysis, and signal generation. More and more markets are opening up to DSP applications, where in the past, real-time signal processing was not feasible or was too expensive. Real-time signal processing using general-purpose DSP processors provides an effective way to design and implement DSP algorithms for real-world applications. However, this is very challenging work in todays engineering elds. With DSP penetrating into many practical 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. Therefore, it becomes increasingly important for todays students, practicing engineers, and development researchers to master not only the theory of DSP, but also the skill of real-time DSP system design and implementation techniques. This book provides fundamental real-time DSP principles and uses a hands-on approach to introduce DSP algorithms, system design, real-time implementation considerations, and many practical applications. This book contains many useful examples like hands-on experiment software and DSP programs using MATLAB, Simulink, C, and DSP assembly languages. Also included are various exercises for further exploring the extensions of the examples and experiments. The book uses the Texas Instruments Code Composer Studio (CCS) with the Spectrum Digital TMS320VC5510 DSP starter kit (DSK) development tool for real-time experiments and applications. This book emphasizes real-time DSP applications and is intended as a text for senior/graduate-level college students. The prerequisites of this book are signals and systems concepts, microprocessor architecture and programming, and basic C programming knowledge. These topics are covered at the sophomore and junior levels of electrical and computer engineering, computer science, and other related engineering curricula. This book can also serve as a desktop reference for DSP engineers, algorithm developers, and embedded system programmers to learn DSP concepts and to develop real-time DSP applications on the job. We use a practical approach that avoids numerous theoretical derivations. A list of DSP textbooks with mathematical proofs is given at the end of each chapter. Also helpful are the manuals and application notes for the TMS320C55x DSP processors from Texas Instruments at www.ti.com, and for the MATLAB and Simulink from Math Works at www.mathworks.com. This is the second edition of the book titled Real-Time Digital Signal Processing: Implementations, Applications and Experiments with the TMS320C55x by Kuo and Lee, John Wiley & Sons, Ltd. in 2001. The major changes included in the revision are: 1. To utilize the effective software development process that begins from algorithm design and verication using MATLAB and oating-point C, to nite-wordlength analysis, xed-point C implementation and code optimization using intrinsics, assembly routines, and mixed C-and-assembly programming

xvi

PREFACE on xed-point DSP processors. This step-by-step software development and optimization process is applied to the nite-impulse response (FIR) ltering, innite-impulse response (IIR) ltering, adaptive ltering, fast Fourier transform, and many real-life applications in Chapters 815.

2. To add several widely used DSP applications such as speech coding, channel coding, audio coding, image processing, signal generation and detection, echo cancelation, and noise reduction by expanding Chapter 9 of the rst edition to eight new chapters with the necessary background to perform the experiments using the optimized software development process. 3. To design and analyze DSP algorithms using the most effective MATLAB graphic user interface (GUI) tools such as Signal Processing Tool (SPTool), Filter Design and Analysis Tool (FDATool), etc. These tools are powerful for lter designing, analysis, quantization, testing, and implementation. 4. To add step-by-step experiments to create CCS DSP/BIOS applications, congure the TMS320VC5510 DSK for real-time audio applications, and utilize MATLABs Link for CCS feature to improve DSP development, debug, analyze, and test efciencies. 5. To update experiments to include new sets of hands-on exercises and applications. Also, to update all programs using the most recent version of software and the TMS320C5510 DSK board for real-time experiments.

There are many existing DSP algorithms and applications available in MATLAB and oating-point C programs. This book provides a systematic software development process for converting these programs to xed-point C and optimizing them for implementation on commercially available xed-point DSP processors. To effectively illustrate real-time DSP concepts and applications, MATLAB is used for analysis and lter design, C program is used for implementing DSP algorithms, and CCS is integrated into TMS320C55x experiments and applications. To efciently utilize the advanced DSP architecture for fast software development and maintenance, the mixing of C and assembly programs is emphasized. This book is organized into two parts: DSP implementation and DSP application. Part I, DSP implementation (Chapters 17) discusses real-time DSP principles, architectures, algorithms, and implementation considerations. Chapter 1 reviews the fundamentals of real-time DSP functional blocks, DSP hardware options, xed- and oating-point DSP devices, real-time constraints, algorithm development, selection of DSP chips, and software development. Chapter 2 introduces the architecture and assembly programming of the TMS320C55x DSP processor. Chapter 3 presents fundamental DSP concepts and practical considerations for the implementation of digital lters and algorithms on DSP hardware. Chapter 4 focuses on the design, implementation, and application of FIR lters. Digital IIR lters are covered in Chapter 5, and adaptive lters are presented in Chapter 7. The development, implementation, and application of FFT algorithms are introduced in Chapter 6. Part II, DSP application (Chapters 815) introduces several popular real-world applications in signal processing that have played important roles in the realization of the systems. These selected DSP applications include signal (sinewave, noise, and multitone) generation in Chapter 8, dual-tone multifrequency detection in Chapter 9, adaptive echo cancelation in Chapter 10, speech-coding algorithms in Chapter 11, speech enhancement techniques in Chapter 12, audio coding methods in Chapter 13, error correction coding techniques in Chapter 14, and image processing fundamentals in Chapter 15. As with any book attempting to capture the state of the art at a given time, there will certainly be updates that are necessitated by the rapidly evolving developments in this dynamic eld. We are certain that this book will serve as a guide for what has already come and as an inspiration for what will follow.

SOFTWARE AVAILABILITY

xvii

Software Availability
This text utilizes various MATLAB, oating-point and xed-point C, DSP assembly and mixed C and assembly programs for the examples, experiments, and applications. These programs along with many other programs and real-world data les are available in the companion CD. The directory structure and the subdirectory names are explained in Appendix B. The software will assist in gaining insight into the understanding and implementation of DSP algorithms, and it is required for doing experiments in the last section of each chapter. Some of these experiments involve minor modications of the example code. By examining, studying, and modifying the example code, the software can also be used as a prototype for other practical applications. Every attempt has been made to ensure the correctness of the code. We would appreciate readers bringing to our attention (kuo@ceet.niu.edu) any coding errors so that we can correct, update, and post them on the website http://www.ceet.niu.edu/faculty/kuo.

Acknowledgments
We are grateful to Cathy Wicks and Gene Frantz of Texas Instruments, and to Naomi Fernandes and Courtney Esposito of The MathWorks for providing us with the support needed to write this book. We would like to thank several individuals at Wiley for their support on this project: Simone Taylor, Executive Commissioning Editor; Emily Bone, Assistant Editor; and Lucy Bryan, Executive Project Editor. We also thank the staff at Wiley for the nal preparation of this book. Finally, we thank our families for the endless love, encouragement, patience, and understanding they have shown throughout this period. Sen M. Kuo, Bob H. Lee and Wenshun Tian

Você também pode gostar