Real-Time DSP: ECE 5655/4655 Lecture Notes
Real-Time DSP: ECE 5655/4655 Lecture Notes
© 1998 – 2014
Mark A. Wickert
Portions "Courtesy of Texas Instruments"
TMS320C6x Programming
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
Programming Alternatives 3–1
Introduction to Assembly Language Programming . . . . . . . . . . . . . . . . . . 3–2
A Dot Product Example 3–2
Instruction Set Summary by Category 3–10
C62xx and C67xx Instruction Set Summary by Unit 3–11
Introduction to the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12
Pipelined and Non-Pipelined 3–13
Program Fetch Stage 3–13
Decode Stage 3–14
Execute Stage 3–14
Summary of Pipeline Phases 3–15
Sending Code Through the Pipeline 3–16
Pipeline Code Example 3–16
Use of Parallel Instructions 3–22
C67x Exceptions 3–26
C Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–27
Debug options 3–29
Optimize Options 3–29
Fixed-Point Considerations
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1
C6x Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–2
Q-Format Number Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–2
Multiplicative Overflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–5
Accumulative Overflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–10
Saturating the Result 5–11
Use Guard Bits 5–13
Overflow Allowed by Design 5–14
Floating Point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–15
Single Precision 5–15
Double Precision 5–16
Addition 5–16
Adaptive Filters
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–1
Wiener Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–2
Adaptive Wiener Filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–4
Least-Mean-Square Adaptation 9–6
Adaptive Filter Variations 9–8
Adaptive Line Enhancement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–9
C6x Code Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–13
A Two Channel Input Signal + Signal or Signal + Noise Canceller 9–13
Adaptive Line Enhancer 9–18
Communications Applications
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–1
Summary of Factors Relating to Implementation Choices 12–2
Transmitting Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–3
Baseband/IF Transmitter 12–3
Complex Baseband Transmitter 12–6
Practical Pulse Shaping 12–8
Receiving Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–15
Complex Envelope Representation 12–15
Standard I-Q Demodulation 12–16
Using the Hilbert Transform 12–17
System Application: A DSP Based Costas Loop for Coherent Carrier Recov-
ery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–23
MATLAB Simulation 12–28
Real-Time Implementation on the C6711 DSK 12–32
Commercial Receiver Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–42
Reference Frameworks
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13–1
Telecommunications Voice/Speech
1200- to 33 600-bps modems Faxing Speaker verification
Adaptive equalizers Line repeaters Speech enhancement
ADPCM transcoders Personal communications Speech recognition
Cellular telephones systems (PCS) Speech synthesis
Channel multiplexing Personal digital assistants (PDA) Speech vocoding
Data encryption Speaker phones Text-to-speech
Digital PBXs Spread spectrum communications Voice mail
Digital speech interpolation (DSI) Video conferencing
DTMF encoding/decoding X.25 packet switching
Echo cancellation
Background Requirements
• The required background for all students taking the course is
an introductory graduate or junior/senior level undergraduate
course in DSP and experience programming in ANSI C
• Knowledge of ANSI C is required in order to develop real-
time algorithm in a high level language (HLL)
• TMS320C6x assembly and linear assembly language pro-
gramming will be covered in the course
• Eventually, and in practice, we will be using a combination of
C and assembly, e.g., mixed language programming.
• Programming the PC host in C/C++, or perhaps some other
language, may be useful for developing a user interactive
application for the final project
– A MATLAB API (application programming interface) for
the DSK is also available
• Familiarity with test equipment e.g., signal generators, digital
scopes, and a spectrum/network analyzer would be helpful
1–5
Course Perspective
Chapter 1 • Overview of Real-Time Digital Signal Processing
1. Gene A. Frantz, “TI’s DSPS Future,” Texas Instruments DSPS Fest ‘97,
Houston, TX, July 1997.
1980 1990
• We are well beyond the time line shown above, what has
been happening in the last 12 years?
– DSP is definitely mainstream in most everything electronic
– general purpose DSP processors are only part of the pic-
ture; FPGA drives the government/military applications
side, and ARM processors drive the consumer product side
– In the last few years we have seen more multi-core devices
– The open media application platform, OMAP-L138 used
for this course is an example of this
11%
6%
7%
13%
63%
4.7%
8.2% 2.8%
8.5%
72.5%
1–11
Chapter 1 • Overview of Real-Time Digital Signal Processing
C674x fixed- and floating-point DSP core which provides high-precision and wide
dynamic range as well as higher performance, efficiency and low power
Power management software with DVFS to enable various power down modes
Complementary analog products including the TI TPS65070 power management device
with integrated 10-bit, 4-channel ADC, touch screen controller and battery charger
implements all sequencing and default options and supports the devices’ power modes
Object code compatible with all TMS320C67x+™ and TMS320C64x+™devices so
developers can leverage existing software code
Pin-for-pin compatibility (C6742, C6746, C6748 and OMAP-L138) allows for the ability
to expand an entire product portfolio using the same hardware and software platform
The OMAP-L138 applications processor consists of an ARM9 and C674x fixed and
floating point DSP combined with interface options for SATA, Universal Parallel Port
(uPP), Ethernet MAC, USB 2.0HS, USB1.1 FS, Video Input/Output, LCD Controller and
much more.
– Multi-core versions
TMS320C647x Multicore DSPs
Devices Benchmarks
• Industrial/automotive temp
support from -40 to 125 deg C
A Brief History of DSP in the Context of Real-Time Processing
1–15
1–16
DSP DSP + ARM DSP/ARM + Video
• Power-efficient fixed/floating pt DSP • Low power (38mW standby; • High performance multi-format
Chapter 1 • Overview of Real-Time Digital Signal Processing
Featured Product
Implement
Algorithm MIPS
ation
Correlator Hardware 5
Automatic frequency control (AFC) Hardware 5
Automatic gain control (AGC) Hardware 5
Transmit filter Hardware 30
128-pt FFT Software 1
Viterbi decoder (length 9, rate 1/2) Software 6
Vocoder (8-Kbps Qualcomm code Software 20
excited linear prediction (QCELP))
Vocoder (enhanced variable rate coder Software 30
(EVRC))
1. John Groe and Lawrence Larsen, CDMA Mobile Radio Design, Artech
House, Boston, MA, 2000.
1. Craig Marven and Gillian Ewers, A Simple Approach to Digital Signal Pro-
cessing, John Wiley, 1996. ISBN 0-471-15243-9.
Application
Define System
Requirements
Select DSP
Device
Software Hardware
System
Integration
System test
and Debug
• Application Design
– Software design
– Generating assembler source and using C where possible
– Testing the code
– Hardware design
– System integration
Software
• TI integrated development environment Code Composer Stu-
dio; CCS 5.3 Platinum (all cores) which supports TI DSPs
and MSP430 devices
– The above IDE is based Eclipse
• MATLAB release 2012b with the following enhancement for
DSP
– Signal processing toolbox
– DSP System Toolbox, (includes Filter Design Toolbox)
– Fixed-Point Toolbox
– The text supported MATLAB Real-Time Interface (docu-
mentation to be released very soon)
• GoldWave or Audacity shareware for .wav audio file manipu-
lation
Test Equipment
• Agilent two-channel 300 MHz digital scope (2 Gsps)
• Agilent function/arbitrary waveform generators; 15 MHz and
80 MHz models
• Agilent 10 Hz – 500 MHz spectrum/vector network analyzers