Stage 4: Transmitter Antenna Gain
The transmitter antenna gain stage is the fifth stage of the radio transceiver pipeline, and is specified by the “tagain model” attribute of the radio transmitter. It is executed separately for each destination channel, except those that failed the link closure stage and those with respect to which the channel match stage has classified the transmission as “ignored”. Invocation of the transmitter antenna gain stage takes place immediately after return from the channel match stage, with no simulation time elapsing in between.
The purpose of the transmitter antenna gain stage is to determine the gain provided by the transmitter’s associated antenna, based on the direction of the vector leading from the transmitter to the receiver. The Simulation Kernel does not itself use this result, but it is typically factored into the received power computation of stage 7.
By measuring or computing gain over a range of directions, a three-dimensional antenna pattern can be constructed that characterizes an antenna’s effect with respect to the various directions of transmission. For details about the creation and use of antenna patterns in Modeler, refer to “Antenna Pattern Editor” on page 231.
In general, the transmitter antenna gain stage first calculates the direction vector separating the transmitter and the receiver, then uses knowledge of the antenna pattern to determine the antenna gain provided to the transmission. Pointing of the antenna is typically also accounted for by this pipeline stage. Pointing is controlled by a set of antenna attributes, as described in “Antenna Pointing” on page 56. Pipeline stages can determine antenna pointing by reading the values of these attributes directly from the antenna object.
The Simulation Kernel reserves a TDA, represented by the symbolic constant OPC_TDA_RA_TX_GAIN, to store the result of the transmitter antenna gain stage and to make it available to later stages of the pipeline. The Simulation Kernel requires that the stage’s procedure accept a packet address as its sole argument. Syntax requirements for this stage are specified in Figure 91.
Figure 91: Templates for Radio Transceiver Pipeline: Transmitter Antenna Gain Stage
Not MT-safe (will execute sequentially in a parallel simulation):
void
tx_antenna_gain_template (Packet* pk)
{
double result;
FIN (tx_antenna_gain_template (Packet* pk))
/* extract required information from packet. */
/* perform calculation of tx antenna gain. */
/* place result in TDA to make available for later stages. */
op_td_set_dbl (pk, OPC_TDA_RA_TX_GAIN, result);
FOUT
}
MT-safe (can execute in parallel in a parallel simulation):
void
tx_antenna_gain_template_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* pk)
{
double result;
FIN_MT (tx_antenna_gain_template (Packet* pk))
/* extract required information from packet. */
/* perform calculation of tx antenna gain. */
/* place result in TDA to make available for later stages. */
op_td_set_dbl (pk, OPC_TDA_RA_TX_GAIN, result);
FOUT
}