%% Transmission Over TDL Channel Model with Custom Delay Profile
% Transmit waveform through a tapped delay line (TDL) channel model from TR 38.901 Section 7.7.2 with customized delay profile.
% Define the channel configuration structure using an nrTDLChannel System object. Customize the delay profile with two taps.
% First tap: Rician with average power 0 dB, K-factor 10 dB, and zero delay.
% Second tap: Rayleigh with average power -5 dB, and 45 ns path delay using TDL-D.

tdl = nrTDLChannel;
tdl.NumTransmitAntennas = 1;
tdl.DelayProfile = 'Custom';
tdl.FadingDistribution = 'Rician';
tdl.KFactorFirstTap = 10.0;
tdl.PathDelays = [0.0 45e-9];
tdl.AveragePathGains = [0.0 -5.0];

% Create a random waveform of 1 subframe duration with 1 antenna.

SR = 30.72e6;
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);

% Copyright 2018 The MathWorks, Inc.