close all
%neymanpearson.m
y=[1 1];
z=3;
pfa=0.01;
len=1000;
pdcolbeforedetection1=[];
pfacolbeforedetection1=[];
pdcolafterdetection1=[];
pfacolafterdetection1=[];
x=[0.8 0.7];
for p0=0.01:1/1000:0.99
[datatx,datarx,datadetected,bayesruleselected,pl,ph,val_pl,val_ph,...
pd,gamma,pd_obtained_beforedetection,pfa_obtained_beforedetection,...
pd_obtained_afterdetection,pfa_obtained_afterdetection]...
=binarychanneldetection(x,y,z,len,p0,pfa);
pdcolbeforedetection1=[pdcolbeforedetection1 pd_obtained_beforedetection];
pfacolbeforedetection1=[pfacolbeforedetection1 pfa_obtained_beforedetection];
pdcolafterdetection1=[pdcolafterdetection1 pd_obtained_afterdetection];
pfacolafterdetection1=[pfacolafterdetection1 pfa_obtained_afterdetection];
end
figure
plot(pfacolbeforedetection1,pdcolbeforedetection1,'*')
figure
plot(pfacolafterdetection1,pdcolafterdetection1,'*')
pdcolbeforedetection2=[];
pfacolbeforedetection2=[];
pdcolafterdetection2=[];
pfacolafterdetection2=[];
x=[0.4 0.8];
for p0=0.01:1/1000:0.99
[datatx,datarx,datadetected,bayesruleselected,pl,ph,val_pl,val_ph,...
pd,gamma,pd_obtained_beforedetection,pfa_obtained_beforedetection,...
pd_obtained_afterdetection,pfa_obtained_afterdetection]...
=binarychanneldetection(x,y,z,len,p0,pfa);
pdcolbeforedetection2=[pdcolbeforedetection2 pd_obtained_beforedetection];
pfacolbeforedetection2=[pfacolbeforedetection2 pfa_obtained_beforedetection];
pdcolafterdetection2=[pdcolafterdetection2 pd_obtained_afterdetection];
pfacolafterdetection2=[pfacolafterdetection2 pfa_obtained_afterdetection];
end
figure
plot(pfacolbeforedetection2,pdcolbeforedetection2,'*')
figure
plot(pfacolafterdetection2,pdcolafterdetection2,'*')
pdcolbeforedetection3=[];
pfacolbeforedetection3=[];
pdcolafterdetection3=[];
pfacolafterdetection3=[];
x=[0.7 0.2];
for p0=0.01:1/1000:0.99
[datatx,datarx,datadetected,bayesruleselected,pl,ph,val_pl,val_ph,...
pd,gamma,pd_obtained_beforedetection,pfa_obtained_beforedetection,...
pd_obtained_afterdetection,pfa_obtained_afterdetection]...
=binarychanneldetection(x,y,z,len,p0,pfa);
pdcolbeforedetection3=[pdcolbeforedetection3 pd_obtained_beforedetection];
pfacolbeforedetection3=[pfacolbeforedetection3 pfa_obtained_beforedetection];
pdcolafterdetection3=[pdcolafterdetection3 pd_obtained_afterdetection];
pfacolafterdetection3=[pfacolafterdetection3 pfa_obtained_afterdetection];
end
figure
plot(pfacolbeforedetection3,pdcolbeforedetection3,'*')
figure
plot(pfacolafterdetection3,pdcolafterdetection3,'*')
pdcolbeforedetection4=[];
pfacolbeforedetection4=[];
pdcolafterdetection4=[];
pfacolafterdetection4=[];
x=[0.4 0.2];
for p0=0.01:1/1000:0.99
[datatx,datarx,datadetected,bayesruleselected,pl,ph,val_pl,val_ph,...
pd,gamma,pd_obtained_beforedetection,pfa_obtained_beforedetection,...
pd_obtained_afterdetection,pfa_obtained_afterdetection]...
=binarychanneldetection(x,y,z,len,p0,pfa);
pdcolbeforedetection4=[pdcolbeforedetection4 pd_obtained_beforedetection];
pfacolbeforedetection4=[pfacolbeforedetection4 pfa_obtained_beforedetection];
pdcolafterdetection4=[pdcolafterdetection4 pd_obtained_afterdetection];
pfacolafterdetection4=[pfacolafterdetection4 pfa_obtained_afterdetection];
end
figure
plot(pfacolbeforedetection4,pdcolbeforedetection4,'*')
figure
plot(pfacolafterdetection4,pdcolafterdetection4,'*')