You are currently viewing How to process IDFT using TMS320C5505

How to process IDFT using TMS320C5505

Spread the love

Aim

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

Requirements

☞CCS v4

TMS320C5505 KIT

☞USB Cable

☞5V Adapter

Theory

The algorithm for ifft(X) is the same as the algorithm for fft(X), except for a sign change and a scale factor of n = length(X). As for fft, the execution time for ifft depends on the length of the transform. It is fastest for powers of two. It is almost as fast for lengths that have only small prime factors. It is typically several times slower for lengths that are prime or which have large prime factors.

FFT algorithms can be used to compute an inverse DFT without any change in algorithm. The inverse DFT of an N-point sequence X(k) , k = 0,1, 2, . . . . ., N-1 is defined as

Where,

Procedure for process IDFT 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 to few seconds)

13. TARGET ⇒ HALT.

14. Output is displayed at Console Window.

Program

#include 
#define N	4					// no of point
#define	W0	1					// twiddle factors 
#define W1r	0
#define W1i -1
float Xr[N] = { 10,-2,-2,-2};	// enter the real part value 
float Xi[N] = {  0,-2, 0, 2};	// enter the img value in reverse polarity
float xr[4],xi[4],s1r[4],s1i[4],s2r[4],s2i[4],tempr[4],tempi[4];
int i=0;
void Bit_Reversal();
void main()
{
	Bit_Reversal();
// stage one
	s1r[0] = xr[0] + xr[1];
	s1i[0] = xi[0] + xi[1];
	
	s1r[1] = xr[0] - xr[1];
	s1i[1] = xi[0] - xi[1];
	
	s1r[2] = xr[2] + xr[3];
	s1i[2] = xi[2] + xi[3];
	
	s1r[3] = xr[2] - xr[3];
	s1i[3] = xi[2] - xi[3];
	
// final stage
	s2r[0] = s1r[0] + s1r[2];
	s2i[0] = s1i[0] + s1i[2];

		tempr[0] = (s1r[3] * W1r) - (s1i[3] * W1i);
		tempi[0] = (s1r[3] * W1i) + (s1i[3] * W1r);
	s2r[1] = s1r[1] + tempr[0];
	s2i[1] = s1i[1] + tempi[0];
	
	s2r[2] = s1r[0] - s1r[2];
	s2i[2] = s1i[0] - s1i[2];
	
	s2r[3] = s1r[1] - tempr[0];
	s2i[3] = s1i[1] - tempi[0]; 
	printf("Real & Imaginary");
	for(i=0;i<4;i++)
	{
		printf("\n%f    %f",s2r[i],s2i[i]);
	}

}
void Bit_Reversal()
{
	xr[0] = Xr[0];
	xi[0] = Xi[0];
	xr[1] = Xr[2];
	xi[1] = Xi[2];
	xr[2] = Xr[1];
	xi[2] = Xi[1];
	xr[3] = Xr[3];
	xi[3] = Xi[3];
}

Leave a Reply

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