# FIR filter

Hello guys,how can I calculate the FIR filter Coefficients with 5hz cutoff ? I tryed using this site: http://t-filter.appspot.com/fir/index.html and the result was:

``````-2.2204460492503132e-17
4.4408920985006264e-17
1
4.4408920985006264e-17
-2.2204460492503132e-17
``````

Is this correct ?

Is this correct ?

You didn’t say what the sampling rate was. But why wouldn’t it be ‘correct’ anyway?

It doesn’t really matter because those coefficients are essentially equal to 0, 0, 1, 0, 0 which won’t filter anything.

Pete

High pass? Low pass? You have posed an ill defined question.

Well actually I want FIR Low pass filter,because my accelerometer readings are at 25Hz. Actually human body cant do motion or full movement below 5hz,or 200ms. So I actually want to pass all data from 1-to 5 Hz and cut everything from 6 to 12.5(because 25/2=12.5). Now I am using FIR library,but there I have to calculate the coefficients,now they look like this: `float coef[27] = { 0.008630882178727884,0.04130599105431515,0.058861360734775915,0.03686795552479371,-0.01695307234100176,-0.040853244115447114,-0.0003366628116886725,0.05087113608224402,0.026656021882141247,-0.061691775345685256,-0.08155386643224165,0.0696390509525337,0.3096965081057874,0.42746479730688086,0.3096965081057874,0.0696390509525337,-0.08155386643224165,-0.061691775345685256,0.026656021882141247,0.05087113608224402,-0.0003366628116886725,-0.040853244115447114,-0.01695307234100176,0.03686795552479371,0.058861360734775915,0.04130599105431515,0.008630882178727884};` The base idea is to use convolution after the FIR filter,so I can deter slope.

That is one loooooonnnng filter. Personally, for a more reasonable solution, I would find the analog filter to do the job expressed in the Laplace variable, s. Then I would use the matlab function c2d to get the FIR filter. You can also do the same thing in Mathematica.