cancel
Showing results for 
Search instead for 
Did you mean: 

FIR filter for MEMS

JDave.4
Associate III

Hello,

Are there any examples for implementation FIR filter on accelerometer and gyro data with programmable cut-off frequency? It would be better if CMSIS DSP functions are used.

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @JDave.4​ ,

In the FP-SNS-ALLMEMS1 function pack for the MEMS&Sensors, there is an example of the implementation of a FIR implementation (via CMSIS DSP on ARM Cortex), that removes high frequency signal components from the input using an FIR lowpass filter. The example demonstrates how to configure an FIR filter and then pass data through it in a block-by-block fashion. You might feed this function with the accelerometer raw data (acquired via one of the Sensors projects) instead of the sinewaves used in the example.

You can find it in the Drivers folder, path: \Drivers\CMSIS\DSP\Examples\ARM\arm_fir_example.

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon

View solution in original post

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi @JDave.4​ ,

In the FP-SNS-ALLMEMS1 function pack for the MEMS&Sensors, there is an example of the implementation of a FIR implementation (via CMSIS DSP on ARM Cortex), that removes high frequency signal components from the input using an FIR lowpass filter. The example demonstrates how to configure an FIR filter and then pass data through it in a block-by-block fashion. You might feed this function with the accelerometer raw data (acquired via one of the Sensors projects) instead of the sinewaves used in the example.

You can find it in the Drivers folder, path: \Drivers\CMSIS\DSP\Examples\ARM\arm_fir_example.

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon

Hi,

I found the example. I need to calculate tilt angles from acc. values. Should the filter be applied to raw acc. values or after calculation of tilt angles?

Hi @JDave.4​ ,

If you need the raw data only for the tilt calculation, you should apply the filter before the data processing.

I suggest you to follow this design tip for the formula to be used:

You can have a look also to this example on Github for the precision inclinometer IIS2ICLX, that implements the Tilt detection via FSM.

-Eleon