DSP Lab PDF 16252
DSP Lab PDF 16252
DSP Lab PDF 16252
Laborary exercises
Teo Jrln
November 18, 2010
Preparations:
Before sessions 3, 4, and 5, carry out the preparation exercises in Sections 4.3, 4.4, and 4.5,
respectively.
Deadline for the rst submission is the last session for your group.
Failing to follow any of these deadlines means that you fail the laboratory sessions.
Contents
1 Introduction
2 Equipment
3 General instructions
3.1
3.2
3.3
3.4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Assignments
4.1
4.2
4.3
4.4
Assignment 4: Convolution
4.5
5 Examination
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
4
5
Introduction
The laboratory work aims at illustrating the possibilities given by a digital signal processor.
Concepts from digital signal processing theory is implemented and tested using a Texas Instruments TMS320C5416-160 chip. With this chip comes Code Composer Studio, a software used
to develop code for the TMS320C5416-160 DSP chip. The focus of the laboratory work is not to
develop code, but to get a basic understanding of what can be done with DSP chips in practice.
MATLAB is used to design the lters and an oscilloscope and a function generator is used to
verify the lter properties. The assignments are:
Theory
1. The eect of the sampling frequency.
2. The connection between convolution and amplitude modulation.
3. Distance measurement using correlation analysis in the DSP chip.
Practical
1. FIR lters are examined.
2. IIR lters are examined.
3. A function generator is implemented.
4. Convolution is implemented.
Equipment
A PC running Windows XP with Code Composer Studio installed and a USB interface.
Oscilloscope.
Function generator.
General instructions
Connect the function generator to oscilloscope channel 1. Make sure that the function generator output does not have an amplitude greater than 500 mV peak to peak. If necessary
pull the
AMP
Move the function generator output to the channel 2 line input on the DSP board. Also
connect the channel 2 line input to the oscilloscope to get a clear view of what input signal
is used.
Now connect the USB interface of the DSP board to the computer and the power to the
DSP board.
When the connections in the previous section is done, it is time to start Code Composer
Studio. Choose: FileWorkspaceLoad Workspace and select the workspace le in the
folder you just downloaded.
This will load all the projects used for all the laboratory
assignments.
Right-click on the project corresponding to the assignment to be done and select Make
active project.
To automatically load the program to the DSP board after a successful build, choose:
Now select ProjectRebuild all, if successful the program is loaded onto the DSP board.
For the interested student there is a substantial help library for Code Composer Studio as well
as several guides for the DSP board available through the help menu.
In MATLAB, use
sptool
DSP Lab
folder.
of 8 kHz.
Run
convTOdspFIR.m
assembler code for the DSP board. Note that the lter have to be named
for
convTOdspFIR.m
filt1
in order
to work.
FIR_filter.asm
to the indicated
In MATLAB, use
sptool to design your lter, the DSP board has a sampling frequency of
8 kHz.
Run
convTOdspIIR.m
convTOdspIIR.m
The le
filt1
in order for
to work.
coeff.dat
x-
and
y -coecients,
where
corresponds to
Assignments
In addition it is
For example, the
fc =
600 Hz using
fc =
900 Hz and
200
fc =
or more.
1 kHz.
fc =
fc =
1 kHz.
step_size
the sine table and in that way it aects the output frequency. There is no need to have an input
connected to the DSP board during this exercise.
Preparation exercise
How does the sampling frequency aect the frequencies that can be generated in the DSP board?
Laboratory work
Altering the
step_size
variable in
Func_gen.asm
as the carrier and the function generator supply the information signal. Convolution could be
regarded as digitally implemented amplitude modulation.
Preparation exercise
Describe how convolution is connected to amplitude modulation, especially in the frequency
domain.
Laboratory work
Load the program onto the board and use a sinusoidal input from 50Hz to 2kHz on the channel
2 line input on the DSP board.
1. What is the relation between the function generator frequency and the DSP board output
frequency? Plot how the input frequency relate to the output frequency.
2. We only see one frequency component.
output signal was not ltered? Remove the output lter to verify your answer.
3. Use a square wave as input. Describe what happens and why.
4. Collaborate with another group and connect the output of one DSP board to the input of
another DSP board. Describe what happens.
easily be generated by computers. With aim of Matlab/Simulink, you are able to simulate the
Sampling and Reconstruction process. By completing this assignment, you will understand the
concept of sampling, aliasing and reconstruction.
Preparation exercise
1. Explain the sampling operation by sketching an appropriate diagram.
2. Explain aliasing and how to avoid it.
Laboratory work
Propose and demonstrate the process of Sampling and Reconstruction of a sine wave with
Matlab/Simulink.
Optional: Modulation
Modulation is the process of merging two signals to form a third signal with desirable characteristics of both. Amplitude modulation is one form of analog modulation. The implementation of
amplitude modulation is performed by multiplying two signals, while one of them is a sine-wave
or any other simple wave forms.
Preparation exercise
1. Describe modulation and demodulation.
2. What is the relation between the modulation and convolution?
Laboratory work
Demonstrate Amplitude Modulation and Demodulation by Matlab/Simulink.
Examination
In addition to carrying out the assignments, an individual full technical report for the laboratory
exercises is required to pass the course.
results. The cover page of the report must clearly state your full name and identication code.
The report should be an independent document possible for a person with similar background
as yours to read and understand without having to look elsewhere. It should also be possible to
reproduce similar results by using only the information given in the report. A computer written,
L TEX/MS Word/etc. . . , hard copy of the report is to be handed in on the last laboratory session
for your group. If you need to correct something in the report you will get the report back in
your postbox. You will be notied via e-mail. If your report is approved, you will be notied
via e-mail and the report will be returned in your postbox after the nal deadline for the second
submission. The nal deadline for the second submission is November 2, 2012 at 17:00, meaning
that the postbox for lab reports marked Reports for ELGC03 and ELAD08 in the 21E (oor 3)
corridor will be checked at this time. If you fail to hand in the report before this date and time
you are referred to the next time the course is given.