Code covered by the BSD License  

Highlights from
Adaptive Fault Masking With Incoherence Scoring

image thumbnail
from Adaptive Fault Masking With Incoherence Scoring by Baykant ALAGOZ
Matlab simulation environment for testing various voting algorithms

[AdaptiveVoterOutput,yc,Is,Rs]=AdaptiveVoterIncScoNBit(y1,y2,y3,y4,y5,Rs,Beta,Alfa,a)
function [AdaptiveVoterOutput,yc,Is,Rs]=AdaptiveVoterIncScoNBit(y1,y2,y3,y4,y5,Rs,Beta,Alfa,a)
[n m]=size(y1);
% Calculate yc majority voting output for modules outputs y1,y2,y3
% ,y4,y5 (Algorithm step 1)
% It does Majority Group Vm described in Referrence [12] and
%  in the paper (page:4 Title:Majority Voter Using Distance Metric)
[Vmax,Vind,T,yc]=MajorityVotingNBit(y1,y2,y3,y4,y5,a);

% Calculate incoherence scores Is for all outputs y1,y2,y3,y4,y5
% (Algorithm step 2)
Is(1)=Beta*HammingDist(y1,yc)/m+(1-Beta)*Rs(1);
Is(2)=Beta*HammingDist(y2,yc)/m+(1-Beta)*Rs(2);
Is(3)=Beta*HammingDist(y3,yc)/m+(1-Beta)*Rs(3);
Is(4)=Beta*HammingDist(y4,yc)/m+(1-Beta)*Rs(4);
Is(5)=Beta*HammingDist(y5,yc)/m+(1-Beta)*Rs(5);

% Select minimum incoherence scores Is and and set corresponding yi 
% to adaptive voter output. (Algorithm step 3)
[MinValue minIndex]=min([Is(1) Is(2) Is(3) Is(4) Is(5)]);
minIndex;
switch minIndex
    case 1,
        AdaptiveVoterOutput=y1;
    case 2,
        AdaptiveVoterOutput=y2;
    case 3,
        AdaptiveVoterOutput=y3;
    case 4,
        AdaptiveVoterOutput=y4;
    case 5,
        AdaptiveVoterOutput=y5;
end
        
% Update incoherence history Rs for all redundant module outputs
% y1,y2,y3,y4,y5 (Algorithm step 4)
Rs(1)=Alfa*HammingDist(y1,AdaptiveVoterOutput)/m+(1-Alfa)*Rs(1);
Rs(2)=Alfa*HammingDist(y2,AdaptiveVoterOutput)/m+(1-Alfa)*Rs(2);
Rs(3)=Alfa*HammingDist(y3,AdaptiveVoterOutput)/m+(1-Alfa)*Rs(3);
Rs(4)=Alfa*HammingDist(y4,AdaptiveVoterOutput)/m+(1-Alfa)*Rs(4);
Rs(5)=Alfa*HammingDist(y5,AdaptiveVoterOutput)/m+(1-Alfa)*Rs(5);

Contact us at files@mathworks.com