Stage 11: Bit Error Rate
The bit error rate (BER) stage is the twelfth stage of the radio transceiver pipeline, and is specified by the “ber 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 completes reception 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
These circumstances correspond to the ends of periods during which the packet’s SNR is taken to be constant. (For more information on constant-SNR intervals, refer to Stage 10: Signal-to-Noise Ratio.)
The purpose of the BER stage is to derive the probability of bit errors during the past interval of constant SNR. This is not the empirical rate of bit errors, but the expected rate, usually based on the SNR. In general, the bit error rate provided by this stage is also a function of the type of modulation used for the transmitted signal.
The Simulation Kernel requires that the BER stage procedure accept a packet address as its sole argument. The computed BER is then expected by the Kernel within the TDA represented by the symbolic constant OPC_TDA_RA_BER. The assigned value should double-precision floating-point number between zero and one (inclusive). No other results are required. Syntax requirements for this stage are specified in Figure 98.
Figure 98: Templates for Radio Transceiver Pipeline: Bit-Error-Rate Stage
Not MT-safe (will execute sequentially in a parallel simulation):
void
ber_template (Packet* pk)
{
double result;
FIN (ber_template (Packet* pk))
/* extract required information from packet. */
/* perform calculation of bit-error-rate. */
/* place result in TDA for Kernel & later stages. */
op_td_set_dbl (pk, OPC_TDA_RA_BER, result);
FOUT
}
MT-safe (can execute in parallel in a parallel simulation):
void
ber_template_mt (OP_SIM_CONTEXT_ARG_OPT_COMMA Packet* pk)
{
double result;
FIN_MT (ber_template (Packet* pk))
/* extract required information from packet. */
/* perform calculation of bit-error-rate. */
/* place result in TDA for Kernel & later stages. */
op_td_set_dbl (pk, OPC_TDA_RA_BER, result);
FOUT
}