9
DSP Applications and
Student Projects
260
This chapter can be used as a source of experiments, projects, and applications, as
well as Refs. 1 to 4.A wide range of projects have been implemented on the floating-
point C30 and C31 processors [5–20] as well as on the fixed-point TMS320C25
[21–26].They range in topics from communications and controls, to neural networks,
and can be used as a source of ideas to implement other projects. The proceedings
from the yearly conferences, published by Texas Instruments, contain a number of
articles based on the TMS320 family of digital signal processors and can be a good
source of project ideas.Texas Instruments’ Web site contains a list of student projects
covering a wide range of applications that have made it to the final rounds of the TI
“DSP and Analog Design Contest Challenge” (which has a $100,000 first prize).
Chapters 6 and 7 and Appendices D–F can also be useful.
I owe a special debt to all the students who have made this chapter possible.
They include students from Roger Williams University and the University of
Massachusetts–Dartmouth, who have contributed to my general background in DSP
applications, in particular the Worcester Polytechnic Institute (WPI) students in my
graduate course “Real-Time DSP,” based on the C6x: Y. Bognadov, J. Boucher, G.
Bowers, D. Ciota, P. DeBonte, B. Greenlaw, S. Kintigh, R. Lara-Montalvo, M. Mellor,
F. Moyse, A. Pandey, I. Progri, V. C. Ramanna, P. Srikrishna, U. Ummethala, L. Wan.
A brief discussion of their projects (and some miniprojects) are included in this
chapter. Two projects on adaptive filtering and graphic equalizers were discussed in
Chapters 6 and 7.
9.1 VOICE SCRAMBLER USING DMA AND USER SWITCHES
(scram16k_sw)
The project scram16k_sw (on the accompanying disk) is an extension of Example
4.9, making use of the three dip switches, USER_SW1 through USER_SW3 (the
DSP Applications Using C and the TMS320C6x DSK. Rulph Chassaing
Copyright © 2002 John Wiley & Sons, Inc.
g. 1 0 0 Loop program
scram8k_DMA
The alternative project scram8k_DMA (on the disk) implements the voice scram-
bling scheme using DMA, sampling at 8kHz. It is adapted from the example
codec_edma included with the DSK package. It illustrates the use of DMA with
options within the program to inplement either a loop program, a filter, or the voice
scrambling scheme (without up-sampling).
9.2 PHASE-LOCKED LOOP
The PLL project implements a software-based linear phase-locked loop (PLL). The
basic PLL causes a particular system to track another PLL. It consists of a phase
detector, a loop filter, and a voltage-controlled oscillator. The software PLL is more
versatile. However, it is limited by the range in frequencies that can be covered,
since the PLL function must be executed at least once every period of the input
signal [27–29].
Initially, the PLL was tested using MATLAB, then ported to the C6x using C.
The PLL locks to a sine wave, generated either internally within the program or
from an external source. Output signals are viewed on a scope or on a PC using
DSP/BIOS’s real-time data transfer (RTDX).
Figure 9.1 shows a block diagram of the linear PLL, implemented in two
versions:
1. Using an external input source, with the output of the digitally controlled
oscillator (DCO) to an oscilloscope
Phase-Locked Loop
261
262
DSP Applications and Student Projects
2. Using RTDX with an input sine wave generated from a lookup table and
various signals viewed using Excel
The phase detector, from Figure 9.1, multiplies the input sine wave by the square-
wave output of the DCO. The sum and difference frequencies of the two inputs to
)
Loop filter
(F(s), K
a
)
u
d
u
1
, w
1
, φ
1
u
f
Digitally
controlled
oscillator (K
0
)
RTDX
target
interface
PC
Excel
VB macro
OLE
CCS
R
high-band bits are multiplexed and the result is 8 bits sampled at 8kHz, for a bit
rate of 64kbits/s. Figure 9.2 shows a block diagram of a SB-ADPCM encoder.
Transmit Quadrature Mirror Filter
The transmit quadrature mirror filter (QMF) takes a 16-bit audio signal sampled
at 16kHz and separates it into a low band and a high band. The filter coefficients
represent a 4-kHz lowpass filter. The sampled signal is separated into odd and even
samples, with the effect of aliasing the signals from 4 to 8kHz. This aliasing causes
the high-frequency odd samples to be 180 degrees out of phase with the high-
frequency even samples. The low-frequency even and odd samples are in-phase.
When the odd and even samples are added, after being filtered, the low-frequency
FIGURE 9.2. Block diagram of ADPCM encoder.
Higher subband
ADPCM encoder
Lower subband
ADPCM encoder
Transmit
quadrature
mirror filters
X
in
– 16 bits
at 16 kHz or
256 kbits/s
X
out
– 8 bits
at 8 kHz or
64 kbits/s
16 bits
at 8 kHz or
also confirmed successful results from the decoder.
9.4 ADAPTIVE TEMPORAL ATTENUATOR
An adaptive temporal attenuator (ATA) suppresses undesired narrowband signals
to achieve a maximum signal-to-interference ratio. Figure 9.4 shows a block diagram
of the ATA. The input is passed through delay elements, and the outputs from
selected delay elements are scaled by weights. The output is
where m is a weight vector, r a vector of delayed samples selected from the input
signal, and N the number of samples in m and r. The adaptive algorithm computes
the weights based on the correlation matrix and a direction vector:
where C is a correlation matrix, D a direction vector, and l a scale factor. The
correlation matrix C is computed as an average of the signal correlation over several
samples:
CmDkk,dl=
[]
◊
[]
=0
yk k k i
T
i
i
N
[]
=◊
[]
=◊-
[]
()
where P
d
is the power of the signal desired.
MATLAB is used to simulate the ATA, then ported to the C6x for real-time
implementation. Figure 9.5 shows the test setup using a fixed desired signal of
1416Hz and an undesired signal of 1784 Hz (which can be varied). From MATLAB,
an optimal value of t is found to minimize UDR. This is confirmed in real time, since
for that value of t (varying t with a GEL file), the undesired signal (initially dis-
played from an HP3561A analyzer) is greatly attenuated.
9.5 IMAGE PROCESSING
This project implements various schemes used in image processing:
UDR
total
==
[]
◊
[]
◊
[]
[]
◊
()
=
[]
◊
()
P
P
kk k
Pk
[]
=
[]
ƒ-
[]
()
=
-
Â
1
0
1
AV
FIGURE 9.4. Block diagram of adaptive temporal attenuator.