You are currently viewing How to process DFT using TMS320C5505

How to process DFT using TMS320C5505

Spread the love

Aim

To perform the DFT process from a given discrete sequence in TMS320C5505 KIT.

Requirements

☞CCS v4

TMS320C5505 KIT

☞USB Cable

☞5V Adapter

Theory

The sequence of N complex numbers x0, …, xN−1 is transformed into another sequence of N complex numbers according to the DFT formula:

It transforms one function into another, which is called the frequency domain representation, or simply the DFT, of the original function (which is often a function in the time domain).

The DFT requires an input function that is discrete. Such inputs are often created by sampling a continuous function, such as a person’s voice. The discrete input function must also have a limited (finite) duration, such as one period of a periodic sequence or a windowed segment of a longer sequence. Unlike the discrete time Fourier transform (DTFT), the DFT only evaluates enough frequency components to reconstruct the finite segment that was analyzed. The inverse DFT cannot reproduce the entire time domain, unless the input happens to be periodic. Therefore it is often said that the DFT is a transform for Fourier analysis of finite-domain discrete-time functions.

Procedure for process DFT using TMS320C5505

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: C5500.

☞Tick Debug And Release. → NEXT → NEXT.

☞Output type: Executable.

☞Device Variant : TMS320C55XX – TMS320C5505.

☞Device Endianness : big

☞Code Generation Tools: TI v4.3.5.

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

☞include 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)    :   5505 OK.

8. FILE ⇒ NEW ⇒ TARGET CONFIGURATION FILE

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

☞Connection: Texas Instrument XDS100 v1 USB Emulator.

☞Device: TMS320C5505. (Tick the TMS320C5505)→ SAVE → TARTGET CONFIGURATION →C55XX_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 TMS320C5505 KIT.

☞Connect the 5v adapter.

☞Power on the kit.

11. TARGET ⇒ DEBUG ACTIVE PROJECT.

12. TARGET ⇒ RUN.(wait few seconds)

13. TARGET ⇒ HALT.

14. Output is displayed at Console Window.

Program

#include

#include

#define

N 4 //number of data values float pi = 3.1416;

float out[2] = {0,0};

short x[N] = {1,1,0,0};

// Change Input for different o/p.

void dft(short *x, short k, float *out);

void main()

{

short j;

for (j = 0; j < N; j++) dft(x, j, out);

//call DFT function

}

void dft(short *x, short k, float *out)

//DFT function

{

float sumRe = 0,sumIm = 0,cs = 0,sn = 0;

int i = 0;

for (i = 0; i < N; i++)

{

cs = cos(2*pi*(k)*i/N);

//real component sn = sin(2*pi*(k)*i/N);

//imaginary component sumRe = sumRe + x[i]*cs;

//sum of real components sumIm = sumIm ­ x[i]*sn;

//sum of imaginary components

}

out[0] = sumRe;

out[1] = sumIm;

printf("%f %f\n",out[0],out[1]);

}

Leave a Reply

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