Stage 7: Receiver Power

The receiver power stage is the eighth stage of the radio transceiver pipeline, and is specified by the “power model” attribute of the radio receiver. It is executed separately for each eligible destination channel; invocation takes place immediately after return of the receiver antenna gain model, with no simulation time elapsing in between. The purpose of this stage is to compute the received power of the arriving packet’s signal (in watts).

For packets that are classified as valid, the received power result is a key factor in determining the ability of the receiver to correctly capture the information in the packet. For packets that are classified as noise, received power still must usually be evaluated to support calculation of relative strengths of valid and noise packets. (Packets are classified as valid, invalid, or ignored by the channel match model. For more information about this classification, see Stage 3: Channel Match.)

In general, the calculation of received power is based on factors such as the power of the transmitter, the distance separating the transmitter and the receiver, the transmission frequency, and transmitter and receiver antenna gains. The Simulation Kernel requires that the received power stage procedure accept a packet address as its sole argument. The computed received power is then expected by the Kernel within the TDA represented by the symbolic constant OPC_TDA_RA_RCVD_POWER. The assigned value should be a nonnegative double-precision floating-point number. No other results are required. Syntax requirements for this stage are specified in Figure 94.

Figure 94: Templates for Radio Transceiver Pipeline: Received Power Stage

Not MT-safe (will execute sequentially in a parallel simulation):

void
received_power (Packet* pk)
	{
	double result;

	FIN (received_power (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of received power (in watts). */

	/* place result in TDA for Kernel & later stages. */
	op_td_set_dbl (pk, OPC_TDA_RA_RCVD_POWER, result);

	FOUT
	}

MT-safe (can execute in parallel in a parallel simulation):

void
received_power_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* pk)
	{
	double result;

	FIN_MT (received_power (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of received power (in watts). */

	/* place result in TDA for Kernel & later stages. */
	op_td_set_dbl (pk, OPC_TDA_RA_RCVD_POWER, result);

	FOUT
	}