预览加载中,请您耐心等待几秒...
1/5
2/5
3/5
4/5
5/5

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

clearall; closeall; echoon; display('Beginning'); echooff; N=50; SNRindB=-5; snr=10.^(SNRindB./10); a=[0.0050.010.0250.050.10.150.20.30.40.50.60.70.80.90.950.98]; CV=[4.5593.8573.0702.4921.9331.6101.4051.1260.9240.7730.6500.5450.4480.3460.2820.227]; %a=[0.980.960.930.90.80.60.50.40.30.20.10.050.010.0050.001]; exp_time=10000; %%%%%%%%%%%%%%%%%M是高斯信号%%%%%%%%%%%%%%%%%%%%%%% fori=1:length(a); display(i); count=[0000000000000000]; ave_segma_MLE=0; fork=1:exp_time %display(k);V %%%%产生高斯随机数,并进行处理%%%%%%%% R1=randn(1,N); R2=randn(1,N); R=(sqrt(snr).*R1+R2); Y=sort(R); %%%%%%%%%%%%%进行极大似然估计%%%%%%%%%%% %R3=sum(R)/N; %forw=1:N; %A(w)=(R(w)-R3).^2; %end %segma_MLE=sqrt(sum(A)/N); segma_MLE=1; temp2=0; forj=1:1:N %%%%假设的高斯分布函数F(x) %%%Z_i h1=@(t)((1/(sqrt(2*pi).*segma_MLE)).*exp((t.^2)/(-2*(segma_MLE.^2)))); F_Y1=quadl(h1,-10000,Y(j)); Z_1=F_Y1; %%%%Z_(N-i+1) h2=@(t)((1/(sqrt(2*pi).*segma_MLE)).*exp((t.^2)/(-2*(segma_MLE.^2)))); F_Y2=quadl(h2,-10000,Y(N-j+1)); Z_2=F_Y2; %%%%计算差值 temp2=temp2+(2*j-1)*(log(Z_1)+log(1-Z_2)); %temp2=temp2+(2*j-1)*(log(Z_1))+(2*N+1-2*j)*(log(1-Z_1)); end %A_n2=-N-temp2; A_n2=-N-(1/N)*temp2; %display(A_n2); ifA_n2>=CV(i) count(i)=count(i)+1; end count1(i)=count(i); end P1(i)=count1(i)/exp_time; display(P1(i)); %ave_segma_MLE=ave_segma_MLE/exp_time; %display(ave_segma_MLE); end %%%%%%%%%%%%%%%%%%%%M是正弦信号%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fori=1:length(a); display(i); count=[0000000000000000]; ave_segma_MLE=0; fork=1:exp_time %display(k); %%%%产生正弦信号随机数,并进行处理%%%%%%%% R=linspace(0,2*pi,N); forf=1:N; Y1(f)=sqrt(2)*sin((pi/3)*R(f)+(pi/3)); end %%%%产生高斯分布随机数,并进行排序处理 %X=raylrnd(segma_MLE,[1N]); %Y=sort(X); R1=randn(1,N); Y2=(sqrt(snr).*Y1+R1); Y=sort(Y2); %%%%%%%%%%%%%进行极大似然估计%%%%%%%%%%% %R2=sum(Y)/N; %forw=1:N; %A(w)=(Y(w)-R2).^2; %end %segma_MLE=sqrt(sum(A)/N); segma_MLE=1; temp2=0; forj=1:1:N %%%%假设的高斯分布函数F(x) %%%Z_i h1=@(t)((1/(sqrt(2*pi).*segma_MLE)).*exp((t.^2)/(-2*(segma_MLE.^2)))); F_Y1=quadl(h1,-10000,Y(j)); Z_1=F_Y1; %%%%Z_(N-i+1) h2=@(t)((1/(s