nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Math.SignalProcessing / Algorithm

Algorithm

Full name Microsoft.VisualBasic.Math.SignalProcessing.KalmanFilter.Algorithm Assembly Microsoft.VisualBasic.Math.SignalProcessing Members 4

01 Syntax

Microsoft.VisualBasic.Math.SignalProcessing.KalmanFilter.Algorithm

02 Methods

NameOverloadsSummary
kalman1_init 1 Initializes the 1-dimensional Kalman filter state structure
kalman1_filter 1 Performs 1-dimensional Kalman filtering
kalman2_init 1 Initializes the 2-dimensional Kalman filter state structure
kalman2_filter 1 Performs 2-dimensional Kalman filtering

03 Members

method kalman1_init #
kalman1_init(kalman1_state, Single, Single)

Initializes the 1-dimensional Kalman filter state structure

Remarks

Default configuration:

  • State transition matrix (A) = 1.0
  • Observation matrix (H) = 1.0
  • Process noise covariance (q) = 200.0
  • Measurement noise covariance (r) = 500.0

Note: These parameters should be tuned for specific applications

Parameters
NameTypeDescription
statekalman1_state

The Kalman filter state structure to initialize

init_xSingle

Initial state value (x0)

init_pSingle

Initial error covariance estimate (p0)

method kalman1_filter #
kalman1_filter(kalman1_state, Single)

Performs 1-dimensional Kalman filtering

Remarks

Implements standard Kalman filter equations:

  1. Prediction step (state and covariance)
  2. Measurement update (Kalman gain, state correction, covariance update)
Parameters
NameTypeDescription
statekalman1_state

Kalman filter state structure

z_measureSingle

Measurement value

Returns

Filtered state estimate

method kalman2_init #
kalman2_init(kalman2_state, Single(), Single()())

Initializes the 2-dimensional Kalman filter state structure

Remarks

Default configuration:

  • State transition matrix (A) = [[1, 0.1], [0, 1]]
  • Observation matrix (H) = [1, 0]
  • Process noise covariance (q) = [1e-6, 1e-6]
  • Measurement noise covariance (r) = 1e-6

Note: These parameters should be tuned for specific applications

Parameters
NameTypeDescription
statekalman2_state

The Kalman filter state structure to initialize

init_xSingle()

Initial state vector [x0, x1]

init_pSingle()()

Initial error covariance matrix (2x2)

method kalman2_filter #
kalman2_filter(kalman2_state, Single)

Performs 2-dimensional Kalman filtering

Remarks

Updates both state vector elements (typically [position, velocity] or [angle, angular velocity]) and covariance matrix. Implements:

  1. State prediction
  2. Covariance prediction
  3. Kalman gain calculation
  4. State correction
  5. Covariance update

Returns the first element of the updated state vector (x[0])

Parameters
NameTypeDescription
statekalman2_state

Kalman filter state structure

z_measureSingle

Measurement value

Returns

Primary state estimate (x[0])