Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Extended Kalman Filter

Subject: Extended Kalman Filter

From: harun

Date: 17 Dec, 2009 10:57:03

Message: 1 of 2

Hi dear....,

I want to estimate moving object by using extended kalman filter.
this code is for kalman filter.. and its also works as not bad

now in this code, when I want to change it to Extended kalman filter, I have to use two functions one of them is f and the other is h function. my problem is how to define these function??
the moving object is not specific object... it may be a plane.

function kalman()
% Kalman filter initialization
P = 100*eye(4);
g = 6; % pixels^2/time step
Bu = [0,0,0,g]';

% loop over all images
for i = 1 : 30
  %extract background
  [cc(i),cr(i),radius,flag] = extractbackgraund(Imwork,Imback,i);
  if flag==0
  hold on
    for c = -1*radius: radius/20 : 1*radius
      r = sqrt(radius^2-c^2);
  % Kalman update

  if kfinit==0
    xp = [MC/2,MR/2,0,0]'
    xp=A*x(i-1,:)' + Bu %this code is for kalman iflter

    %X(k|k-1)=fonktion f(x(i,:),Bu) % extended kalman filter should be
  PP = A*P*A' + Q

  % P(k|k-1)=Fk*P(k-1|k-1)*Fk'+Q(k-1) %predicted estimate covariance

  K = PP*H'*inv(H*PP*H'+R)
  x(i,:) = (xp + K*([cc(i),cr(i)]' - H*xp))';
  P = (eye(4)-K*H)*PP %updated estiamte covariance
hold on
    for c = -1*radius: radius/20 : 1*radius
      r = sqrt(radius^2-c^2);

% show positions
  hold on
%estimate image noise (R) from stationary ball
  posn = [cc(55:60)',cr(55:60)'];
  mp = mean(posn);
  diffp = posn - ones(6,1)*mp;
  Rnew = (diffp'*diffp)/5;

Subject: Extended Kalman Filter

From: Michael_RW

Date: 22 Jan, 2010 04:31:55

Message: 2 of 2

Hey, Love:

Do you know what the functions "f" and "h" are?



Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us