Code covered by the BSD License  

Highlights from
evaluateAlphaBetaParam

image thumbnail

evaluateAlphaBetaParam

by

 

28 Jun 2013 (Updated )

Function evaluateAlphaBetaParam evaluates alpha and beta parameters for alpha-beta filter

evaluateAlphaBetaParam(process, noisy, dt)
function [alpha, beta, stability] = evaluateAlphaBetaParam(process, noisy, dt)
% evaluateAlphaBetaParam - evaluates alpha and beta parameters for alpha-beta filter
% With this parameters, alpha-beta filter becomes a steady-state Kalman filter
%
% Syntax:          [xkp,vkp] = alphaBetaFilter(xm, dt, xk, vk, alpha, beta)
%   [alpha, beta, stability] = evaluateAlphaBetaParam(process, noisy, dt)
%     [alpha,beta,stability] = evalABGParam([alpha,beta])
%
% Inputs:
%   process - real system state
%     noisy - measured system state
%
% Outputs:
%   alpha - alpha parameter
%    beta - beta parameter
%
% Other m-files required: none
% Subfunctions: none
% MAT-files required: none
%
% See also: alphaBetaFilter;

% Author: Marco Borges, Ph.D. Student, Computer/Biomedical Engineer
% UFMG, PPGEE, Neurodinamica Lab, Brazil
% email address: marcoafborges@gmail.com
% Website: http://www.cpdee.ufmg.br/
% References:
%   GRAY, J.; MURRAY, W. A Derivation of an Analytic Expression for the
%      Tracking Index for the Alpha-Beta-Gamma Filter. Aerospace and 
%      Electronic Systems, IEEE ?, v. 29, n. 3, p. 2?3, 1993. 
% June 2013; Version: v3; Last revision: 2013-12-24
% Changelog:
%  v2 - add Stability test
%  v3 - lambda calculation bugfix
%------------------------------- BEGIN CODE -------------------------------

if nargin == 3
    stdProcess = std(process);
    stdNoise = std(noisy - process);
    gam = stdProcess * dt^2 / stdNoise;
    r = (4 + gam - sqrt(8*gam + gam.^2)) / 4;
    alpha = 1 - r.^2;
    beta = 2*(1 - r).^2;
elseif nargin == 1 && length(process) == 2
    alpha = process(1);
    beta = process(2);
else
    error('evaluateAlphaBetaParam : Incorrect Parameters!');
end

if ( alpha > 0 && alpha < 2 && beta > 0 && beta < (4-2*alpha) )
    stability = 'Stable';
else
    stability = 'Unstable';
end

end
%-------------------------------- END CODE --------------------------------

Contact us