-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathlaunchFullDownlinkSimulation.m
50 lines (37 loc) · 1.6 KB
/
launchFullDownlinkSimulation.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%% Simulator Launcher File
% launches link level scenario
%%
clc; close all; clear;
% Print copyright
tools.printCopyright
%% Launch simulation
% Get simulation parameters
simuParams = scenarios.scenarioFullDownlink();
% Parameters
numFrames = simuParams.numFrames;
bsParams = simuParams.bsParams;
topoParams = simuParams.topoParams;
chlParams = simuParams.chlParams;
% gNB parameters
carrier = bsParams.carrier;
pdsch = bsParams.PDSCHs.Config;
pdschExt = bsParams.PDSCHs.Extension;
waveInfo = bsParams.waveformInfo;
% Channel parameters
channel = chlParams.channel;
% Time parameters
numSlots = numFrames*carrier.SlotsPerFrame;
% HARQ, DLSCH and precoding matrix set up for link transmission
[harq, dlsch, newWtx] = communication.preProcessing.fullDownlinkTransmissionSetup(pdsch, pdschExt, channel, carrier);
% Downlink grid mapping and transmitting
nTxAnts = prod(bsParams.antConfig.bsTxAntSize);
[rdrTxGrid, rdrTxWave] = communication.fullDownlinkTransmit(numFrames, carrier, pdsch, pdschExt, nTxAnts, newWtx, harq, dlsch);
% Radar mono-static detection and estimation
rdrEstParams = sensing.preProcessing.radarParams(numSlots, carrier, waveInfo, bsParams, topoParams);
cfar = sensing.detection.cfarConfig(rdrEstParams);
rdrRxGrid = sensing.monoStaticSensing(rdrTxWave, carrier, waveInfo, bsParams, rdrEstParams);
estResults = sensing.estimation.fft2D(rdrEstParams, cfar, rdrRxGrid, rdrTxGrid);
% Plot topology
networkTopology.plotTopology(bsParams, estResults)
% Get estimation RMSEs
estRMSE = sensing.postProcessing.getRMSE(estResults, rdrEstParams);