2011-12-20 5:26 AM
Hi every stm32 fan,
In my application I am sampling my input signal at 8KHz and now I need to filter out my samples in order to remove high components. Is there a software tool which computes the coefficients of an FIR filter? I am thinking to use the FPU inside the cortex M4. Is there someone who did it? So viel Dank2011-12-20 6:45 AM
Consider using a simple first order lag:
X = Xprevious + (Xcurrent - Xprevious)/A This can easily be done in real time with integer arithmetic, and if A is a power of 2, can be done with arithmetic right shifts. For the first sample, make X = Xcurrent to start the filter. This method works well if your highest desired frequency is not close to the sample frequency. If you need a sharper cutoff filter, perhaps someone else can chime in. Willkommen, Hal2011-12-20 8:03 AM
I used the arm_fir_q15 function. (This is fixed point filtering)
Coefficients can be computed using Octave (free) / Matlab. In Octave you could use: fir1 ''help fir1'' for doc. -> b = fir1(n, w [, type] [, window] [, noscale]) ... You have to scale these coeffictions to q15 fixed point format. Example: coeff = fir1(15, 0.1); %Lowpass filter with fs=0.1. Returning the 15+1 filter coefficients. coeff_fixedp = round(coeff * 2^15) % Scaling and rounding freqz(coeff); %Plot filter response Gern geschehen, raffael http://www.gnu.org/software/octave/ http://guioctave.com/2011-12-22 5:42 PM
2011-12-23 1:24 AM
Hi William,
Thank you for your proposal. I really appreciate it. Is there some other on line tools for coefficients but other than the raised cosine filter type?