cancel
Showing results for 
Search instead for 
Did you mean: 

FIR filtering on STM32F4

tm3341
Associate II
Posted on March 12, 2015 at 09:36

Hi,

in my application, I need to make signal filtering using digital filters.

I take ARM's DSP library and fir example, but it is not so useful for me, because there are samples stored in memory already and they are using block of data.

What I need is:

Every time I sample a new ADC value, put it to FIR and after FIR finishes, return new value out so I can transmit it over. 

I can't wait for about 10 samples, then do stuff and send. I need to do it each time.

I have FIR coeficients already done in matlab, there is working fine.

I don't know how to properly this set up using DSP libs.

I'm using f32 variables.

If anyone have a working example for that, please send just fir filtering part.

At least, point me to a good example where I can get useful infos about that.

Thanks.

#filter #arm #stm32f4 #fir #dsp
4 REPLIES 4
lokesh
Associate II
Posted on March 13, 2015 at 09:23

Majerle,

I am also working on Band Pass Filter design in STM32F429i discovery kit.

When i see the structure declaration

arm_fir_instance_q31

it has  pCoeffs.

I am curious to know how did you achieve coefficient array?

can't we do this within dsp library?

thanks

Posted on March 13, 2015 at 13:44

Well it's going to still need 10, or whatever, historic terms to do the computation, so your option would probably be to rotate the table by 1 byte for every new sample and repeat.

Somehow you'd probably just want to recode the math, because doing blocks of data is done so they can optimize the solution and unroll it, whereas you're always looking for a single solution.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 13, 2015 at 13:50

I am curious to know how did you achieve coefficient array? can't we do this within dsp library?

Well you could compute your coefficients as floats, and convert them to the Q31 fix point representation? Just delayed feedback terms, right?

https://www.keil.com/pack/doc/CMSIS/DSP/html/group__float__to__x.html

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
tm3341
Associate II
Posted on March 14, 2015 at 10:05

Ok, I got it.

Coeffs are done with MATLAB using fdatool inside.

I got it working correctly what I want.

Every new sample I got, I call:

arm_fir_f32(&my_structure, &inputSample, &outputSample, 1);

and new result is stored in ''outputSample'' which can then be used to do next stuff.