AnsweredAssumed Answered

Digital Filter working real-time with arm_fir_f32 function

Question asked by carbonera.felipe on Sep 25, 2013
Latest reply on Sep 26, 2013 by carbonera.felipe
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 the arm_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:

filtro.jpg

Outcomes