2009-09-13 5:57 PM
Software digital low pass filter (40Hz)?
2011-05-17 4:23 AM
I want to use a Software digital low pass filter(3db freq=40Hz) in my STM32F103CB. The filter will be fed the data of ADC output and the filter will output data that is 40Hz filtered.
Does anyone have the software low pass filter sample code that can be added to my project and can be run on STM32F103CB MCU? Thanks a lot!2011-05-17 4:23 AM
Have you tried the DSP library available on the STM32 downloads page:
2011-05-17 4:23 AM
Can you tell me which file or sample code is about the low pass filter design? Thanks a lot!
2011-05-17 4:23 AM
hi,
If you do a search on DSP on forum main page you find a lot of topics. Take a look in one of my earlier posts: -G2011-05-17 4:23 AM
This is a handy site:
http://www.dsptutor.freeuk.com/index.htm I used the FIR filter designer to come up with some coefficients for a low pass filter, and had a look at some of the java source to figure out how to apply them.2011-05-17 4:23 AM
Hi guyvo67, thank you!
Now I knoe how to generate the coefficients I need. I download the source code of FIR Digital Filter Design Applet fromhttp://www.dsptutor.freeuk.com/FIRFilterDesign/FIRFilterDesign.html
I need 360Hz sample rate. Should I change the ''rate'' of FIRFilterDesign.java from 8000.0f to 360.0f? And should I change the ''fN'', ''f1'' and ''f2'' of FIRFilter.java for 360Hz setting? How to change? On the other hand, I want to use fir_16by16_stm32 function to filter my data from ADC output. The data from ADC output is a data array that is ''unsigned short x[360]''. I find that for fir_16by16_stm32 the length of input vector ahould be equal to M+N-1. (output vector of length N, coefficients vector of length M). I want to input 360 16-bit data to fir_16by16_stm32 and get 360 16-bit filtered data from fir_16by16_stm32. Can you tell me how to design for fir_16by16_stm32 to fit my need? Thank you very much!