%music.m
%high resolution DOA Estimation
clear all
clc
tic
%parameters
M=8; %size of antenna array
doa=[-2 1 10]/180*pi;%doa targets
P=length(doa);%num of targets
f=7.7e10;%frequency of wave
c=3e8;%speed of light
lambda=f/c;%lambda of wave
d=lambda/2;%array spacing
snr=10;%signal/noise rate(dB)
N=1024;%samples of received signal(snapshots)
peak_thres = -20;%peak searching threshold(dB)
%FMCW
% for i=-fix(N/2):fix(N/2)-1
% Chirp(i+fix(N/2)+1)=exp(1j*(pi*FMR*(i/Fs)^2));
% end
% coeff=conj(fliplr(Chirp));
%antenna model
for i=1:P
A(:,i)=exp(-j*2*pi*d*[0:M-1]'/lambda*sin(doa(i)));
end
%signal source model
for k=1:P
S(k,:)=sqrt(10.^(snr/10))*(randn(1,N)+j*randn(1,N));
end
%load from file
%X_raw = csvread('RadarData/20171121_a5_b2_a8_b3.csv');
%X = zeros(size(X_raw,1), M);
%for i=1:4
% X(:,i) = (X_raw(:, 2*i-1) + 1j*X_raw(:, 2*i)) / 32767.0;
%end
%received signal
X=A*S+1/sqrt(2)*(randn(M,N)+j*randn(M,N));
%svd decomposition of the covarience matrix
R=X*X'/N;
[V,D,U]=svd(R);
US=V(:,1:P);%noise space
%music spectrum computing
theta=-30:0.1:30;
I=eye(M);
for ii=1:length(theta)
a=exp(-j*2*pi*d*(0:M-1)'*sin(theta(ii)/180*pi)/lambda);
Pmusic(ii)=abs(1/(a'*(I-US*US')*a));
end
Pmusic=10*log10(Pmusic/max(Pmusic)); %unify & convert to dB
%peak searching
for ii=1:length(theta)
if ii > 2 && (Pmusic(ii-1)>Pmusic(ii) && Pmusic(ii-1)>Pmusic(ii-2) && Pmusic(ii-1)>peak_thres)
disp(['peak at angle ', num2str(theta(ii))])
end
end
%graph
figure(1)
plot(theta,Pmusic)
legend('classic music')
xlabel('theta/deg')
ylabel('unified Pmusic/dB')
title('classic music spectrum')
grid on
toc
music.m.zip_DOA estimation_doa algorithm_music_music doa_radar
版权申诉
37 浏览量
2022-07-15
12:37:29
上传
评论
收藏 1KB ZIP 举报
alvarocfc
- 粉丝: 108
- 资源: 1万+
最新资源
- python开心麻花影视作品分析程序+源码.zip
- pythonExcel数据分析师程序+源码.zip
- PlatformUI.jar 支持RCP控件环境插件
- 基于BP神经网络的回归分析,基于优化动量因子的BP神经网络,基于优化学习率的BP神经网络,基于优化隐藏层神经元的bp神经网络
- python读取excel数据Python-file-reading-master.zip
- STC15单片机串口2使用程序例子
- 读取日志的excel生成周报 用python3开发weekplan-master.zip
- python 读取excel数据导入dbimport-data-master.zip
- K折交叉验证BP神经网络,多输入多输出BP神经网络(代码完整,数据齐全)
- B07训练原图.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0