function H = hSetupAbstractChannel(numNodes)
%hSetupAbstractChannel TGax channel setup
%
%   This is an example helper function.
%
%   H = hSetupAbstractChannel(NUMNODES) sets up a TGax channel and returns
%   a frequency domain channel matrix H between multiple nodes in a
%   simulation, where NUMNODES is the number of nodes in the simulation.
%   The channel and OFDM configuration is assumed to be the same for all
%   links in the simulation.
% 
%   H is an array of size Nst-by-Ntx-by-Nrx-by-Nl where Nst is the number
%   of active subcarriers, Ntx is the number of transmit antennas, Nrx is
%   the number of receive antennas and Nl is the number of links.

%   Copyright 2019 The MathWorks, Inc.

    if numNodes < 2
        error('At least two nodes are required in a WLAN network to create a channel matrix');
    end
    
    cfg = wlanHESUConfig('ChannelBandwidth','CBW20');
    chan = wlanTGaxChannel('ChannelFiltering',false,'NumSamples',1);
    H = generateChannels(chan,numNodes,cfg);
end