Table Of ContentThird Edition
Real-Time Digital Signal
Processing MATLAB® C
from t o
TMS320C6x DSPs
with the
Third Edition
Real-Time Digital Signal
Processing MATLAB® C
from t o
TMS320C6x DSPs
with the
Thad B. Welch
Boise State University, Boise, ID, USA
Cameron H.G. Wright
University of Wyoming, Laramie, WY, USA
Michael G. Morrow
University of Wisconsin, Madison, USA
Boca Raton London New York
CRC Press is an imprint of the
Taylor & Francis Group, an informa business
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2017 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business
No claim to original U.S. Government works
Printed on acid-free paper
Version Date: 20160817
International Standard Book Number-13: 978-1-4987-8101-5 (Hardback)
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to
publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials
or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material repro-
duced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any
copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any
form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming,
and recording, or in any information storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copy-
right.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400.
CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been
granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identifica-
tion and explanation without intent to infringe.
Library of Congress Cataloging‑in‑Publication Data
Names: Welch, Thad B., author. | Wright, Cameron H. G., author. | Morrow,
Michael G., author.
Title: Real-time digital signal processing from MATLAB to C with the
TMS320C6x DSPs / Thad B. Welch, Cameron H. G. Wright, Michael G. Morrow.
Description: Third edition. | Boca Raton : Taylor & Francis, 2017. | Includes
bibliographical references and index.
Identifiers: LCCN 2016033212| ISBN 9781498781015 (hardback) | ISBN
9781315365688 (ebook)
Subjects: LCSH: Signal processing--Digital techniques. | Texas Instruments
TMS320 series microprocessors.
Classification: LCC TK5102.9 .W44 2017 | DDC 621.382/2--dc23
LC record available at https://lccn.loc.gov/2016033212
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
To Donna...
To my young son Jacob and the memory of my beloved wife Robin...
To all those people whose friendship, counsel, and criticism have helped us
along the way...
v
Foreword
Digital signal processing is at the “heart” of most technologies that we use today. Our cell
phonesusedigitalsignalprocessingtogeneratetheDTMF(dualtonemulti-frequency)tones
that are used to communicate with wireless networks. Our noise-canceling headphones use
adaptive digital signal processing to cancel the noise in the environment around us. Digital
cameras use digital signal processing to compress images into JPEG formats for efficient
storage so that we can store many thousands of images in a single memory card. It is
digital signal processing that allows us to play compressed music stored in our cellphones
and iPods. Digital signal processing controls even the anti-lock brakes in our cars today.
And these are just a few examples of real-time signal processing in the world around us.
There are many good textbooks today to teach digital signal processing—but most of
them are content to teach the theory, and perhaps some MATLABR simulations. This
(cid:31)
book has taken a bold step forward. It not only presents the theory, it reinforces it with
simulations, and then it shows us how to actually use the results in real-time applications.
Thislaststepisnotatrivialstep,andthatiswhysomanybooks,andcourses,presentonly
theory and simulations. With the combined expertise of the three authors of this text—
Thad Welch, Cam Wright, and Mike Morrow—the reader can step into the real-time world
of applications with a text that presents an accessible path. This Third Edition continues
tosupporttheC6713DSKandthemulti-coreOMAP-L138boardfromTexasInstruments.
The multi-core OMAP-138 chip includes both a C6784 DSP core and an ARM9 GPP core,
making it very powerful and attractive to a wide variety of users. The new addition also
supportstheTILCDK(lowcostdevelopmentkit). Newprojectchapterscoveringadaptive
filtering and second-order sections (sos) have been added to the existing project chapters
thatincludeQPSKandQAMtransmittersandreceivers. Allcodehasbeenupdatedtorun
on CCS version 6.1 and all m-files have been updated to run on MATLAB 2016a.
I have been fortunate to co-author several papers with the authors of this text, and can
speakfromfirst-handexperiencesoftheirdedicationtoengineeringeducation. Theygothe
extra mile to continue to expand their understanding and their abilities to present com-
plex material in a logical, straightforward manner. They attend conferences on engineering
education; they chair sessions on engineering education; they write papers on engineering
education; they live engineering education! (One of the co-authors, Thad Welch, was re-
cently selected as the first Signal Processing Engineering Network Fellow to recognize his
leadership and contributions.). I am delighted to be able to have an opportunity to tell the
readers of this text that they are in for, in the authors’ own words, “a ride...”.
Delores M. Etter
Caruth Chair in Electrical Engineering
Distinguished Fellow, Darwin Deason Institute for Cyber Security
Lyle School of Engineering
Southern Methodist University
Dallas, Texas
(Dr. Etter is a member of the National Academy of Engineering and is a Fellow of both the IEEE
and the American Society of Engineering Education. She served as the Assistant Secretary of
the Navy for Research, Development and Acquisitions from 2005–2007, and as the Deputy Under
Secretary of Defense for Science and Technology from 1998–2001. She is also the author of a
number of engineering textbooks, including several on MATLAB.)
vii
About the Authors
Thad B. Welch, Ph.D., P.E., is a Professor and past Chair of the Department of Elec-
trical and Computer Engineering at Boise State University. He previously taught
in the Department of Electrical and Computer Engineering at both the U.S. Naval
Academy (USNA) and the U.S. Air Force Academy (USAFA). A retired Comman-
der in the U.S. Navy, he was the inaugural 2011 SPEN Fellow, won the 2001 ECE
Outstanding Educator Award, the 2002 Raouf Award for Excellence in the Teaching
of Engineering, the John A. Curtis Lecture Award from the Computers in Education
Division of ASEE in 1998, 2005, and 2010, the 2003 ECE Outstanding Researcher
Award at USNA, and the 1997 Clements Outstanding Educator Award at USAFA.
Dr. Welch is the former Chair and a founding member of the Technical Committee
on Signal Processing Education for the Institute of Electrical and Electronic Engi-
neers (IEEE) Signal Processing Society. He is a senior member of the IEEE and a
member of the American Society for Engineering Education (ASEE), Tau Beta Pi
(the engineering honor society), and Eta Kappa Nu (the electrical engineering honor
society).
Cameron H. G. Wright, Ph.D., P.E., is a Professor in the Department of Electrical
and Computer Engineering at the University of Wyoming. He previously taught at
the U.S. Air Force Academy (USAFA) in the Department of Electrical Engineering
where he was Professor and Deputy Department Head. A retired Lieutenant Colonel
in the U.S. Air Force, he won the Brigadier General R. E. Thomas Award for Out-
standing Contributions to Cadet Education in 1992 and 1993. In 2005 and 2008,
he won the IEEE Student Choice Award for Outstanding Professor of the Year, the
Mortar Board “Top Prof” Award at the University of Wyoming in 2005, 2007, and
2015, the Outstanding Teaching Award from the ASEE Rocky Mountain Section in
2007, the John A. Curtis Lecture Award from the Computers in Education Division
of ASEE in 1998, 2005, and 2010, the Tau Beta Pi WY-A chapter Undergraduate
TeachingAwardin2011, andtheUniversityofWyomingEllbogenMeritoriousClass-
room Teaching Award in 2012. Dr. Wright is a founding member of the Technical
Committee on Signal Processing Education for the IEEE Signal Processing Society, a
senior member of the IEEE, and a member of ASEE, the National Society of Profes-
sionalEngineers,theBiomedicalEngineeringSociety,SPIE–TheInternationalSociety
of Optical Engineering, Tau Beta Pi, and Eta Kappa Nu.
Michael G. Morrow, M.Eng.E.E., P.E., is a Faculty Associate in the Department of
Electrical and Computer Engineering at the University of Wisconsin–Madison. A
retired Lieutenant Commander in the U.S. Navy, he previously taught in the Elec-
trical and Computer Engineering Department at the U.S. Naval Academy and in the
Department of Electrical and Computer Engineering at Boise State University. Mr.
Morrowwonboththe2002DepartmentofElectricalandComputerEngineeringOut-
standingEducatorAwardandthe2003GeraldHoldridgeTeachingExcellenceAward
at the University of Wisconsin–Madison. He is the founder and president of Educa-
tional DSP (eDSP), LLC, a company devoted to the development of affordable DSP
solutions for educators and students worldwide. He is a member of the Technical
Committee on Signal Processing Education for the Institute of Electrical and Elec-
tronicEngineers(IEEE)SignalProcessingSociety,aseniormemberoftheIEEE,and
a member of the American Society for Engineering Education (ASEE).
ix