# Ecompass algorithm and Kalman Filter

51 views (last 30 days)
Mattia Vesperini on 24 Jan 2020 at 19:21
Answered: Vimal Rathod on 31 Jan 2020 at 11:41
Hi , I used ecompass algorithm to analyze magnetometer and accelerometer signals. To process my data I need a kalman filter with input: (quaternions / angles of euler) and gyroscope. how can i implement it?

Githin John on 27 Jan 2020 at 5:03
Your question is a little vague. If you have a specific area you want to clarify please specify it.
Walter Roberson on 27 Jan 2020 at 5:08
Mattia Vesperini on 27 Jan 2020 at 11:38
I consulted this link, I can't understand how to input my data in kallmanfilter. I attach my code:
rotationvector=rotvecd (orientation);
quaterionEulerAngles = eulerd (orientation, 'ZYX' , 'frame' )

Vimal Rathod on 31 Jan 2020 at 11:41
To use the kalman filter to analyze the signals you first have to create a state-space model which will be directly passed with the noise covariance to the kalman function.
Refer the following link to know more about how to create a state-space model.
Refer the following link to know more about how to apply kalman filter using a state space model
Incase you just want to estimate the orientations from the readings of accelerometer and gyroscope readings, you could use the imufilter function which returns a kalman filter object which could be used on the signal readings directly.
Refer to the sample code below to know how it is used. In the below example the simpler version is given but you could set different properties for the filter by passing different inputs in the imufilter function.
% returns a kalman filter object.
FUSE = imufilter;
%generates estimates about orientation and angular velocities