Alpha beta filter

Last updated

An alpha beta filter (also called alpha-beta filter, f-g filter or g-h filter [1] ) is a simplified form of observer for estimation, data smoothing and control applications. It is closely related to Kalman filters and to linear state observers used in control theory. Its principal advantage is that it does not require a detailed system model.

Contents

Filter equations

An alpha beta filter presumes that a system is adequately approximated by a model having two internal states, where the first state is obtained by integrating the value of the second state over time. Measured system output values correspond to observations of the first model state, plus disturbances. This very low order approximation is adequate for many simple systems, for example, mechanical systems where position is obtained as the time integral of velocity. Based on a mechanical system analogy, the two states can be called position x and velocity v. Assuming that velocity remains approximately constant over the small time interval ΔT between measurements, the position state is projected forward to predict its value at the next sampling time using equation 1.

Since velocity variable v is presumed constant, its projected value at the next sampling time equals the current value.

If additional information is known about how a driving function will change the v state during each time interval, equation 2 can be modified to include it.

The output measurement is expected to deviate from the prediction because of noise and dynamic effects not included in the simplified dynamic model. This prediction error r is also called the residual or innovation, based on statistical or Kalman filtering interpretations

Suppose that residual r is positive. This could result because the previous x estimate was low, the previous v was low, or some combination of the two. The alpha beta filter takes selected alpha and beta constants (from which the filter gets its name), uses alpha times the deviation r to correct the position estimate, and uses beta times the deviation r to correct the velocity estimate. An extra ΔT factor conventionally serves to normalize magnitudes of the multipliers.

The corrections can be considered small steps along an estimate of the gradient direction. As these adjustments accumulate, error in the state estimates is reduced. For convergence and stability, the values of the alpha and beta multipliers should be positive and small: [2]

Noise is suppressed only if , otherwise the noise is amplified.

Values of alpha and beta typically are adjusted experimentally. In general, larger alpha and beta gains tend to produce faster response for tracking transient changes, while smaller alpha and beta gains reduce the level of noise in the state estimates. If a good balance between accurate tracking and noise reduction is found, and the algorithm is effective, filtered estimates are more accurate than the direct measurements. This motivates calling the alpha-beta process a filter.

Algorithm summary

Initialize.

  1. Set the initial values of state estimates x and v, using prior information or additional measurements; otherwise, set the initial state values to zero.
  2. Select values of the alpha and beta correction gains.

Update. Repeat for each time step ΔT:

  1. Project state estimates x and v using equations 1 and 2
  2. Obtain a current measurement of the output value
  3. Compute the residual r using equation 3
  4. Correct the state estimates using equations 4 and 5
  5. Send updated x and optionally v as the filter outputs

Sample program

Alpha Beta filter can be implemented in C [3] as follows:

#include<stdio.h>#include<stdlib.h>intmain(){floatdt=0.5;floatxk_1=0,vk_1=0,a=0.85,b=0.005;floatxk,vk,rk;floatxm;while(1){xm=rand()%100;// input signalxk=xk_1+(vk_1*dt);vk=vk_1;rk=xm-xk;xk+=a*rk;vk+=(b*rk)/dt;xk_1=xk;vk_1=vk;printf("%f \t %f\n",xm,xk_1);sleep(1);}}

Result

The following images depict the outcome of the above program in graphical format. In each image, the blue trace is the input signal; the output is red in the first image, yellow in the second, and green in the third. For the first two images, the output signal is visibly smoother than the input signal and lacks extreme spikes seen in the input. Also, the output moves in an estimate of gradient direction of input.

The higher the alpha parameter, the higher is the effect of input x and the less damping is seen. A low value of beta is effective in controlling sudden surges in velocity. Also, as alpha increases beyond unity, the output becomes rougher and more uneven than the input. [3]

