-
Notifications
You must be signed in to change notification settings - Fork 1
/
plotPRSCorr.m
43 lines (30 loc) · 1.05 KB
/
plotPRSCorr.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function plotPRSCorr(carrier,corr,sr)
% plotPRSCorr(CARRIER,CORR,SR) plots PRS-based correlation for each gNB
% CORR, given the array of carrier-specific configuration objects CARRIER
% and the sampling rate SR.
numgNBs = numel(corr);
colors = getColors(numgNBs);
figure;
hold on;
% Plot correlation for each gNodeB
t = (0:length(corr{1}) - 1)/sr;
legendstr = cell(1,2*numgNBs);
for gNBIdx = 1:numgNBs
plot(t,abs(corr{gNBIdx}), ...
'Color',colors(gNBIdx,:),'LineWidth',2);
legendstr{gNBIdx} = sprintf('gNB%d (NCellID = %d)', ...
gNBIdx,carrier(gNBIdx).NCellID);
end
% Plot correlation peaks
for gNBIdx = 1:numgNBs
c = abs(corr{gNBIdx});
j = find(c == max(c),1);
plot(t(j),c(j),'Marker','o','MarkerSize',5, ...
'Color',colors(gNBIdx,:),'LineWidth',2)
legendstr{numgNBs+gNBIdx} = '';
end
legend(legendstr);
xlabel('Time [s]')
ylabel('Absolute value');
title('PRS Correlation for All gNBs');
end