You are currently viewing Linear Convolution using TMS320C6745 DSP

Linear Convolution using TMS320C6745 DSP

Spread the love

Aim

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

Requirements

☞CCS v4

TMS320C6745 KIT

☞USB Cable

☞5V Adapter

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 for build a project on Linear Convolution using TMS320C6745 DSP

1. Open Code Composer Studio v4 .

2. In WorkSpace Launcher.

BROWSE → Select the project location and make one new folder, MAKE NEW FOLDER → Type the Workspace name, OK → OK.

3. FILE ⇒ NEW ⇒ CCS PROJECT

☞Project name: Type your project name.

☞Tick use default location. → NEXT

☞Project type C6000.

☞Tick Debug And Release. → NEXT → NEXT.

☞Output type: Executable.

☞Device Variant : generic – TMS320C6745.

☞Device Endianness : little

☞Code Generation Tools: TI v6.1.12.

☞Run time support library: automatic.

☞Target content: none. →FINISH

4.FILE ⇒ NEW ⇒ SOURCE FILE

☞Source file: Type your projectname.c( .c extension is must ).

☞Type the program.

FILE → SAVE.

5. Paste the following board library files in workspace location.

☞Common folder (contains header files)

☞Gel folder (contains gel file)

☞Library folder(contains library files)

6. Paste the Linker file in the project location.(linker file is available in cd)

Note: Those folders and linker file are availble at cd.

7. PROJECT ⇒ PROPERTIES ⇒ C/C++ BUILD → BASIC OPTION

☞Target processor version(–silicon version, -mv)    :   6400+ OK.

☞IN C/C++ BUILD,  INCLUDE OPTIONS (Add dir to #include search path(–include_path,-I)) select this add icon add-icon and add the following three path by indivdually    –  “${Diag}../../common/header”    –  “${XDAIS_CG_ROOT}/packages/ti/xdais”    –  “${C6000_CSL_CG_ROOT}/include”

8. FILE ⇒ NEW ⇒ TARGET CONFIGURATION FILE

☞file name: projectname. ccxml (.ccxml extension is must)

☞Connection: Texas Instrument XDS100 v1 USB Emulator.

☞Device: TMS320C6745. (Tick the TMS320C6745)→ SAVE → TARTGET CONFIGURATION → C674X_0 → BROWSE, browse the workspace location, open the gel folder and select the GEL file. → OPEN → SAVE.

9. In C/C++ Project window, Right click the project ⇒ REBUILD PROJECT.

10. Connections

☞Connect the usb cable, PC to TMS320C6745 KIT.

☞Connect the 5v adapter.

☞Power on the kit.

11. TARGET ⇒ DEBUG ACTIVE PROJECT.

12. VIEW ⇒ MEMORY.

13. In right side, memory window will open. Type the address and give the input at particular location.

Give the input as follow:

 
X(n)                                   h(n)


0xC0001000 – 00000001         0xC0001030 – 00000001


0xC0001004 – 00000001         0xC0001034 – 00000001


0xC0001008 – 00000001         0xC0001038 – 00000001


0xC000100C – 00000001         0xC000103C – 00000001

14. TARGET ⇒ RUN.

15. TARGET ⇒ HALT.

See the Output at Particular location:

Example:

0xC0001050 – 00000001


0xC0001054 – 00000002


0xC0001058 - 00000003


0xC000105C - 00000004


0xC0001060 - 00000003


0xC0001064 - 00000002


0xC0001068 – 00000001

Program for Linear Convolution using TMS320C6745 DSP


#include
 
#define xn 4
#define hn 4
 
void main()
{
        int *x,*h,*y,i,n,k;
 
        x = (int *)0xc0001000;
        h = (int *)0xc0001030;
        y = (int *)0xc0001050;
 
        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(0xC0001050).

Leave a Reply

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