Results for alpha = 0.85 and beta = 0.005 Alpha beta filter 0.85-0.005.jpg
Results for alpha = 0.85 and beta = 0.005
Results for alpha = 0.5 and beta = 0.1 Alpha beta filter 0.5-0.1.jpg
Results for alpha = 0.5 and beta = 0.1
Results for alpha = 1.5 and beta = 0.5 Alpha beta filter 1.5-.5.jpg
Results for alpha = 1.5 and beta = 0.5

Relationship to general state observers

More general state observers, such as the Luenberger observer for linear control systems, use a rigorous system model. Linear observers use a gain matrix to determine state estimate corrections from multiple deviations between measured variables and predicted outputs that are linear combinations of state variables. In the case of alpha beta filters, this gain matrix reduces to two terms. There is no general theory for determining the best observer gain terms, and typically gains are adjusted experimentally for both.

The linear Luenberger observer equations reduce to the alpha beta filter by applying the following specializations and simplifications.

Relationship to Kalman filters

A Kalman filter estimates the values of state variables and corrects them in a manner similar to an alpha beta filter or a state observer. However, a Kalman filter does this in a much more formal and rigorous manner. The principal differences between Kalman filters and alpha beta filters are the following.

A Kalman filter designed to track a moving object using a constant-velocity target dynamics (process) model (i.e., constant velocity between measurement updates) with process noise covariance and measurement covariance held constant will converge to the same structure as an alpha-beta filter. However, a Kalman filter's gain is computed recursively at each time step using the assumed process and measurement error statistics, whereas the alpha-beta's gain is computed ad hoc.

Choice of parameters

The alpha-beta filter becomes a steady-state Kalman filter if filter parameters are calculated from the sampling interval , the process variance and the noise variance like this [4] [5]

This choice of filter parameters minimizes the mean square error.

The steady state innovation variance can be expressed as:

Variations

Alpha filter

A simpler member of this family of filters is the alpha filter which observes only one state:

with the optimal parameter calculated like this: [4]

This calculation is identical for a moving average and a low-pass filter. Exponential smoothing is mathematically identical to the purposed Alpha filter.

Alpha beta gamma filter

When the second state variable varies quickly, i.e. when the acceleration of the first state is large, it can be useful to extend the states of the alpha beta filter by one level. In this extension, the second state variable v is obtained from integrating a third acceleration state, analogous to the way that the first state is obtained by integrating the second. An equation for the a state is added to the equation system. A third multiplier, gamma, is selected for applying corrections to the new a state estimates. This yields the alpha beta gamma update equations. [1]

Similar extensions to additional higher orders are possible, but most systems of higher order tend to have significant interactions among the multiple states, [ citation needed ] so approximating the system dynamics as a simple integrator chain is less likely to prove useful.

Calculating optimal parameters for the alpha-beta-gamma filter is a bit more involved than for the alpha-beta filter: [5]

See also

Related Research Articles

<span class="mw-page-title-main">Exponential distribution</span> Probability distribution

In probability theory and statistics, the exponential distribution or negative exponential distribution is the probability distribution of the time between events in a Poisson point process, i.e., a process in which events occur continuously and independently at a constant average rate. It is a particular case of the gamma distribution. It is the continuous analogue of the geometric distribution, and it has the key property of being memoryless. In addition to being used for the analysis of Poisson point processes it is found in various other contexts.

<span class="mw-page-title-main">Kalman filter</span> Algorithm that estimates unknowns from a series of measurements over time

For statistics and control theory, Kalman filtering, also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, including statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more accurate than those based on a single measurement alone, by estimating a joint probability distribution over the variables for each timeframe. The filter is named after Rudolf E. Kálmán, who was one of the primary developers of its theory.

Linear elasticity is a mathematical model of how solid objects deform and become internally stressed due to prescribed loading conditions. It is a simplification of the more general nonlinear theory of elasticity and a branch of continuum mechanics.

