-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvalidateCarriers.m
61 lines (28 loc) · 1.25 KB
/
validateCarriers.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
function validateCarriers(carrier)
% validateCarriers(CARRIER) validates the carrier properties of all gNBs.
% Validate physical layer cell identities
cellIDs = [carrier(:).NCellID];
if numel(cellIDs) ~= numel(unique(cellIDs))
error('nr5g:invalidNCellID', 'Physical layer cell identities of all of the carriers must be unique.')
end
% Validate subcarrier spacings
scsVals = [carrier(:).SubcarrierSpacing]; % [kHz]
if ~isscalar(unique(scsVals))
error('nr5g:invalidSCS','Subcarrier spacing values of all of the carriers must be same.');
end
% Validate cyclic prefix lengths
cpVals = {carrier(:).CyclicPrefix};
if ~all(strcmpi(cpVals{1},cpVals))
error('nr5g:invalidCP','Cyclic prefix lengths of all of the carriers must be same.');
end
% Validate NSizeGrid values
nSizeGridVals = [carrier(:).NSizeGrid];
if ~isscalar(unique(nSizeGridVals))
error('nr5g:invalidNSizeGrid','NSizeGrid of all of the carriers must be same.');
end
% Validate NStartGrid values
nStartGridVals = [carrier(:).NStartGrid];
if ~isscalar(unique(nStartGridVals))
error('nr5g:invalidNStartGrid','NStartGrid of all of the carriers must be same.');
end
end