% Stochastic maximum likehood algorithm
clear all;
close all;
clc;
M = 8; % 阵元数
snapshots = 1024; % 信号长度
w = pi/4; % 信号频率
lambda = (2*pi*3e8)/w; % 信号波长
d = 0.5*lambda; % 阵元间距
snr = 5; % 信噪比
source_doa = 30; % 两个信号的入射角度
D = length(source_doa); % 信源数
A_SOI = [exp(-1j*(0:M-1)*d*2*pi*sind(source_doa)/lambda)].'; % 阵列流型
s = sqrt(10.^(snr/10))*wgn(snapshots,1,1,'complex')';
n = (1/sqrt(2))*(randn(M,snapshots)+1j*randn(M,snapshots));
x = A_SOI*s + n; % 含高斯白噪声接收信号
R_x = x*x'/snapshots;
searching = -90:0.1:90; % 线阵的搜索范围为-90~90度
% for i = 1:length(searching)
% A_theta = exp(-1j*(0:M-1)'*2*pi*d*sind(searching(i))/lambda);
% % piA_theta = pinv(A_theta);
% Pi_A_theta = A_theta*pinv(A_theta);
% oPi_A_theta = eye(size(Pi_A_theta))-Pi_A_theta;
% sigma_SML(i) = trace(oPi_A_theta)/(M-D);
% P = pinv(A_theta)*(R-sigma_SML(i)*eye(M))*(A_theta);
% P_SML(i) = log(det(A_theta*P*A_theta' + sigma_SML(i)*eye(M)));
% end
for i = 1:length(searching)
A = exp(-1j*(0:M-1)'*2*pi*d*sind(searching(i))/lambda);
A_plus = inv(A'*A)*A';
P_A = A*A_plus;
Pc_A = eye(M) - P_A;
sigma_SML(i) = trace(Pc_A*R_x)/(M-D);
P_SML(i) = log(sigma_SML(i)^(M-D)*det(A_plus*R_x*A));
end
% plot(searching,10*log10(P_SML./max(P_SML)));
plot(searching,P_SML);
for i = length(source_doa)
xline(source_doa(i),'--');
end
xlabel('theta/degree');
ylabel('P-SML/dB');
title('SML Algorithm for DOA');
grid on;
DOA估计 - DML(deterministic ML) & SML(stochastic ML)
需积分: 0 169 浏览量
2023-06-03
17:06:33
上传
评论 1
收藏 2KB ZIP 举报
懒羊羊爱吃枇杷
- 粉丝: 5
- 资源: 2
最新资源
- 蓝桥杯2024年第十五届省赛真题-前缀总分
- com.qihoo.appstore_300101305-1.apk
- tensorflow-gpu-2.7.1-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-2.7.2-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-2.7.1-cp39-cp39-manylinux2010-x86-64.whl
- 蓝桥杯2024年第十五届省赛真题-传送阵
- com.qihoo.appstore_300101305.apk
- linux之线程同步一.doc
- keil5配色方案10种
- python烟花代码.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