Stage 10: Signal-to-Noise Ratio

The signal-to-noise ratio (SNR) stage is the eleventh stage of the radio transceiver pipeline, and is specified by the “snr model” attribute of the radio receiver. It can be executed for a valid packet (as determined by the channel match stage) under three circumstances:

  • the packet arrives at its destination channel
  • the packet is already being received and another packet (valid or invalid) arrives
  • the packet is already being received and another packet (valid or invalid) completes reception

Clearly, the first circumstance occurs exactly once for each packet, and the second and third can occur any number of times depending upon the transmission activities of other transmitters in the model. The three types of invocations define intervals over which a packet’s average power SNR is taken to be constant (of course, this is an approximation when mobility is involved, because SNR would be continuously varying).

The purpose of SNR stage is to compute the current average power SNR result for the arriving packet. This calculation is usually based on values obtained during earlier stages, including received power, background noise, and interference noise. The SNR of the packet is an important performance measure that supports determination of the receiver’s ability to correctly receive the packet’s content. The result computed by this stage is used by the Kernel to update standard output results of receiver channels and usually also by later stages of the pipeline.

The Simulation Kernel requires that the SNR stage procedure accept a packet address as its sole argument. The computed SNR is then expected by the Kernel within the TDA represented by the symbolic constant OPC_TDA_RA_SNR. The assigned value should be a double-precision floating-point number expressed in decibels (dB). No other results are required. Syntax requirements for this stage are specified in Figure 97.

Figure 97: Templates for Radio Transceiver Pipeline: Signal-to-Noise Ratio Stage

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

void
snr_template (Packet* pk)
	{
	double result;

	FIN (snr_template (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of average-power SNR (in dB). */

	/* place result in TDA to make available to Kernel & later stages. */
	op_td_set_dbl (pk, OPC_TDA_RA_SNR, result);

	FOUT
	}

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

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

	FIN_MT (snr_template (Packet* pk))

	/* extract required information from packet. */

	/* perform calculation of average-power SNR (in dB). */

	/* place result in TDA to make available to Kernel & later stages. */
	op_td_set_dbl (pk, OPC_TDA_RA_SNR, result);

	FOUT
	}