dspfolder
dspfolder
1.A)
Input:
a=0x12DE01AB;
b=0x340A1CDA;
Output:
c=1189617285
c=46e81e85
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for addi on opera on.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the final
output of the program.
7.) Output answer will be displayed in the console window.
Result:
The 32-bit addi on opera on on TMS320C6748 DSP processor is performed and the result is
been obtained and displayed.
1.B)
Aim: To perform 32-bit mul plica on opera on on TMS32006748 using CCS.
So ware used: Code Composer Studio
Components used: TMS320C6748 Processor Kit
Theory:
The 32-bit data registers are used for arithme c logical and other opera ons. It can store
2^32 values and it can be stored in 32 bits depends on the integer representa on used. i.e
4GB of RAM or physical memory ideally it can access more than 4GB of RAM also. In 32-bit
mul plica on the result raise to 32 mul plied by 2 raised to 32 is equal to 2 raised to 64.
When you mul ply two integers together the result is an integer twice as long. 32 bits x 32
bits = 64 bits of result. The main idea is to split a 32bit unsigned value into two parts: the
upper 16 bits (value with base 216) and the lower 16 bits.
#include<math.h>
int main(void)
{
long a=0x12345678;
long b=0x98765432;
long c=a*b;
prin ("mul":%x",c);
return 0;
}
Input: a=0x12345678
b=0x98765432
Output: mul:d5e84370
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for addi on opera on.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the final
output of the program.
7.) Output answer will be displayed in the console window.
Result:
The 32-bit mul plica on opera on on TMS320C6748 DSP processor is performed and the
result is been obtained and displayed.
1.C)
Aim To generate the sine wave using TM320C6748 processor.
So ware used: Code Composer Studio
Components used: TMS320C6748 Processor Kit
Theory:
A sine wave, sinusoidal wave, or just sinusoid is a mathema cal curve defined in terms of
the since trigonometric func on. Sine wave creates a sine wave object that generates a real -
valued sinusoid with an amplitude of 1, a frequency of 100Hz, and a phase offset of 0. By
default, the sine wave object generates only one sample.
The simplest method to generate Sine wave is to use Trigonometric Sin func on. The Sin
func on will generate the samples from our specific parameter like sampling frequency,
number of samples, input frequency. In this project, genera ng the correct sample is
important. The library func on "sin()" does all of the work.
Its most basic form as a func on of me (t) is: where:
A, the amplitude, is the peak devia on of the func on from its centre posi on,
W, the angular frequency, specifies how many oscilla ons occur in a unit me interval, in
radians per second
The phase, specifies where in its cycle the oscilla on begins at t = 0.
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for mul plica on opera on.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the values for
plot.
7.) Next go to (Tools > Graph> Single me) and then keep the DSP Data type as 32 bit floa ng
point and start address "a" and click Ok.
8.) Sine Wave Graph will be obtained.
Screenshots:
Result:
Generated the sine wave using TMS320C6748 processor using CCS.
EXPERIMENT 02
2.A)
Aim: To perform linear convolu on of given discrete me sequences on TMS320C6748
using CCS.
for (i=0;i<n;i++)
{
for (j=0;j<m;j++)
{
y[i+j]+=x[i]*h[j];
}
}
}
int main()
{
int i;
int x[]={1,2,3,4};
int h[]={1,2,3};
int n=sizeof(x);
int m=sizeof(h);
int length=n+m-1;
int y[length];
linear_conv(x,h,y,n,m);
prin ("Linear convolu on result :\n");
for (i=0;i<length;i++)
{
prin ("y[%d]=%d ",i,y[i]);
}
return 0;
}
Input:
x={1,2,3,4};
h={1,2,3};
Output:
y[0]=1 y[1]=4 y[2]=10 y[3]=16 y[4]=17 y[5]=12
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for circular convolu on.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the values for
plot.
7.) Next go to (Tools > Graph> Single me) and then keep the DSP Data type as 32 bit floa ng
point and start address "a" and click Ok.
8.) Graph will be obtained.
Screenshots:
Result:
Performed Linear convolu on of the given discrete me sequences on the DSP
Processor TMS320C6748.
2.B)
Aim: To perform circular convolu on of given discrete me sequences on TMS320C6748
using CCS.
Input:
x={2,1,2,1};
h={1,2,3,4};
Output:
14 16 14 16
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for circular convolu on.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the values for
plot.
7.) Next go to (Tools > Graph> Single me) and then keep the DSP Data type as 32 bit floa ng
point and start address "a" and click Ok.
8.) Graph will be obtained.
Screenshots:
Result:
Performed Circular convolu on of the given discrete me sequences on the DSP
Processor TMS320C6748.
EXPERIMENT 03
3.A)
Aim: To compute Discrete Fourier Transform (DFT) of given discrete me sequence on
TMS320C6748 using CCS.
int k, n, N;
float M_PI = 3.14;
prin ("%d\n",1234);
N = 4;
Input:
N = 4;
X = {1,2,3,4,5,6}
Output:
(21.000000) + j(0.000000)
(21.000000) * (0.000000)
(3.000006) + j(-3.999995)
(5.000000) * (-53.156960)
(-3.000000) + j(-0.000012)
(3.000000) * (0.000225)
(2.999980) + j(4.000014)
(4.999999) * (53.157322)
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for DFT of given discrete me
sequence.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the values for
plot.
7.) Next go to (Tools > Graph> Single me) and then keep the DSP Data type as 32-bit
floa ng point and keep start address as amp > buffer [50] and change line to bar and click
Ok.
8.) Graph will be obtained.
Screenshots:
Result:
The Discrete Time Fourier Transform of given signal is performed on DSP processor and
output is displayed
B)
Aim: To compute Discrete Fourier Transform (DFT) Of given Sinusoidal signal on DSP
processor or using CCS.
Xr[k] = 0;
Xi[k] = 0;
for (n = 0; n < len; n++) {
Xr[k] = (Xr[k] + xn[n] * cos(2 * 3.141592 * k * n / N));
Xi[k] = (Xi[k] - xn[n] * sin(2 * 3.141592 * k * n / N));
Y[k] = atan(Xi[k]/Xr[k]);
Y[k] = Y[k]*(180.0/M_PI);
amp[k] = sqrt(Xi[k]*Xi[k]+Xr[k]*Xr[k]);
}
Input:
N = 16
Output:
(0.008364) + j(0.000000)
(0.008364) * (0.000000)
(-5.784098) + j(-5.679466)
(8.106301) * (44.499611)
(-1.273731) + j(0.023066)
(1.273940) * (-1.037984)
(-0.258751) + j(0.279616)
(0.380969) * (-47.243336)
(0.007943) + j(-0.008366)
(0.011536) * (-46.512207)
(-0.121295) + j(-0.123734)
(0.173270) * (45.593250)
(-0.194215) + j(0.003391)
(0.194245) * (-1.000654)
(-0.080745) + j(0.090318)
(0.121149) * (-48.227493)
(0.007953) + j(0.000006)
(0.007953) * (0.041017)
(-0.080733) + j(-0.090317)
(0.121140) * (48.231579)
(-0.194215) + j(-0.003404)
(0.194245) * (1.004559)
(-0.121311) + j(0.123733)
(0.173281) * (-45.589252)
(0.007942) + j(0.008389)
(0.011552) * (46.592319)
Procedure:
1.) Connect TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for crea ng a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then
click on finish op on.
4.) Main.c file opens and here need to write the code for DFT of given discrete me
sequence.
5.) Next, to get the output from the code we need to first debug the code by clicking on the
debug op on a er debugging we need to build the project as last step.
6.) A er we finish building the project then we need to run the project to get the values for
plot.
7.) Next go to (Tools > Graph> Single me) and then keep the DSP Data type as 32-bit
floa ng point and keep start address as amp > buffer [50] and change line to bar and click
Ok.
8.) Graph will be obtained.
Screenshots:
Result:
The Discrete Time Fourier Transform of given sinusoidal signal is performed on DSP
processor and output is displayed