EasyManuals Logo

Texas Instruments C28 Series User Manual

Texas Instruments C28 Series
76 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #48 background imageLoading...
Page #48 background image
Function Descriptions
Example:
The following sample code obtains the FIR response to a sample input.
#include FPU.h
#define FIR_ORDER 31
#define SIGNAL_LENGTH (FIR_ORDER + 1)
*
2
*
2
#pragma DATA_SECTION(firFP, "firfilt")
FIR_FP firFP = FIR_FP_DEFAULTS;
#pragma DATA_SECTION(dbuffer, "firldb")
float dbuffer[FIR_ORDER+1];
#pragma DATA_SECTION(sigIn, "sigIn");
#pragma DATA_SECTION(sigOut, "sigOut");
float sigIn[SIGNAL_LENGTH];
float sigOut[SIGNAL_LENGTH];
#pragma DATA_SECTION(coeff, "coefffilt");
float const coeff[FIR_ORDER+1]= FIR_FP_LPF32;
float RadStep = 0.062831853071f;
float RadStep2 = 2.073451151f;
float Rad = 0.0f;
float Rad2 = 0.0f;
float xn,yn;
int count = 0;
void main()
{
unsigned int i;
/
*
FIR Generic Filter Initialisation
*
/
firFP.order=FIR_ORDER;
firFP.dbuffer_ptr=dbuffer;
firFP.coeff_ptr=(float
*
)coeff;
firFP.init(&firFP);
for(i=0; i < SIGNAL_LENGTH; i++)
{
xn=0.5
*
sin(Rad) + 0.5
*
sin(Rad2); //Q15
sigIn[i]=xn;
firFP.input= xn;
firFP.calc(&firFP);
yn = firFP.output;
sigOut[i]=yn;
Rad = Rad + RadStep;
Rad2 = Rad2 + RadStep2; }
}
Sep 10, 2012 48

Table of Contents

Other manuals for Texas Instruments C28 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments C28 Series and is the answer not in the manual?

Texas Instruments C28 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelC28 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals