In MATLAB's 5G Toolbox, both "TransmissionDirection" and "swapTransmitAndReceive" are used to handle the direction of the transmission in a channel model, but they serve slightly different purposes and contexts.
The "TransmissionDirection" property of the "nrTDLChannel" object specifies whether the channel is being used for downlink (DL) or uplink (UL) transmission. This property adjusts the channel model parameters to reflect the characteristics of the transmission direction.
For example:
channel.TransmissionDirection = 'Uplink';
Setting this property ensures that the channel model correctly represents the physical layer characteristics for the specified direction, such as path loss, delay spread, etc.
The "swapTransmitAndReceive" function is used to reverse the roles of the transmitter and receiver in a given channel model. This can be useful when you want to reuse a channel model for both uplink and downlink transmissions without creating a new channel object.
For example, if you have a channel object configured for downlink transmission and you want to use the same object for uplink transmission, you can use "swapTransmitAndReceive" to swap the roles:
swapTransmitAndReceive(channel);
To summarise:
- "TransmissionDirection": This property is set when creating or configuring the channel object to define its primary usage (DL or UL). It ensures that all relevant parameters are set correctly for the specified direction.
- "swapTransmitAndReceive": This function is used to dynamically swap the roles of transmitter and receiver in an existing channel object. This is useful in scenarios where the same channel object needs to be used for both directions without reconfiguring or recreating it.
In the example, "swapTransmitAndReceive" is used since by default, the CDL channel is configured for downlink transmissions and we want to measure the physical uplink shared channel (PUSCH) throughput of the channel.
Please refer to the following resources for more information:
Hope this helps!