Can the Kalman filter handle variations in sampling interval?

In summary, the Kalman filter can handle a jitter in sampling interval dt, but it performs worse when the bandwidth of the dt jitter is high.
  • #1
bolly
16
2
Dear Community,

I want to use a Kalman- filter approach to calculate inclination angles (pitch and roll) obtained from accelerometer- and gyroscope- raw data. However the problem is that my sampling interval dt is not constant – it has a significant jitter instead. To investigate whether the kalman filter can handle such data I’ve experimented using the following MATLAB code copied from here (http://web.csulb.edu/~hill/ee400d/Project%20Folder/Kalman%20Filter%20Research.pdf):

Code:
stacksize = 100;dt_stack  = rand(stacksize,1)/2;
t_stack = zeros(stacksize,1);

t_stack(1) = 0;
for count=2:stacksize
t_stack(count) = t_stack(count-1) + dt_stack(count);
end

x =     sin(t_stack); % angle
x_dot = cos(t_stack); % angular velocity

figure;
subplot(3,1,1);
plot(t_stack);
subplot(3,1,2);
plot(t_stack,x);
hold on;
plot(t_stack,x_dot,    'Color','red');
P = [1 0; 0 1];R_angle = 0.9;
Q_angle = 0.05;
Q_gyro = 0.5;

Q = [Q_angle 0; 0 Q_gyro];
A = [0 -1; 0 0];
q_bias = 0; % Initialize gyro bias
angle = 0; % Initialize gyro angle
q_m = 0;
X = [0; 0];
x1 = zeros(stacksize);
x2 = zeros(stacksize);

 H = [1 0];

 x_calc  = 0;
 x_dot_corr = 0;
 gyro_bias = 0;

 angle_err = 0;

 for i=1:100 

  x_dot_corr = x_dot(i) - gyro_bias; % /* Pitch gyro measurement */ 
  x_calc = x_calc + x_dot_corr*dt_stack(i);
  x_err = x(i)- x_calc;
 
  Pdot = A*P + P*A' + Q; 
  P = P + Pdot*dt_stack(i);
  E = H*P*H' + R_angle;

  K = P*H'*inv(E);
  P = P - K*H*P;

  X = X + K * x_err; 
  x1(i) = X(1);
  x2(i) = X(2);
  x_calc= x1(i);
  gyro_bias = x2(i); 
end

 x = x(1:stacksize);
 x1 = x1(1:stacksize);

 length(x)
 length(x1)
 length(t_stack)% Plot the result using kalman filter
subplot(3,1,3);
plot(t_stack,x);
hold on
plot(t_stack,x1,'Color','green');

xlabel('time(s)');
ylabel('x(t)');
legend('actual','kalman');
I’ve found that with increasing bandwidth of dt the filter refuses to work. As far I’ve understood the kalman approach can be applied to zero the linear integration-error obtained by integrating the angular velocity measured using a gyroscope (if the this error propagtes linear).
However can it also be applied to zero the sampling error caused by a jitter of dt ?

I would be very happy if someone could give a hint why the kalman approach refuses to work with increasing bandwidth of dt.
 
Last edited:
Physics news on Phys.org
  • #2
Dear Community,

after investigating the Kalman filter in more detail I've found that it can handle dt jitter if the sampling rate is set high compared with the settling time of the filter since the filter only yields good results after a settling time of approx. 20 times higher than the raw data sampling interval dt. Shorting the settling time by changing the kalman variances causes noisy results.
 
  • Like
Likes FactChecker
  • #3
https://arxiv.org/pdf/1507.01832.pdf

Computing Fourier transforms with explicit integration rather than FFT methods is better able to handle variations in step sizes. The speed of most computers no longer requires FFT methods for many data analysis tasks.
 

1. What is a Kalman filter and how does it work?

A Kalman filter is a mathematical algorithm used to estimate the state of a dynamic system based on noisy measurements. It works by incorporating both the system dynamics and the measurement noise to produce an optimal estimate of the system state.

2. What is dt jitter and how does it affect the performance of a Kalman filter?

dt jitter, or time interval jitter, refers to variations in the time interval between consecutive measurements in a system. This can cause the Kalman filter to produce inaccurate state estimates, as it relies on a constant time interval for its calculations. The more severe the dt jitter, the less accurate the filter's estimates will be.

3. How can dt jitter be minimized in a Kalman filter?

One way to minimize dt jitter is by using a higher sampling rate, which reduces the time interval between measurements and therefore decreases the impact of jitter. Another method is to use a low-pass filter to smooth out the measurements and reduce the effect of jitter.

4. What are the potential applications of Kalman filter and dt jitter in scientific research?

Kalman filters are commonly used in fields such as robotics, aerospace engineering, and signal processing to estimate the state of complex systems. The study of dt jitter can help researchers better understand and mitigate the effects of time variations in these systems, leading to more accurate and reliable state estimation.

5. Are there any limitations or challenges when using Kalman filter and dt jitter in scientific research?

One limitation of Kalman filters is that they assume the system dynamics and measurement noise are linear and Gaussian, respectively. This may not always be the case in real-world applications, leading to less accurate estimates. Additionally, accurately measuring and accounting for dt jitter can be challenging, especially in systems with high levels of noise or nonlinearity.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
749
Replies
1
Views
2K
Replies
9
Views
6K
  • Linear and Abstract Algebra
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Mechanical Engineering
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Replies
2
Views
3K
  • Mechanical Engineering
Replies
7
Views
22K
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
Back
Top