异常检测RX算法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/axiqia/article/details/68960783

这里写图片描述

出处:Regularization for spectral matched filter and RX anomaly detector

function [result] = RxDetector(X)
% Inputs
%   X  - 2D data matrix (p x N)
% Outputs
%   result - Detector output (1 x N)
%   sigma - Covariance matrix (p x p)
%   sigmaInv - Inverse of covariance matrix (p x p)

% Remove the data mean
[p, N] = size(X);
mMean = mean(X, 2);
B = X - repmat(mMean, 1, N);

% Compute covariance matrix of background
sigma = (B*B.')/(N-1);

sigmaInv = inv(sigma);

result = zeros(N, 1);
for i=1:N
    result(i) = B(:,i).'*sigmaInv*B(:,i);
end
result = abs(result);

return;

猜你喜欢

转载自blog.csdn.net/axiqia/article/details/68960783
今日推荐