%% TGax Channel Delay Profile and Path Gains
% Plot the delay profile and path gains of a TGax channel.
%
% Create an impulse.

input = zeros(100,4);
input(10) = 1;

%
% Create the TGax channel System Object. Enable path gains at the output, and specify path loss, 20 MHz of channel bandwidth, a 4x2 MIMO channel, four penetrated floors, and a sampling rate of 1 GHz.

tgax = wlanTGaxChannel;
tgax.LargeScaleFadingEffect = 'Pathloss';
tgax.ChannelBandwidth = 'CBW20';
tgax.NumTransmitAntennas = 4;
tgax.NumReceiveAntennas = 2;
tgax.NumPenetratedFloors = 4;
tgax.RandomStream = 'mt19937ar with seed';
tgax.Seed = 10;
tgax.SampleRate = 1e9;
tgax.PathGainsOutputPort = true;

%
% Filter the input impulse. Use the TGax channel object to generate the output response and the path gains.

[out,pathgains]= tgax(input);

%
% Plot the output impulse response of the channel. The channel has two delay profiles, one per each receive antenna.

figure
time = (1/tgax.SampleRate)*(0:length(input)-1);
stem(time,abs(out))
xlabel('Time (s)')
ylabel('Amplitude')
title('Delay Profile')

%
% The path gains of the channel are contained in a four dimensional array since the channel has nine resolvable paths, four transmit antennas and two receive antennas.

size(pathgains)

% Copyright 2012 The MathWorks, Inc.