Stage 6: Receiver Antenna Gain
The receiver antenna gain stage is the seventh stage of the radio transceiver pipeline. It is the earliest stage associated with the radio receiver rather than the transmitter, being specified by the receiver’s “ragain model” attribute. It is executed separately for each eligible destination channel, and its invocation takes place at the time that the leading edge of the packet arrives at the receiver location (i.e., after the propagation delay has elapsed).
The purpose of the receiver antenna gain stage is to compute the gain provided by the receiver’s associated antenna, based on the direction of the vector leading from the receiver to the transmitter. The Simulation Kernel does not itself use this result, but it is typically factored into the received power computation of stage 7.
The concept of receiver antenna gain is identical to that of transmitter antenna gain, except that it is due to the physical configuration and implementation of the antenna associated with the receiver object. For information on antenna gain and antenna patterns, refer to Stage 4: Transmitter Antenna Gain.
The Simulation Kernel reserves a TDA, represented by the symbolic constant OPC_TDA_RA_RX_GAIN, to store the result of this 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 93.
Figure 93: Templates for Radio Transceiver Pipeline: Receiver Antenna Gain Stage
Not MT-safe (will execute sequentially in a parallel simulation):
void
rx_antenna_gain_template (Packet* pk)
{
double result;
FIN (rx_antenna_gain_template (Packet* pk))
/* extract required information from packet. */
/* perform calculation of rx antenna gain. */
/* place result in TDA to make available for later stages. */
op_td_set_dbl (pk, OPC_TDA_RA_RX_GAIN, result);
FOUT
}
MT-safe (can execute in parallel in a parallel simulation):
void
rx_antenna_gain_template_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* pk)
{
double result;
FIN_MT (rx_antenna_gain_template (Packet* pk))
/* extract required information from packet. */
/* perform calculation of rx antenna gain. */
/* place result in TDA to make available for later stages. */
op_td_set_dbl (pk, OPC_TDA_RA_RX_GAIN, result);
FOUT
}