Ridge regression is a method of estimating the coefficients of multiple-regression models in scenarios where the independent variables are highly correlated. It has been used in many fields including econometrics, chemistry, and engineering. Also known as Tikhonov regularization, named for Andrey Tikhonov, it is a method of regularization of ill-posed problems. It is particularly useful to mitigate the problem of multicollinearity in linear regression, which commonly occurs in models with large numbers of parameters. In general, the method provides improved efficiency in parameter estimation problems in exchange for a tolerable amount of bias.

<span class="mw-page-title-main">Gauss–Newton algorithm</span> Mathematical algorithm

The Gauss–Newton algorithm is used to solve non-linear least squares problems, which is equivalent to minimizing a sum of squared function values. It is an extension of Newton's method for finding a minimum of a non-linear function. Since a sum of squares must be nonnegative, the algorithm can be viewed as using Newton's method to iteratively approximate zeroes of the components of the sum, and thus minimizing the sum. In this sense, the algorithm is also an effective method for solving overdetermined systems of equations. It has the advantage that second derivatives, which can be challenging to compute, are not required.

In numerical analysis, the Crank–Nicolson method is a finite difference method used for numerically solving the heat equation and similar partial differential equations. It is a second-order method in time. It is implicit in time, can be written as an implicit Runge–Kutta method, and it is numerically stable. The method was developed by John Crank and Phyllis Nicolson in the mid 20th century.

In the mathematics of evolving systems, the concept of a center manifold was originally developed to determine stability of degenerate equilibria. Subsequently, the concept of center manifolds was realised to be fundamental to mathematical modelling.

<span class="mw-page-title-main">Covariant formulation of classical electromagnetism</span> Ways of writing certain laws of physics

The covariant formulation of classical electromagnetism refers to ways of writing the laws of classical electromagnetism in a form that is manifestly invariant under Lorentz transformations, in the formalism of special relativity using rectilinear inertial coordinate systems. These expressions both make it simple to prove that the laws of classical electromagnetism take the same form in any inertial coordinate system, and also provide a way to translate the fields and forces from one frame to another. However, this is not as general as Maxwell's equations in curved spacetime or non-rectilinear coordinate systems.

<span class="mw-page-title-main">Maxwell's equations in curved spacetime</span> Electromagnetism in general relativity

In physics, Maxwell's equations in curved spacetime govern the dynamics of the electromagnetic field in curved spacetime or where one uses an arbitrary coordinate system. These equations can be viewed as a generalization of the vacuum Maxwell's equations which are normally formulated in the local coordinates of flat spacetime. But because general relativity dictates that the presence of electromagnetic fields induce curvature in spacetime, Maxwell's equations in flat spacetime should be viewed as a convenient approximation.

The Newman–Penrose (NP) formalism is a set of notation developed by Ezra T. Newman and Roger Penrose for general relativity (GR). Their notation is an effort to treat general relativity in terms of spinor notation, which introduces complex forms of the usual variables used in GR. The NP formalism is itself a special case of the tetrad formalism, where the tensors of the theory are projected onto a complete vector basis at each point in spacetime. Usually this vector basis is chosen to reflect some symmetry of the spacetime, leading to simplified expressions for physical observables. In the case of the NP formalism, the vector basis chosen is a null tetrad: a set of four null vectors—two real, and a complex-conjugate pair. The two real members often asymptotically point radially inward and radially outward, and the formalism is well adapted to treatment of the propagation of radiation in curved spacetime. The Weyl scalars, derived from the Weyl tensor, are often used. In particular, it can be shown that one of these scalars— in the appropriate frame—encodes the outgoing gravitational radiation of an asymptotically flat system.

Bayesian linear regression is a type of conditional modeling in which the mean of one variable is described by a linear combination of other variables, with the goal of obtaining the posterior probability of the regression coefficients and ultimately allowing the out-of-sample prediction of the regressandconditional on observed values of the regressors. The simplest and most widely used version of this model is the normal linear model, in which given is distributed Gaussian. In this model, and under a particular choice of prior probabilities for the parameters—so-called conjugate priors—the posterior can be found analytically. With more arbitrarily chosen priors, the posteriors generally have to be approximated.

