🍒🍒🍒欢迎关注🌈🌈🌈
📝个人主页:我爱Matlab
👍点赞➕评论➕收藏 == 养成习惯(一键三连)🌻🌻🌻🍌希望大家多多支持🍓~一起加油 🤗
💬语录:将来的我一定会感谢现在奋斗的自己!
AOA 定位方法,主要是测量信号移动台和基站之间的到达角度,以基站为起点形成的射线必经过移动台,两条射线的交点即为移动台的位置。该方法只需两个基站就可以确定 MS 的估计位置,其定位示意图如图所示。
%% Initialization
clear;
addpath(genpath('../Library/'));
params = getParams();
micUsed = params.micUsed;
fileName = '../data/ReSpeaker/example';
waveOrig = load([fileName '.mat']).wave(micUsed, :);
[~, waveLen] = size(waveOrig);
sampleRate = params.sampleRate;
readRate = params.readRate;
readNum = round(waveLen / sampleRate * readRate);
readSampleNum = params.readSampleNum;
sourceNum = params.sourceNum;
%% AoA Extraction
angleListY = zeros(readNum, sourceNum);
angleListZ = zeros(readNum, sourceNum);
for readIdx = 1: readNum
waveNow = waveOrig(:, ...
(readIdx - 1) * sampleRate / readRate + 1: (readIdx - 1) * sampleRate / readRate + readSampleNum);
[angleNowY, angleNowZ] = multipleSource(waveNow, sourceNum, params);
angleListY(readIdx, :) = angleNowY;
angleListZ(readIdx, :) = angleNowZ;
end
save([fileName '_result.mat'], 'angleListY', 'angleListZ');
%% Visualization
angleListGtY = ones(readNum, 1) * [25 61];
angleListGtZ = ones(readNum, 1) * [291 101];
figure(1);
subplot(1, 2, 1);
plot((1: readNum) / readRate, angleListY, 'x', ...
(1: readNum) / readRate, angleListGtY, 'linewidth', 2);
axis([0 readNum / readRate params.angleRangeY(1) params.angleRangeY(2)]);
legend('Est_1', 'Est_2', 'Gt_1', 'Gt_2');
title('Angle Y');
xlabel('Time (s)');
ylabel('AoA (Deg)');
subplot(1, 2, 2);
plot((1: readNum) / readRate, angleListZ, 'x', ...
(1: readNum) / readRate, angleListGtZ, 'linewidth', 2);
axis([0 readNum / readRate params.angleRangeZ(1) params.angleRangeZ(2)]);
legend('Est_1', 'Est_2', 'Gt_1', 'Gt_2');
title('Angle Z');
xlabel('Time (s)');
ylabel('AoA (Deg)');
[1]石月,戴雅伟.一种基于4G AoA的5G天线方位角调优方法[J].电信工程技术与标准化,2022,35(07):48-51.DOI:10.13992/j.cnki.tetas.2022.07.016.