2013-09-25 04:53 AM
Hi,
I am using the DSP Library to make a Fir Filter with STM32F407 and uvision4. The example work fine and the data is right comparing with matlab. Now I am trying to make it work in a real time application. So I use a circular buffer as input for the function and a DC sinal as data. The sequency is: Obtain a sample, move it to circular buffer and execute thearm_fir_f32 function. I wanna know if this steps are right for a real time filter and I dont understand what is my output because the ''outputF32'' is a buffer with 32 numbers half of it is almost zero.void Circular_Buffer(float p, float buffer[BUFFER_SIZE+1]){
int x = BUFFER_SIZE;
while(x>0){
buffer[x] = buffer[x-1];
x--;
}
buffer[0] = p;
}
==================================================================================
====================================FIR FILTER=======================================
==================================================================================
Circular_Buffer(Analog_Input,Filtro_FIR);
inputF32 = &Filtro_FIR[0];
outputF32 = &testOutput[0];
arm_fir_init_f32(&S, NUM_TAPS, (float32_t *)&firCoeffs32[0], &firStateF32[0], blockSize);
arm_fir_f32(&S, inputF32, outputF32, blockSize);
Here is my output data and my input buffer:
2013-09-25 10:22 AM
Now i realized that variable ''
blockSize
'' is the size of the output.When I put it in value 1 the answer is always arround -0.0028 :(2013-09-26 05:37 AM
I put the output buffer from position 16 to 32 into a DAC and the filter is working fine.
:DI just dont understand why the first parameters appear almost zero.