In computational chemistry, a constraint algorithm is a method for satisfying the Newtonian motion of a rigid body which consists of mass points. A restraint algorithm is used to ensure that the distance between mass points is maintained. The general steps involved are: (i) choose novel unconstrained coordinates, (ii) introduce explicit constraint forces, (iii) minimize constraint forces implicitly by the technique of Lagrange multipliers or projection methods.

A ratio distribution is a probability distribution constructed as the distribution of the ratio of random variables having two other known distributions. Given two random variables X and Y, the distribution of the random variable Z that is formed as the ratio Z = X/Y is a ratio distribution.

A kernel smoother is a statistical technique to estimate a real valued function as the weighted average of neighboring observed data. The weight is defined by the kernel, such that closer points are given higher weights. The estimated function is smooth, and the level of smoothness is set by a single parameter. Kernel smoothing is a type of weighted moving average.

<span class="mw-page-title-main">Normal-inverse-gamma distribution</span>

In probability theory and statistics, the normal-inverse-gamma distribution is a four-parameter family of multivariate continuous probability distributions. It is the conjugate prior of a normal distribution with unknown mean and variance.

In mathematics, and more precisely, in functional Analysis and PDEs, the Schauder estimates are a collection of results due to Juliusz Schauder concerning the regularity of solutions to linear, uniformly elliptic partial differential equations. The estimates say that when the equation has appropriately smooth terms and appropriately smooth solutions, then the Hölder norm of the solution can be controlled in terms of the Hölder norms for the coefficient and source terms. Since these estimates assume by hypothesis the existence of a solution, they are called a priori estimates.

<span class="mw-page-title-main">Vibration of plates</span>

The vibration of plates is a special case of the more general problem of mechanical vibrations. The equations governing the motion of plates are simpler than those for general three-dimensional objects because one of the dimensions of a plate is much smaller than the other two. This permits a two-dimensional plate theory to give an excellent approximation to the actual three-dimensional motion of a plate-like object.

Affine gauge theory is classical gauge theory where gauge fields are affine connections on the tangent bundle over a smooth manifold . For instance, these are gauge theory of dislocations in continuous media when , the generalization of metric-affine gravitation theory when is a world manifold and, in particular, gauge theory of the fifth force.

<span class="mw-page-title-main">Dual graviton</span> Hypothetical particle found in supergravity

In theoretical physics, the dual graviton is a hypothetical elementary particle that is a dual of the graviton under electric-magnetic duality, as an S-duality, predicted by some formulations of supergravity in eleven dimensions.

<span class="mw-page-title-main">Minimal residual method</span> Computational method

The Minimal Residual Method or MINRES is a Krylov subspace method for the iterative solution of symmetric linear equation systems. It was proposed by mathematicians Christopher Conway Paige and Michael Alan Saunders in 1975.

References

  1. 1 2 Eli Brookner: Tracking and Kalman Filtering Made Easy. Wiley-Interscience, 1st edition, 4 1998.
  2. C. Frank Asquith: Weight selection in first-order linear filters. Technical report, Army Intertial Guidance and Control Laboratory Center, Redstone Arsenal, Alabama, 1969. https://doi.org/10.21236/ad0859332
  3. 1 2 Tremor Cancellation in Handheld Microsurgical Devices, TC83 by Gaurav Mittal, Deepansh Sehgal and Harsimran Jit Singh, Punjab Engineering College
  4. 1 2 Paul R. Kalata: The tracking index: A generalized parameter for α-β and α-β-γ target trackers. IEEE Transactions on Aerospace and Electronic Systems, AES-20(2):174–181, March 1984.
  5. 1 2 J. E. Gray and W. J. Murray: A derivation of an analytic expression for the tracking index for the alpha-beta-gamma filter. IEEE Trans. on Aerospace and Electronic Systems, 29:1064–1065, 1993.
Sources