Real-Time DSP for Educators
-
Upload
thiago-henrique-deicke -
Category
Documents
-
view
219 -
download
0
Transcript of Real-Time DSP for Educators
-
8/12/2019 Real-Time DSP for Educators
1/48
-
8/12/2019 Real-Time DSP for Educators
2/48
Agenda
Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering Signal Generation
Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
3/48
Motivation
Do you teach or want to teach a DSPcourse?
Do you use MATLAB exercises in yourcourses?
Do you assign exercises that work with
actual signals (not generated in MATLAB)? Do you include real-time DSP
demonstrations in your courses?
Do you assign real-time projects?
-
8/12/2019 Real-Time DSP for Educators
4/48
Real-time DSP It can be a real struggle to get started with
real-time DSP
Lots of details come up that just arent an issue
when programming in a workstation environment
Documentation is written for experts
Learning curve is steep, if not vertical!
Few understandable examples are available Complexity is the norm
On-line and seminar style training is available
directly from TI and the third party vendors But, most of this training is not appropriate for the
typical student (or educator) due to at least one of
the following issues
-
8/12/2019 Real-Time DSP for Educators
5/48
Typical Training Issues Not meant for educators Our first courses should motivate our students to
learn more about real-time DSP
Much of the industry does not do sample-by-
sample DSP, despite the fact that few teach
anything else
Meant for DSP experts Expects significant familiarity with DSP system
design
Intended for engineers transitioning from otherDSP targets
Usually introducing the latest innovations and
technologies, not fundamentals
-
8/12/2019 Real-Time DSP for Educators
6/48
-
8/12/2019 Real-Time DSP for Educators
7/48
The DSP Big Picturey[n] = ...
differenceequation
H(z)transferfunction
H(ej)frequencyresponse
h[n]impulse
response
pole/zerodiagram
blockdiagram
-
8/12/2019 Real-Time DSP for Educators
8/48
The Real-time DSP Big Picturey[n] = ...
differenceequation
H(z)transferfunction
H(ej)frequencyresponse
h[n]impulse
response
pole/zerodiagram
blockdiagram
real-time
implementation
-
8/12/2019 Real-Time DSP for Educators
9/48
DSP of Analog Signals
antialiasingfilter
sampleandhold
DSPdigital
to analogconverter
analog todigitalconverter
reconstructionfilter
analogworld
analogworld
-
8/12/2019 Real-Time DSP for Educators
10/48
-
8/12/2019 Real-Time DSP for Educators
11/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering Signal Generation
Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
12/48
Hardware Discussion
Lets unpack our DSKs
Look at what comes in your box
Note that like many USB devices, the
hardware installation comes AFTER thesoftware installation
A quick tour of the board
-
8/12/2019 Real-Time DSP for Educators
13/48
DSK Overview
TMS320C6713 DSP at 225MHz
TLV320AIC23 stereo codec Microphone & line inputs
Headphone & line outputs
Uses both McBSPs We configure for 16-bits at 48KHz
16MB SDRAM / 512KB Flash memory
Onboard USB-based JTAG emulator 4 DIP switches & 4 LEDs (user controlled)
-
8/12/2019 Real-Time DSP for Educators
14/48
DSK Overview (continued) Three daughtercard connectors
J1 HPI interface
New to the C6713 DSK Used by the Educational DSP HPI daughtercard
Direct DSP control from a host computer
DSP can use daughtercard for communications (USB/RS-
232), digital I/O, and analog inputs
J3 Peripheral Interface
McBSPs, Timers
J4 EMIF (parallel memory bus)
SDRAM, Flash Memory
Many EVMs and daughtercards are available
from TI and others
-
8/12/2019 Real-Time DSP for Educators
15/48
TI TMS320C6713 DSK
-
8/12/2019 Real-Time DSP for Educators
16/48
TI TMS320C6713 DSK
-
8/12/2019 Real-Time DSP for Educators
17/48
DSK w/ HPI Daughtercard
-
8/12/2019 Real-Time DSP for Educators
18/48
Software Installation Quick Start Installation Guide
CCStudio software installation
Follow the CDs instructions
Do not attempt to register the software at this time
Be sure to install both CCStudio 3.1 and the C6713 DSK target
content. Leave the CD in after the install finishes and then connect the
DSK to install the USB driver.
Note that there are two CCStudio icons on the Desktop
The C6713 icon will automatically import the DSK into CCStudio. winDSK6
A quick look at the contents of the textbook CD-ROM
-
8/12/2019 Real-Time DSP for Educators
19/48
-
8/12/2019 Real-Time DSP for Educators
20/48
Our Software Organization All software is interrupt-driven
All configuration code is contained in acommon_code directory
All applications are designed to run on both the
C6713 DSK and the TMS320C6711 DSK (withthe onboard codec and several codec
daughtercards)
A single #define selects the proper software toconfigure the codec, the input source, and the
sampling rate
-
8/12/2019 Real-Time DSP for Educators
21/48
A Basic Application(Talk-through)
-
8/12/2019 Real-Time DSP for Educators
22/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation
Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
23/48
The CCStudio Project Big Picture Open CCStudio Create a project
Be aware of what directory you are in, especially ifyou then navigate somewhere within CCStudio
Add files to the project directory
Add files to project Our code is interrupt driven, so most work today
will be done on isrs.c
Setup the compiler options
Build the project Load the project
Run the project
-
8/12/2019 Real-Time DSP for Educators
24/48
-
8/12/2019 Real-Time DSP for Educators
25/48
CCStudio Observations Does the talk-through program work? You can run or halt the program at
anytime and you dont need to reload
You can establish a watch window by
highlighting and right-clicking on thevariable that you selecting, then selecting
Add to Watch Window
Watched variables can be modified whilethe program is running (if they are in
scope)
-
8/12/2019 Real-Time DSP for Educators
26/48
A Few Comments Watch window(s)
Make sure that you are in scope
The volatile keyword
Function prototypes and return types
ISRs and the run-time schedule Sample-by-sample processing
Gain adjustments (volume control)
Hello, world can we print to the host PC?
Turning the user LEDs on and off
-
8/12/2019 Real-Time DSP for Educators
27/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation
Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
28/48
FIR Filtering FIR filters are the most popular type of
digital filter Always stable
Easy to design Easy to ensure linear phase response
Require more coefficients for same roll off
compared to IIR filters
-
8/12/2019 Real-Time DSP for Educators
29/48
FIR Filter
z-1
z-1
z-1
z-1
+
+
+
+
x[n] y[n]b0
b1
b2
b3
b4
x[n-1]
x[n-2]
x[n-3]
x[n-4]
-
8/12/2019 Real-Time DSP for Educators
30/48
FIR Difference Equation
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ] [ ] [ ]
0
0
[ ] *
[ ] *
0
0 0 0 1 1
k
N
k
N
k
y n h k x n k h n x n
y n b k x n k b n x n
y b k x k
y b x b x b N x N
=
=
=
= =
= =
=
= + + +
L
-
8/12/2019 Real-Time DSP for Educators
31/48
FIR Difference Equation (cont)
[ ] [ ] [ ] [ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ] [ ] [ ]
0 0 0 1 1
but we can modify the indices
0 0 0 1 1
y b x b x b N x N
y b x b x b N x N
= + + +
= + + +
L
L
-
8/12/2019 Real-Time DSP for Educators
32/48
CCStudio Implementation Local declaration
Declare the b coefficients in the ISR Cut-and-paste can also work
Additional files (e.g., coeff.c and coeff.h)
Great for large filters
But do you really want to type in all of those
coefficients by hand?
Create the files directly from MATLAB
FIR_dump2c.m
-
8/12/2019 Real-Time DSP for Educators
33/48
Sptool Startup GUI
-
8/12/2019 Real-Time DSP for Educators
34/48
Fdatool Startup GUI
-
8/12/2019 Real-Time DSP for Educators
35/48
More FIR a few ideas Flanging
Chorus Circular buffering
Echo creation Other FIR filter forms
e.g., second order sections
Impulse modulator digital transmitter
-
8/12/2019 Real-Time DSP for Educators
36/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
R l ti W f
-
8/12/2019 Real-Time DSP for Educators
37/48
Real-time Waveform
Generation Your mission generate a 1 kHz sinusoid
Some ways to do it
VOUT = VMAXsin(2ft)
Calculate directly as a function of t
Calculate as a function of the desired signal phase
Use lookup table to obtain sine values, use index as phase
accumulator
Use complex vector rotation
Use a digital resonator
May want to glance at textbook Modify your talk-through application as necessary create
a sinusoid generator
-
8/12/2019 Real-Time DSP for Educators
38/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
39/48
Intro to DSP/BIOS Software
Kernel Foundation DSP/BIOS kernel is a lean real-time operating
system (RTOS) specific to the TI DSPs
There are advantages and disadvantages tointroducing it into an academic setting
Follow Appendix B of your textbook Section B.1 Introduction
Section B.2 Exercise in using threads Can come back to this if you have time & desire
Section B.5 Talk-through on the C6713 DSK
This is equivalent to the earlier tutorial, but in a DSP/BIOSenvironment
Text for cut-and-paste is on your CD-ROM
-
8/12/2019 Real-Time DSP for Educators
40/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
41/48
eDSP DSK6713HPI Daughtercard Host Services
Using a host PC to control the DSK without CCStudio
winDSK6
MATLAB Interfaces (data acquisition and real-time control)
DSK6X_Control for host application development
DSP Services
The DSP software can use the daughtercard resourcesas well
USB and RS-232 communications
Up to 16 digital I/O pins
Up to 8 analog inputs
Software interface is already provided simple function
calls are used to access all resources
-
8/12/2019 Real-Time DSP for Educators
42/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
43/48
Individual Project Time Have at it!
Feel free to ask questions
A d
-
8/12/2019 Real-Time DSP for Educators
44/48
Agenda Introduction
Motivation
DSK and Software Installation
Building Real-Time DSP Applications
Software Organization
Building a CCStudio Talk-Through Application
FIR Filtering
Signal Generation Advanced Topics
DSP/BIOS Application
HPI Daughtercard (DSP Services/Host Services)
Individual Projects
Wrap-Up
-
8/12/2019 Real-Time DSP for Educators
45/48
Wrap-Up The DSK development environment isfairly easy to use once you know how!
Practice making your own CCStudioprojects
Mikes software page has lots of software
for the C6713 and older DSKs http://eceserv0.ece.wisc.edu/~morrow/software/
For more information on the HPI daughtercard
see the Educational DSP website http://www.educationaldsp.com
-
8/12/2019 Real-Time DSP for Educators
46/48
Real-Time DSP for Educators
Michael Morrow ([email protected])
University of Wisconsin-Madison
Thad Welch ([email protected])
United States Naval Academy
Cameron Wright ([email protected])University of Wyoming
-
8/12/2019 Real-Time DSP for Educators
47/48
References [1] TMS320C6713 DSK Technical
Reference, Spectrum Digital, Jan. 2004 [2] Digital Signal Processing, a
computer-based approach, Sanjit K.
Mitra, McGraw Hill, 2001 [3] Real-time Digital Signal Processing
from MATLAB to C with the
TMS320C6X, Thad B. Welch,Cameron H. G. Wright, Michael G.Morrow, CRC Press, 2006
-
8/12/2019 Real-Time DSP for Educators
48/48