Вы находитесь на странице: 1из 3

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI

Hyderabad Campus
Digital Signal Processing

Lab 6
(Perform the following using code composer studio and DSK kit)
1.

2.

3.

The TMS 3206713 DSP processor can work as a signal generator. Use CCS and dsp processor to
generate the following signals:
A. Sine wave of frequency 6.5 KHz and amplitude 750 mV peak to peak.
B. Sine wave of frequency 15 KHz and amplitude 750 mV peak to peak.
C. Square wave of frequency 6.5 KHz and 50% duty cycle and amplitude 750 mV peak to peak.
The TMS 3206713 DSP processor can receive an external signal and process it. Perform some
signal processing operation as instructed below:
A. Generate a signal of 4 KHz sine wave and 200mv peak to peak using the function generator.
B. Write a code using CCS to receive the generated signal through line in of the DSP processor
and send out through line out of DSP processor. Observe and note the input and output
voltage(peak to peak) and frequency using CRO. Use the sampling rate of 16 KHz for the DSP
processor.
C. Amplify the signal by an amplification factor of 10 and observe the input and output voltage
and frequency using CRO.
D. Amplify the signal by an amplification factor of 100 and observe the input and output
voltage and frequency using CRO.
E. Compare the output obtained in C and D. Are you getting any distortion? If so explain the
cause of this distortion.
The TMS 3206713 DSP processor can receive an external signal and process it. Perform some
signal processing operation as instructed below:
A. Generate a signal of 4 KHz sine wave and 200mv peak to peak using the function generator.
B. Write a code using CCS to receive the generated signal through line in of the DSP processor
and send out through line out of DSP processor. Observe and note the input and output
voltage(peak to peak) and frequency using CRO. Use the sampling rate of 16 KHz for the DSP
processor.
C. Increase the frequency of the input signal to 5KHz, 6KHz, 7KHz, 8 KHz, 12 KHz and 15 KHz.
Observe the input and output voltage and frequency using CRO. Give your remark on the
output obtained.
D. Now change the sampling rate of the DSP processor to 43.1KHz and observe the input and
output voltage and frequency using CRO for all the frequencies(5KHz, 6KHz, 7KHz, 8 KHz, 12
KHz and 15 KHz).
E. Compare the observations obtained in C, D and comment on the cause of observation
difference obtained.

NB: You are instructed to go through the video in the following link carefully and then
start working for this lab session.
https://www.youtube.com/watch?v=Tou-FEGdz-I
Lab-6

This lab session is prepared by EEE department of BITS Pilani Hyderabad campus to be used in
DSP lab on 1st semester of 2013 and revised on 2014 1st semester.

Procedure to generate a real time sine wave using TMS320C6713 DSK.

1. Connect CRO to the LINE OUT socket.


2.

Now switch ON the DSK and bring up Code Composer Studio on PC

3.

Create a new project with name sinewave.pjt

4. From File menu New DSP/BIOS Configuration Select dsk6713.cdb and


save it as xyz.cdb.
5. Add xyz.cdb to the current project.
6. Create a new source file and save it as sinewave.c.
7. Add the source file sinewave.c to the project.
8. Add the library file dsk6713bsl.lib to the project
(Path: C:\CCStudio\C6000\dsk6713\lib\dsk6713bsl.lib)
9. Copy files dsk6713.h and dsk6713_aic23.h to the Project folder
10. Build (F7) and load the program to the DSP Chip (File Load Program)
11. Run the program (F5).
12. Give an output from the PC and notice the output in the CRO.

CODE for sine wave generation using DSK kit


/*Initialize the board support library first*/
/* BSL call */
#include "xyzcfg.h"
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <stdio.h>
#include <math.h>
float a[100],b;
/* Parameter for the DSK6713 AIC23 Codec */
DSK6713_AIC23_Config config= DSK6713_AIC23_DEFAULTCONFIG;
void main()
{
int i=0;
int f=4000;
/* Codec Handle */
DSK6713_AIC23_CodecHandle hCodec;
DSK6713_init();
/* Start the codec */

Lab-6

This lab session is prepared by EEE department of BITS Pilani Hyderabad campus to be used in
DSP lab on 1st semester of 2013 and revised on 2014 1st semester.

hCodec=DSK6713_AIC23_openCodec(0,&config);
/* Frequency Definitions */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_48KHZ);
for(i=0;i<100;i++)
{
a[i]=sin(2*3.14*f*i/48000);
}
while(1)
{
for(i=0;i<100;i++)
{
b=5000*a[i];
/* Write a 32-bit value to the codec */
while(!DSK6713_AIC23_write(hCodec,b));
while(!DSK6713_AIC23_write(hCodec,b));
}
}
/* Close the codec */
DSK6713_AIC23_closeCodec(hCodec);
}

CODE for receiving external signal and processing using DSK kit
#include"xyzcfg.h"
#include"dsk6713.h"
#include"dsk6713_aic23.h"
DSK6713_AIC23_Config config= DSK6713_AIC23_DEFAULTCONFIG;
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
int l_input,r_input,l_output,r_output;
DSK6713_init();
hCodec=DSK6713_AIC23_openCodec(0,&config);
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_44KHZ);
while(1)
{
while(!DSK6713_AIC23_read(hCodec,&l_input));
while(!DSK6713_AIC23_read(hCodec,&r_input));
l_output=5*(l_input);
while(!DSK6713_AIC23_write(hCodec,l_output));
while(!DSK6713_AIC23_write(hCodec,r_output));
}
DSK6713_AIC23_closeCodec(hCodec);
}

Lab-6

This lab session is prepared by EEE department of BITS Pilani Hyderabad campus to be used in
DSP lab on 1st semester of 2013 and revised on 2014 1st semester.

Вам также может понравиться