You have no items in your shopping cart.

Subtotal: 0.00

# Linear Convolution using TMS320F2812 DSP

LINEAR CONVOLUTION USING TMS320F2812 DSP

###### Aim

To perform the Linear Convolution of two given discrete sequence in TMS320F2812 KIT.

###### Theory

Convolution is a formal mathematical operation, just as multiplication, addition, and integration. Addition takes two numbers and produces a third number, while convolution takes two signals and produces a third signal. Convolution is used in the mathematics of many fields, such as probability and statistics. In linear systems, convolution is used to describe the relationship between three signals of interest: the input signal, the impulse response, and the output signal.

If the input and impulse response of a system are x[n] and h[n] respectively, the convolution is given by the expression,

x[n] * h[n] = ε x[k] h[n-k]

Where k ranges between -∞ and ∞

If,

x(n) is a M- point sequence
h(n) is a N – point sequence
then, y(n) is a (M+N-1) – point sequence.

In this equation, x(k), h(n-k) and y(n) represent the input to and output from the system at time n. Here we could see that one of the inputs is shifted in time by a value every time it is multiplied with the other input signal. Linear Convolution is quite often used as a method of implementing filters of various types.

###### Procedure

1.Open Setup Code Composer Studio v3.3.

2.In System Configuration, select the board then >> Remove all >> yes.

a.In family, select C28xx.

b.In platform, select xds100 usb emulator.

c.In Endianness, select little.

d.Select F2812 XDS100 USB Emulator >> add >> save & quit >>no.

Note: The above two steps only for first time to setup the processor in CCS.

3.Open Code Composer Studio v3.3.

4.Project >> New.

a.Project name: type the project name.

b.Location: Browse, select the project location.

c.Project Type: Executable(.out)

d.Target: TMS320C28XX. >> Finish.

5. File >> New >> Source file.

a.Type the program in untitled window.

6. File >> Save.

a. Browse our project location then type our project name.c ( .c extension is must) >>save.

7. Paste the following two cmd files in our project folder.

a.F2812_EzDSP_RAM_lnk.cmd

c.DSP281x_GlobalVariableDefs.c

8. Project >> Add files to project.

a. In file of type : All files

• Ctrl + Select the following files
• projectname.c
• DSP281x_GlobalVariableDefs.c
• F2812_EzDSP_RAM_lnk.cmd

9.Project >> Build Option.

a.In compiler tab, select Preprocessor

>>Search path(-i): C:\CCStudio_v3.3\C2000\cgtools\lib

>>Incl libraries (-l): rts2800_ml.lib.

>>Stack Size (-stack): 0x400 >> ok.

10.Project >> Build (or) Rebuild all.

11.Connections for TMS320F2812 KIT:

a.Connect 5v adapter to TMS320F2812 KIT.

b.Connect usb cable to TMS320F2812 KIT from pc.

c.Power on the TMS320F2812 KIT

12.Debug >> connect.

13.File >> Load Program >> Browse and select the projectname.out file >> open

14.Debug >> Go main.

15.View >> memory

a.Enter an Address: 0x3F9100 >> Enter.

b.Type the input.

>>For example:

1.0x3F9100 – 0x0001

2.0x3F9101 – 0x0001

3.0x3F9102 – 0x0001

4.0x3F9103 – 0x0001

16.View >> memory

a.Enter an Address: 0x3F9200 >> Enter.

>>For example:

1.0x3F9200 – 0x0001

2.0x3F9201 – 0x0001

3.0x3F9202 – 0x0001

4.0x3F9203 – 0x0001

17.View >> memory

a.Enter an Address: 0x3F9300 >> Enter.

18.Debug >> Run.

19.Debug >> Halt.

20.See the output at following location,

>>For example:

1.0x3F9300 – 0x0001

2.0x3F9301 – 0x0002

3.0x3F9302 – 0x0003

4.0x3F9303 – 0x0004

5.0x3F9304 – 0x0003

6.0x3F9305 – 0x0002

7.0x3F9306 – 0x0001

###### Program

#include<stdio.h>

#define xn 4

#define hn 4

void main()

{

int *x,*h,*y,i,n,k;

x = (int *)0x003F9100;

h = (int *)0x003F9200;

y = (int *)0x003F9300;

for(i=0;i<(xn+hn-1);i++)

{

y[i]=0;

x[xn+i]=0;

h[hn+i]=0;

}

for(n=0;n<(xn+hn-1);n++)

{

for(k=0;k<=n;k++)

y[n] = (y[n]) + ((x[k])*(h[n-k]));

}

while (1);

}

###### Result

Thus, the Linear Convolution of two given discrete sequence has performed and the result is stored at memory location (0x3F9300).