You are currently viewing Circular Convolution using TMS320F2812 DSP

Circular Convolution using TMS320F2812 DSP

Spread the love

Aim

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

Requirements

☞CCS v3.3

TMS320F2812 KIT

☞ USB Cable

☞5V Adapter

Theory

The circular convolution is also known as cyclic convolution. A convolution operation that contains a circular shift is called circular convolutionCircular convolution of two sequences x1[n] and x2[n] is given by

x1[n]*x2[n] = εk x1[k] x2((n-k))N, 0≤ n ≤N-1

Where k ranges between 0 and N-1

One of the methods to find circular convolution….

In circular convolution the length of the output sequence will be equal to length of the input sequence ie. length(y)=length(x)

So first perform linear convolution using any of the methods u find easier.

If m is the length of ‘x’ and n is the length of the ‘h’ then length of ‘yl’ from linear conv is m+n-1.

Since length of output from circular conv is m, we will bring the last n-1 terms from ‘yl’ and add them to first n-1 terms. So the obtained output is circularly convoluted output.

For eg. if x= 1, 2, 3, 4 and h= 2,3,1 lin conv op ie. yl= 2,7,13,19,15,4

bring last two (n-1) terms to first two terms so circularly convoluted op is yc= 17, 11,13,19

Procedure for build a project on Circular Convolution using TMS320F2812 DSP

Note: Once you install the Code Composer Studio v 3.3 software, the two icons will display in desktop

I. Setup Code Composer Studio v3.3 II. Code Composer Studio

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

b.DSP281x_Headers_nonBIOS.cmd

c.DSP281x_GlobalVariableDefs.c

8. Project >> Add files to project.

a. In file of type : All files

b. Ctrl + Select the following files

☞projectname.c

☞DSP281x_GlobalVariableDefs.c

☞F2812_EzDSP_RAM_lnk.cmd

☞DSP281x_Headers_nonBIOS.cmd >> open.

9.Project >> Build Option.

a.In compiler tab, select Preprocessor

>>  Include search path(-i): C:\tidcs\c28\DSP281x\v120\DSP281x_headers\include

b.In linker tab, select libraries

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

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

c.In linker tab, select Basic

>>   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

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

18.Debug >> Run.

19.Debug >> Halt.

20.See the output at following location,

>>   For example:

1.0x3F9300 – 0x0004

2.0x3F9301 – 0x0004

3.0x3F9302 – 0x0004

4.0x3F9303 – 0x0004

Program for Circular Convolution using TMS320F2812 DSP

void main()
{
        int *in1,*in2,*out,*temp,i,sum=0,j;
        in1 = (int *)0x003F9100;
        in2 = (int *)0x003F9200;
        out = (int *)0x003F9300;
        temp = (int *)0x003F9400; 
        for(i=0;i<4;i++)
        {
                if(i == 1)
                        temp[i+2] = in1[i];
                else if(i == 3)
                        temp[i-2] = in1[i];
                else
                        temp[i] = in1[i];
        }       
        for(i=0;i<4;i++)
        {
                sum = 0;
                for(j=0;j<4;j++)
                {
                        sum+=(in2[j] * temp[j]);
                }      
                out[i] = sum;
                rot(temp);
        }                      
        while(1);
}                      
               
rot(int *x)
{
        int t;
        t = x[0];
        x[0] = x[3];
        x[3] = x[2];
        x[2] = x[1];
        x[1] = t;
} 


Result

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.