AnsweredAssumed Answered

matlab coefficient to stm32f429i discovery board

Question asked by bhatt.lokesh on Mar 30, 2015
Latest reply on Jul 21, 2015 by Vinci
I am trying to implement iir Band Pass filter design in STM32F429i discovery kit.
I konw that it needs coefficients to be generated from matlab and feed them into cmsis api to achiev filtered data.

My SOS Matrix look like shown below:

1,  0,  -1,  1, -1.9974,   0.99743,        
1,  0,  -1,  1, -1.9995,  0.99947,        
1,  0,  -1,  1,  -1.9937,  0.99371,        
1,  0,  -1,  1, -1.9982,  0.99817,       
1,  0,  -1,  1, -1.995,  0.99499,

above matrix i put into my coeff array removing column 4th which contains all 1's since its A0 in coeff.

static float32_t filter_coeffs[] = {
1,  0,  -1,  -1.9974,   0.99743,        
1,  0,  -1,  -1.9995,  0.99947,        
1,  0,  -1,  -1.9937,  0.99371,        
1,  0,  -1,  -1.9982,  0.99817,       
1,  0,  -1,  -1.995,  0.99499,
};

here is the code snippet am using :

#define NUMSTAGES 5
static float32_t firStateF32[2*NUMSTAGES];
arm_biquad_cascade_df1_init_f32(&S, NUMSTAGES, filter_coeffs, firStateF32);

when I am using matlab my signal are filtered perfect, but in microcontroller output is initially oscillating and than "1.#QNAN"
am i missing any step??
please correct me.

Regards,
Lokesh Bhatt

Outcomes