Real.Time.Digital.Signal.Processing.Implementations.and.Applications.Jun.2006.pdf
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 C 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 Offices
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 processing–Digital techniques. 2. Texas Instruments TMS320 series microprocessors.
I. Lee, Bob H. II. Tian, Wenshun. III. Title.
TK5102 .9 .K86 2006
621.3822-dc22 2005036660
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.
Preface
In recent years, digital signal processing (DSP) has expanded beyond filtering, 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 today’s engineering fields. 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 today’s 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 verification
usingMATLABand floating-point C, to finite-wordlength analysis, fixed-pointCimplementation
and code optimization using intrinsics, assembly routines, and mixed C-and-assembly programming
xvi PREFACE
on fixed-point DSP processors. This step-by-step software development and optimization process
is applied to the finite-impulse response (FIR) filtering, infinite-impulse response (IIR) filtering,
adaptive filtering, fast Fourier transform, and many real-life applications in Chapters 8–15.
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 first 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 filter designing, analysis, quantization, testing, and implementation.
4. To add step-by-step experiments to create CCS DSP/BIOS applications, configure the
TMS320VC5510 DSK for real-time audio applications, and utilizeMATLAB’s Link for CCS feature
to improve DSP development, debug, analyze, and test efficiencies.
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 floating-point
C programs. This book provides a systematic software development process for converting these programs
to fixed-point C and optimizing them for implementation on commercially available fixed-point
DSP processors. To effectively illustrate real-time DSP concepts and applications, MATLAB is used
for analysis and filter design, C program is used for implementing DSP algorithms, and CCS is integrated
into TMS320C55x experiments and applications. To efficiently 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:DSPimplementation andDSPapplication. Part I,DSPimplementation
(Chapters 1–7) discusses real-time DSP principles, architectures, algorithms, and implementation
considerations. Chapter 1 reviews the fundamentals of real-time DSP functional blocks, DSP hardware
options, fixed- and floating-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 filters and algorithms on DSP hardware. Chapter 4 focuses
on the design, implementation, and application of FIR filters. Digital IIR filters are covered in Chapter 5,
and adaptive filters are presented in Chapter 7. The development, implementation, and application of
FFT algorithms are introduced in Chapter 6.
Part II, DSP application (Chapters 8–15) 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 field. 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, floating-point and fixed-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 files 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 modifications 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 atWiley 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 atWiley for the final 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