op_tbl_mod_ber()
Abstract
Obtains the mean bit error rate (BER) corresponding to the specified effective signal-to-noise ratio (SNR).
Syntax
op_tbl_mod_ber (modtbl_id, eff_snr)
| Argument | Type | Description |
|---|---|---|
modtbl_id |
Modulation_Handle |
modulation table ID [This value can be obtained with the KP op_tbl_modulation_get().] |
eff_snr |
double |
effective signal-to-noise ratio (SNR) [This value is in units of decibels (dB) and is typically a compound value based on the simple SNR computed by the SNR Model stage of the Transceiver Pipeline, plus processing gain contributions (as shown in the default BER Model listing below).] |
Return Type
double
Mean value of the bit error rate (BER) corresponding to the specified SNR.
Example
Excerpt from: example model (models/std/base); pipeline model (dra_ber).
/** Calculate the average bit error rate affecting given packet. **/
FIN (dra_ber (pkptr));
/* Determine current value of Signal-to-Noise-Ratio (SNR). */
snr = op_td_get_dbl (pkptr, OPC_TDA_RA_SNR);
/* Determine address of modulation table. */
modulation_table = op_td_get_ptr (pkptr, OPC_TDA_RA_RX_MOD);
/* Determine processing gain on channel. */
proc_gain = op_td_get_dbl (pkptr, OPC_TDA_RA_PROC_GAIN);
/* Calculate effective SNR incorporating processing gain. */
eff_snr = snr + proc_gain;
/* Derive expected BER from effective SNR. */
ber = op_tbl_mod_ber (modulation_table, eff_snr);
/* Place the BER in the packet's transmission data. */
op_td_set_dbl (pkptr, OPC_TDA_RA_BER, ber);
Details
If the specified effective SNR is less than the minimum SNR value or greater than the maximum SNR value, as defined in the specified table, the value will be mapped to the respective minimum or maximum value prior to table look-up.
Purpose
Provides a mechanism to convert an effective SNR value into a mean BER value, using a modulation function model which has been loaded into a simulation data table. The SNR value is typically obtained from the transmission data associated with a packet, having been computed and inserted into the packet in the SNR Model (Stage 10 of the Radio Pipeline; the default model of this stage is stored in the file dra_snr.ps.c). This KP is typically invoked in the BER Model (Stage 11 of the Radio Pipeline; the default model of this stage is stored in the file dra_ber.ps.c), as shown in the example on the previous page. The resulting BER value is stored in the packet, for use by the Error Allocation Model (Stage 12 of the Radio Pipeline).
Errors
- Program Abort: Segmentation violation. (due to an invalid table ID)
Reference
- Use the KP op_tbl_pat_gain() to look up a gain value in an antenna pattern model table
- Use the KP op_td_get_int(), applied to the OPC_TDA_RA_RX_MOD or OPC_TDA_RA_TX_MOD transmission data attributes, to obtain a modulation table ID
- Use the KP op_td_set_dbl(), applied to the OPC_TDA_RA_BER transmission data attribute, to store a computed BER value into a packet’s transmission data