波束形成(1)

常规波束形成:
对阵列获得的空间信号进行加权,使波束指向某一空间方向。DOA估计时,利用阵列流行搜索,与来波的相关矩阵匹配,峰值处即为来波方向。
MUSIC算法:
将来波的相关矩阵进行特征值分解,划分信号空间和噪声空间,本文用噪声空间匹配来进行DOA估计。
(理论及其他方法后续补充,先贴自己写的代码,测试通过)
假设两个来波方向,可看出MUSIC方法优势

close all;
clear;
clc;
N = 10;%number of sensors
M = 2;
c = 1500;
f = 1000;
d = c/f/2;%distance between sensors
B = 62.5;
snr = 5;
temp = 0:N-1;
theta = [60;45];
% theta = [10;60;50];
tempr = repmat(temp,2,1);
theta = repmat(theta,1,N);
fs = 8192;
t = 1/fs:1/fs:0.1;
v = exp(j*2*pi*f/c*d.*cos(theta*pi/180).*tempr);
s = zeros(M,length(temp));
s1 = sqrt(2*10^(snr/10))*exp(j*2*pi*f*t);
 s2 = sqrt(2*10^(snr/10))*exp(j*2*pi*f*t);
% s3 = sqrt(2*10^(snr/10))*exp(j*2*pi*f*t);
% s = [s1;s2;s3];
%noise = rand()
s = [s1+awgn(s1,5,'measured');s2+awgn(s2,5,'measured')];
% 
% for i = 1:length(v)
% x(i,:) = x(i,:)+rand(1,length(s))+i*rand(1,length(s));
% end
x = v'*s;
r = x*x';
lmin = 0;
lmax = 90;
output=zeros(1,(lmax-lmin+1));
output1 = output;
jl = 1;
for thets = lmin:lmax
    vs = exp(j*2*pi*f/c*d*cos(thets*pi/180)*temp);
    output(jl) = vs*r*vs';
    jl = jl+1;
end
figure;
plot(lmin:lmax,abs(output))
[eigv eig1] = eig(r);
[rol col]=size(eigv);
[eigord point]= sort(diag(eig1));
%[valb,point] = find(diag(eig1)==eigord);
u = eigv(:,point);
% eigord = sort(diag(eig1));
% for l1 = 1:N-M
% [valb,point] = find(eig1==eigord(l1));
% u(:,l1) = eigv(:,point);
% end
jl = 1;
P1=zeros(1,length(lmin:lmax));
for thets = lmin:lmax
    vs = exp(j*2*pi*f/c*d*cos(thets*pi/180)*temp);
    output1(jl) = sum((vs*u(:,1:(N-M))).^2);
% for n=1:N-M
% P1(jl)= P1(jl)+(vs*u(:,n)).^2;
% end
    jl = jl+1;
end


figure;
plot(lmin:lmax,1./abs(output1))

波束形成(1)_第1张图片
波束形成(1)_第2张图片

你可能感兴趣的:(算法,matlab,阵列信号处理)