Other Parts Discussed in Thread: CONTROLSUITE
Dear all,
I m using a FIR32 based on the FPU FIR example provided by TI. I can't get it to work properly :
I get my coeff from MATLAB using :
f = [[0 0.48 0.50 0.52 0.54 1]];
a = [0 0 1 1 0 0];
b = firpm(63,f,a);
I use the coeff from b, at the startup :
coeff[0]= 0.051547096527528f;
coeff[1]= 0.020357831058088f;
coeff[2]= -0.031441262081694f;
coeff[3]= 0.009811624113904f;
coeff[4]= 0.009698354038584f;
...
...
coeff[59]= 0.009698354038584f;
coeff[60]= 0.009811624113904f;
coeff[61]= -0.031441262081694f;
coeff[62]= 0.020357831058088f;
coeff[63]= 0.051547096527528f;
firFP.order=FIR_ORDER;
firFP.dbuffer_ptr=dbuffer;
firFP.coeff_ptr=(float *)coeff;
firFP.init(&firFP);
then I used the filter on a 8192 SIN signal to be sure it works properly. I use the View/graph tool to
figure out the shape of my signal :
for (j=0; j<8192; j++)
{
//10kHz signal, 600Khz sampling
firFP.input = (float)sin(2.0 * 3.14159265358979 * (10000.0/600000.0) * j);
firFP.calc(&firFP);
g_AdcTraitement[j] = (float)firFP.output;
}
I do the following stuff as well:
#pragma DATA_SECTION(g_AdcTraitement,"AdcTraitement");
float g_AdcTraitement[8192];
#pragma DATA_SECTION(firFP, "firfilt")
FIR_FP firFP = FIR_FP_DEFAULTS;
/* Define the Delay buffer for the 64th order filter and place it in "firldb" section */
#pragma DATA_SECTION(dbuffer, "firldb")
float dbuffer[64];
/* Define Constant Co-efficient Array and place the constant section in RAM memory */
#pragma DATA_SECTION(coeff, "coefffilt");
float coeff[64];
firfilt align(0x200) > RAML5, PAGE = 1
firldb align(0x200) > RAML4, PAGE = 1
coefffilt align(0x200) > RAML6, PAGE = 1
On Matlab, it works grand, i.e. the frequency around 150Khz are passed, the others not.
On the F28335 they are all passed and are amplified : the input signal is between -1.0 and +1.0,
the output is between -1.7e+5 and +1.7e5.
Any idea of what I am doing wrong ????.
thanks a lot to anybody's idea, I am stucked !
greg.