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]=AdaptiveVoterIncScoNBitMajBitDynamic(y1,y2,y3,y4,y5,Rs,Beta,Alfa)
function [AdaptiveVoterOutput,yc,Is,Rs]=AdaptiveVoterIncScoNBitMajBitDynamic(y1,y2,y3,y4,y5,Rs,Beta,Alfa)
[m n]=size(y1);
% Calculate yc majority voting output for modules outputs y1,y2,y3
% ,y4,y5 (Algorithm step 1)
for i=1:n
yc(i)=MajorityVoting(y1(i),y2(i),y3(i),y4(i),y5(i));
end

% 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 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

Vth=0.0010;
AllFaultyIndicator=(Rs(1)>Vth)&(Rs(2)>Vth)&(Rs(3)>Vth)&(Rs(4)>Vth)&(Rs(5)>Vth);
    
if AllFaultyIndicator==0
    BetaDynamic=0.3;
    AlfaDynamic=0.1;
else
    AdaptiveVoterOutput=yc;
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