Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Real-time digital signal processing from MATLAB to C with the TMS320C6x DSK
Nội dung xem thử
Mô tả chi tiết
REAL-TIME
DIGITAL SIGNAL
PROCESSING
from M a t l a b ® to C with
the TM S320C6x DSK
2.50 MSa/s
File Control Setup Measure Analyze Utilities Help
[o »Ib Is I f f l 'tL S J »M ' BEü.üJlij <|»|►[ j j E E ^ M ± I
I huVten DHKTCM-TIS . W elch
H.G. W right
M ichael G. M o rro w
KNV 14000734
REAL-TIME
DIGITAL SIGNAL
PROCESSING
fro m M a tla b ® to C w ith
th e TMS320C6X DSK
rHA
REAL-TIME
DIGITAL SIGNAL
PROCESSING
from M atlab® to C w ith
the TMS320C6X DSK
Thad B. W elch
United States Naval Academy, Annapolis, Maryland
Cam eron H.G. W right
University of Wyoming, Laramie, Wyoming
M ichael G. M o rro w
______University of Wisconsin, Madison, Wisconsin
TRI/i/NR BWHHC KT i’£ Nfi NflHIE P
'I h i f V IE M
PH0N(3 BOG
Taylor & Francis
Taylor & Francis Croup
Boca Raton London New York
A CRC title, part of the Taylor & Francis imprint, a member of the
Taylor & Francis Croup, the academic division of T&F Informa pic.
M a t l a b and S im u lin k arc re g iste red trad e m ark s «(‘ T h e M athW orks. Inc.
C o d e C o m p o se r S tu d io an d D S P /B IO S are trad e m ark s o f T exas In stru m en ts, Inc.
W in d o w s is a trad e m ark o f M icro so ft C o rp o ra tio n .
P u b lish ed in 2 0 0 6 by
C R C Press
T ay lo r & F ran c is G ro u p
60 0 0 B roken S ound P arkw ay N W . S u ite 3 00
B o ca R ato n . F L 3348 7 -2 7 4 2
© 2 0 0 6 by T ay lo r & F ran c is G ro u p . L L C
C R C P ress is an im print o f T ay lo r & F ran c is G ro u p
N o c la im to orig in al U .S. G o v e rn m en t w orks
P rin te d in the U nited S ta les o f A m eric a on a c id -fre e paper
10 9 8 7 6 5 4 3 2
In tern atio n al S ta n d ard B ook N u m b e r-10: 0 -8 4 9 3 -7 3 8 2 -4 (H ard c o v er)
In tern atio n al S ta n d ard B ook N u m b e r-1 3: 9 7 8 -0 -8 4 9 3 -7 3 8 2 -4 (H ard c o v er)
T h is boo k c o n ta in s in fo rm a tio n o b ta in e d from au th e n tic and highly re g ard e d so u rces. R ep rin ted m ateria l is q u o te d w ith
p erm issio n , an d so u rc es are in d icate d . A w id e variety o f re feren ce s are listed. R easo n a b le effo rts have b ee n m a d e to p u b lish
re lia b le d ata an d in fo rm atio n , but th e a u th o r an d the p u b lish e r ca n n o t assu m e resp o n sib ility fo r th e v alid ity o f all m ateria ls
o r fo r the co n se q u en ce s o f th e ir use.
N o p art o f th is book m ay be re p rin ted , re p ro d u ce d , tran sm itted , o r u tiliz ed in any fo rm by any e le ctro n ic, m e c h a n ic a l, o r
o th e r m ean s, now know n o r h ereafter in vented, in clu d in g p h o to co p y in g , m icro film in g , an d reco rd in g , o r in any in fo rm a tio n
sto ra g e o r retrieval system , w ith o u t w ritten p erm issio n from the p u b lish ers.
F o r p e r m is s io n to p h o to c o p y o r u se m a te ria l e le c tro n ic a lly fro m th is w o rk , p le a se a c c e ss w w w .c o p y rig h t.c o m
(h ttp ://w w w .co p y rig h t.co m /) o r co n ta ct the C o p y rig h t C le aran ce CcnfeK- Inc^ (Q C C ) 2 22 R osew o o d Drivp* D a n v ers. M A
0 1 9 2 3 . 9 7 8 -7 5 0 -8 4 0 0 . C C C is a not-fo r-p ro fit o rg a n iz atio n that p ro v id es licen se d ¿ n d re g istra tio n fo r a v arie ty o f u sers. F or
o rg a n iz a tio n s that have been g ra n te d a p h o to co p y licen se by the C C C , a se p a rate t§ y stem o f pay m en t h as b ee n arran g e d .
T ra d em a r k N otice: Product o r c o rp o ra te n am es m ay be trad e m ark s o r re g iste red trad e m ark s, and a re u sed o n ly fo r
id en tifica tio n and e x p la n atio n w ith o u t intent to infringe.
L ib ra r y o f C o n g re ss C a ta lo g in g -in -P u b lic a tio n D ata
C atalo g re co rd is available from th e L ibrary o f C o n g ress
V isit th e T a y lo r & F r a n c is W eb s ite a t
h ttp ://w w w .t a y lo r a n d fr a n c is.c o m
Taylor & Francis Group
is the Academic Division of Informa pic.
a n d th e C R C P r e ss W eb s ite at
h ttp ://w w w .c r c p r e s s .c o m
To Donna...
To Robin...
To J a n ...
Foreword
Digital signal processing is at the “heart” of most technologies that we use today. Our
cell phones use digital signal processing to generate the DTM F (dual tone multi-frequency)
tones that are sent to wireless networks. O ur 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
th at we can store hundreds of images in a single memory card. It is digital signal processing
that allows us to play compressed music in our iPODs. Digital signal processing controls
even the anti-lock brakes in our cars today. And these are just a few of the examples of
real-time signal processing in the world around us.
There are many good textbooks today to teach digital signal processing—bu t most of
them are content to teach the theory, and perhaps some M a t l a b simulations. This 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. This last step
is not a trivial step, and that is why so many books and courses present only theory and
simulations. W ith the combined expertise of the three authors of this text -T h ad 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.
I have been fortunate to co-author several papers with the authors of this text, and can
speak from first-hand experiences of their dedication to engineering education. They go the
extra mile to continue to expand their understanding and their abilities to present complex material in a logical, straightforward manner. They attend conferences on engineering
education; they chair sessions 011 engineering education; they write papers on engineering
education; they live engineering education! So, 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
rid e...
Delores M. E tter
Professor, Electrical Engineering
Distinguished Chair in Science and Technology
United States Naval Academy
Annapolis, Maryland
(Dr. Etter is member o f the National Academy o f Engineering and a Fellow of the IEEE and
the American Society of Engineering Education. She served as the Deputy Under Secretary
of Defense for Science and Technology from 1998 2001. She is also the author o f a nwnber
of engineering textbooks, including several on M A T L A B .)
A bout the A uthors
T h a d B. W elch, P h .D ., P .E ., is an Associate Professor and Perm anent Military Professor in the Departm ent of Electrical and Com puter Engineering at the U.S. Naval
Academy (USNA). Annapolis. Maryland, and previously taught at the U.S. Air Force
Academy (USAFA) in the Departm ent of Electrical Engineering. He is a Commander
in the U.S. Navy, and won the 1997 Clements Outstanding Educator Award at USAFA, the 2001 ECE O utstanding Educator Award, 2002 Raouf Award for Excellence
in the Teaching of Engineering, and the 2003 ECE Outstanding Researcher Award
at USNA. Dr. Welch is the former chairman and a founding member of the Technical Committee on Signal Processing Education for the Institute of Electrical and
Electronic Engineers (IEEE) Signal Processing Society. He is a senior member of the
IEEE and a member of the American Society for Engineering Education (ASEE).
C a m e ro n H . G . W rig h t, P h .D ., P .E ., is an Assistant Professor in the D epartm ent of
Electrical and Com puter Engineering at the University of Wyoming, and previously
taught for nearly ten years at the U.S. Air Force Academy (USAFA) in the Departm ent
of Electrical Engineering where he was Professor and Deputy Departm ent Head. A
retired Lieutenant Colonel in the U.S. Air Force, he won the Brigadier General R.
E. Thomas Award for O utstanding Contributions to Cadet Education in 1992 and
1993. In 2005, he won the IEEE Student Choice Award for O utstanding Professor
of the Year and the M ortar Board “Top Prof" Award at the University of Wyoming.
Dr. W right is a founding member of the Technical Com mittee on Signal Processing
Education for the IEEE Signal Processing Society. He is a senior member of the
IEEE, and a member of ASEE, the National Society of Professional Engineers, and
the International Society of Optical Engineers.
M ich ael G . M o rro w , M .E n g .E .E ., P .E ., is a Faculty Associate in the D epartm ent of
Electrical and Com puter Engineering at the University of W isconsin-Madison. A
retired Lieutenant Commander in the U.S. Navy, he previously taught in the Electrical Engineering D epartm ent at the U.S. Naval Academy. Mr. Morrow won both
the 2002 D epartm ent of Electrical and Com puter Engineering O utstanding Educator
Award and the 2003 Gerald Holdridge Teaching Excellence Award at the University
of W isconsin-Madison, and was designated a Microsoft Most Valuable Professional
(MVP). He is the founder and president of Educational DSP (eDSP), LLC. developing
affordable DSP education solutions. He is a member of the Technical Com mittee on
Signal Processing Education for the Institute of Electrical and Electronic Engineers
(IEEE) Signal Processing Society, a senior member of the IEEE, and a member of the
American Society for Engineering Education (ASEE).
'
C ontents
P re fa c e xxxi
A ck n o w led g m e n ts xxxiii
E n d u rin g F u n d a m e n ta ls 1
1 In tro d u c tio n a n d O rg a n iz a tio n 3
1.1 Why Do You Need This B o o k ? .............................................................................. 3
1.1.1 Other DSP Books ............................................................................................ 3
1.1.2 Demos and DSP Hardware ........................................................................... 4
1.1.3 Philosophy of This B o o k .................................................................................. 4
1.2 Real-Time D S P .............................................................................................................. 4
1.3 How to Use This B o o k ................................................................................................. 5
1.3.1 Transition to R eal-T im e.................................................................................. 8
1.3.2 Chapter Coverage ............................................................................................ 8
1.3.3 Hardware and Software Installation .......................................................... 9
1.3.4 Reading Program L istin g s.............................................................................. 9
1.4 Get S t a r te d ..................................................................................................................... 10
2 S am p lin g a n d R e c o n s tru c tio n 11
2.1 T h eo ry ............................................................................................................................... 11
2.1.1 Choosing a Sampling Frequency ................................................................. 11
2.1.2 Input/O utput Issues: Samples or F ram es?................................................ 11
2.1.3 The Talk-Through C o n c e p t........................................................................... 12
2.2 winDSK6 Demonstration .......................................................................................... 12
2.2.1 Starting w in D S K 6 ............................................................................................ 12
2.2.2 Talk-Thru A pplication..................................................................................... 13
2.3 Talk-Through Using W indow s.................................................................................... 15
2.4 Talk-Through Using MATLAB and W in d o w s..................................................... 16
2.4.1 Talk-Through Using MATLAB O n ly .......................................................... 18
2.4.2 Talk-Through Using M A T L A B .................................................................... 21
2.5 DSK Implementation in C .......................................................................................... 22
2.6 Follow-On Challenges ................................................................................................. 23
3 F IR D ig ital F ilte rs 25
3.1 T h eo ry ............................................................................................................................... 25
3.1.1 Traditional N o ta tio n ......................................................................................... 25
3.1.2 FIR Filters Compared to HR F 'ilte rs ........................................................... 26
3.1.3 Calculating the O utput of a F i l t e r .............................................................. 26
xi