# FIR Lowpass Filter using TMS320C6745 DSP

## FIR Lowpass Filter using TMS320C6745 DSP

Tags: FIR Low pass filter implementation using dsp, FIR implementation using Tms320c6745 dsp, FIR low pass filter demo in dsp processor , FIR low pass filter design,
Overall rating
###### Aim

To Implement the FIR Low pass filter using TMS320C6745 KIT.

###### Requirements

• CCS v4
• TMS320C6745 KIT
• USB Cable

###### Theory

In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of finite duration, because it settles to zero in finite time. This is in contrast to infinite impulse response (IIR) filters, which may have internal feedback and may continue to respond indefinitely (usually decaying).

The impulse response of an Nth-order discrete-time FIR filter (i.e., with a Kronecker delta impulse input) lasts for N + 1 samples, and then settles to zero.

The output y of a linear time invariant system is determined by convolving its input signal x with its impulse response b.

For a discrete time FIR filter, the output is a weighted sum of the current and a finite number of previous values of the input. The operation is described by the following equation, which defines the output sequence y[n] in terms of its input sequence x[n]:

where:

x[n] is the input signal,

y[n] is the output signal,

bi are the filter coefficients, also known as tap weights, that make up the impulse response,

N is the filter order; an N th-order filter has( N + i) terms on the right-hand side. The x[n] in these terms are commonly referred to as taps, based on the structure of a tapped delay line that in many implementations or block diagrams provides the delayed inputs to the multiplication operations. One may speak of a 5th order/6-tap filter, for instance.

###### Procedure

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 and add the following three path by indivdually
-  "\${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.
• Power on the kit.

11. TARGET ⇒ DEBUG ACTIVE PROJECT.

12. TARGET ⇒ RUN.(wait few seconds)

13. Output is displayed at Console Window.

14. TARGET ⇒ HALT.

###### Program

// ideal low pass filter

#include<stdio.h>

#include<math.h>

#define PI 3.14

void main()

{

const int sampf=10000;

const int cutf=1000;

float value,a,b,output;

int nyqf,n,c0;

int *coeff;

coeff = (int *)0xc0001000;

nyqf=sampf/2;

c0=cutf/nyqf;

for(n=-5;n<6;n++)

{

if(n==0)

{

output = 0.5;

}

else

a = (n * PI)/2;

b = n * PI;

value = sin(a);

output = value/b;

printf("\n  The Fir Low pass filter coefficient : %f",output);

}

}

###### Result

Thus, the FIR Low pass filter was Implemented and displayed the results in console window.