implementation butterworth filter in matlab -



implementation butterworth filter in matlab -

i have accelerometer 3 axis.

as far know acceleration sum of static acceleration (gravity) , dynamic acceleration.

my goal's extract gravity acceleration show me direction of device.

i apply butterworth filter extract gravity acceleration. have problem in choosing cut-off frequency , filter order.

t = 0.16 s ; %time of sample rate fs = 1/0.16 ; % sampling rate? correct?

after reading few articles, found cut-off varie between 0.1 0.5 , here take 0.5 (because don't know based on choice.

this programme execute in matlab extract gravity acceleration 3 axis.

fc = 0.5 ; %cut-off frequency fs = 6.26 hz (1/0.16) ; % sampling rate order = 4; [b,a] = butter(order,fc(fs/2),'low'); x = filter (b,a,x0); y = filter(b,a,y0); z = filter(b,a,z0);

what doing is, "slow" measurements downwards butterworth filter. thus, in practice seek rid of "fast" part. means in frequency domain is: want lowpass (low frequency = slow signal goes through, while high = fast gets filtered out). guess know should able find reasonable value.

generally estimating angles have gyroscopes @ hand. rather go kalman filtering, since doesn't add together much of delay measurements (if time dependent).

as commented, maintain in mind, dealing sampled info (nyquist freq. natural restriction).

matlab filter

Comments