I'm trying to apply a filter method (Butterworth) in MATLAB to remove a static acceleration (gravity).
The problem here is the sampling rate seems to be varying. As far as I know, the sampling rate is defined as the number of samples obtained in one second (samples per second), thus fs = 1/T
. T
is not fixed, and it was varying in my file:
The sampling times were as follows. The fraction components represent ms.
16:25:50.032
16:25:50.192
16:25:50.352
16:25:50.512
16:25:50.671
16:25:50.832
16:25:50.991
16:25:51.151
16:25:51.312
16:25:51.472
16:25:51.632
The value of T
is 100ms but here we can see that T
varies between 159 and 161. I am not sure how I can calculate the sampling rate in this case?
Also, if I have a varying sampling rate, can I use still Butterworth?