双择检测:
clc
m=1;%噪声标准差
n=1;%信号标准差
c=0;%信号的均值
x=-5:0.001:5;
p0=(exp(-x.^2/(2*m^2)))/(sqrt(2*pi)*m);%H0的概率密度函数
p1=(exp(-(x-c).^2/(2*(m^2+n^2))))/(sqrt(2*pi*(m^2+n^2)));%H1的概率密度函数A=(a/sqrt(m^2+n^2))*exp(-(x-c).^2/(2*(m^2+n^2))+x.^2/(2*m^2));%似然比subplot(2,1,1);
plot(x,p0,x,p1,'--'); %概率密度函数图
hold on;
p=abs(p0-p1<0.005);
plot(x,p,'--black');
legend('p0','p1');
axis([-5,5,0,0.6]);
subplot(2,1,2);
plot(x,A);%似然比图
极大极小化准则:
for i = 1:20000
ph(i) = i/20000;
B(i) = 0.5 + log(0.5*(1-ph(i))/ph(i));
p1(i) = erfc(B(i)/sqrt(2))*0.5;
p2(i) = 1-erfc((B(i)-1)/sqrt(2))*0.5;
R(i) = p1(i)*(1-ph(i)) + 2*p2(i)*ph(i); end
grid on;
x=0.4;
B= 0.5 + log(0.5*(1-x)/x);
p1 = erfc(B/sqrt(2))*0.5;
p2 = 1-erfc((B-1)/sqrt(2))*0.5;
R1 = p1*(1-x) + 2*p2*x;
plot(ph,R,ph,R1);
正则化长细比超限怎么调整axis([0,1,0,0.5]);

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。