You are currently viewing DFT 8 Point using TMS320C6745 DSP

DFT 8 Point using TMS320C6745 DSP

Spread the love

Aim

To perform the 8 point DFT process from a given discrete sequence in TMS320C6745 KIT.

Requirements

☞CCS v 4

TMS320C6745 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 to build a project on DFT 8 Point 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 adrress and give the input at particular location.

Give the input as follow:

Enter An Address:0xC0001000  Enter.(Input) X(n)

0xC0001000 – 00000001

0xC0001004 – 00000001 

0xC0001008 – 00000001 

0xC000100C – 00000001

0xC0001010 – 00000001

0xC0001014 – 00000001

0xC0001018 – 00000000

0xC000101C – 00000000

14. View ⇒ Watch window ⇒ watch1.

Type the following array variable.

☞Real_part( real part output)

☞Imag_part( imaginary part output)

15.TARGET ⇒ RUN.

16.TARGET ⇒ HALT.

See the Output at Particular location

Example

Enter An Address:0xC0001030  Enter.(Real part output)

0xC0001030 – 00000006
0xC0001034 – 00000000
0xC0001038 – 00000001
0xC000103C – 00000000
0xC0001040 – 00000000
0xC0001044 – 00000000
0xC0001048 – 00000000
0xC0001048 - 00000000
0xC0001048 – 00000000

Enter An Address:0xC0001050  Enter.(Imaginary part output)

0xC0001030 – 00000000
0xC0001034 – FFFFFFFFF
0xC0001038 – 0000000C
0xC000103C – 00000000
0xC0001040 – 00000000
0xC0001044 – 00000000
0xC0001048 – 00000000
0xC0001048 - 00000001
0xC0001048 – 00000001

17. Or see the ouput at watch window.

Note: watch window will show exact decimal values, processor memory location will show a hexadecimal values.

Program for DFT 8 Point using TMS320C6745 DSP

#include 

#define  PI     3.14159

#define N      8

void main()

{

        int *Input,*Real_out,*Imag_out;

        int i=0,j=0,k=0;

        float real_temp=0,imag_temp=0;

        float Real_part[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};

        float Imag_part[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};

        float teta=0,Real_coeff[64],Imag_coeff[64];

        int n=0,b=0,c=0;

       

        Input = (int *)0xC0001000;

        Real_out = (int *)0xC0001030;

        Imag_out = (int *)0xC0001050;

        for(c=0;c<8;c++)

        {

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

                {

                        teta = ((2 * PI * n * c) / N);         //  c = k in formulae

                        Real_coeff[b] = cos(teta);

                        Imag_coeff[b] = -sin(teta);

                        b++;

                }

        }

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

        {

                real_temp=0;

                imag_temp=0;

                for(j=0;j<8;j++)

                {

                        real_temp += (Input[j] * Real_coeff[k]);

                        imag_temp += (Input[j] * Imag_coeff[k]);

                        k++;

                }

                *(Real_out + i) = real_temp;

                   Real_part[i] = real_temp;

                *(Imag_out + i) = imag_temp;

                   Imag_part[i] = imag_temp;

        }

        while(1);

}

Result

Thus, the 8 point DFT process from a given discrete sequence has performed and the result is stored at memory location(0xC0001030 & 0xC0001050).

Leave a Reply

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