%% Transmission Over TDL-D Channel Model with Cross-Polar Antennas
% Display the waveform spectrum received through a tapped delay line (TDL) channel model using delay profile TDL-D from TR 38.901 Section 7.7.2.
% Configure 4-by-2, high-correlation, cross-polar antennas as specified in TS 36.101 Annex B.2.3A.3.

tdl = nrTDLChannel;
tdl.NumTransmitAntennas = 4;
tdl.DelayProfile = 'TDL-D';
tdl.DelaySpread = 10e-9;
tdl.KFactorScaling = true;
tdl.KFactor = 7.0;
tdl.MIMOCorrelation = 'High';
tdl.Polarization = 'Cross-Polar';

%  Create a random waveform of 1 subframe duration with 4 antennas.

SR = 1.92e6;
T = SR * 1e-3;
tdl.SampleRate = SR;
tdlinfo = info(tdl);
Nt = tdlinfo.NumTransmitAntennas;
 
txWaveform = complex(randn(T,Nt),randn(T,Nt));

% Transmit the input waveform through the channel.

rxWaveform = tdl(txWaveform);

% Plot the received waveform spectrum.

analyzer = dsp.SpectrumAnalyzer('SampleRate',tdl.SampleRate);
analyzer.Title = ['Received Signal Spectrum ' tdl.DelayProfile];
analyzer(rxWaveform);

% Copyright 2018 The MathWorks, Inc.
%
%