op_tbl_pat_gain()
Abstract
Obtains an antenna pattern gain value from an antenna pattern model.
Syntax
op_tbl_pat_gain (pat_tbl_ptr, polar, azimuth)
| Argument | Type | Description |
|---|---|---|
pat_tbl_ptr |
Pattern_Handle |
pattern [This value is a pointer to the antenna pattern table, which can be obtained with op_tbl_pattern_get().] |
polar |
double |
polar angle of the direction-of-interest [This value is in units of degrees, and should be in the range 0 to 180.] |
azimuth |
double |
azimuth angle of the direction-of-interest [This value is in units of degrees, and should be in the range 0 to 360.] |
Return Type
double
Value of the antenna pattern gain corresponding to the specified direction angles.
Example
Excerpt from: example model (models/std/base); pipeline model (dra_ragain).
/* Setup the angles at which to lookup gain... */
lookup_polar = 90.0 - tx_polar;
lookup_azimuth = tx_azimuth;
/* Obtain gain of antenna pattern at given angles. */
gain = op_tbl_pat_gain (pattern_table, lookup_polar, lookup_azimuth);
/* Set the rx antenna gain in the packet's transmission data attribute. */
op_td_set_dbl (pkptr, OPC_TDA_RA_RX_GAIN, gain);
Details
In a radio communications link, directional antenna patterns can significantly affect the quality of data transmission. The effect of directional antenna gain must be factored into a link model for realistic results. In the Transceiver Pipeline, every possible radio link is considered separately, involving a particular active radio transmitter and candidate radio receiver. The gain of the active transmitter antenna pattern pointing in the direction of the candidate receiver, and the gain of the candidate receiver antenna pattern pointing in the direction of the active transmitter, are derived with the aid of this KP (and a large amount of prior trigonometric computations that derive the appropriate phi and theta angles used as indices into the antenna pattern table).
This KP looks up the requested gain in the antenna pattern table. No interpolation is performed.
Purpose
Provides a mechanism to convert a particular antenna direction into a gain value corresponding to that direction, using an antenna pattern model that has been loaded into a simulation data table. The direction is represented by polar and azimuth angle values, which are typically computed and passed to this KP in the Transmitter Antenna Gain Model (Stage 4 of the Radio Pipeline; the default model of this stage is stored in the file dra_tagain.ps.c) and the Receiver Antenna Gain Model (Stage 6 of the Radio Pipeline; the default model of this stage is stored in the file dra_ragain.ps.c). The resulting gain values are stored in the packet, for use by the Received Power Model (Stage 7 of the Radio Pipeline).
Errors
- Program Abort: Segmentation violation. (due to an invalid table ID)
Reference
- Use the KP op_tbl_pat_gain_ext() to get an antenna pattern gain value and additional information from an antenna pattern model
- Use the KP op_tbl_mod_ber() to look up a Bit-Error-Rate value in a modulation format model table
- Use the KP op_tbl_pattern_get() to obtain an antenna pattern table pointer (alternatively, op_td_get_ptr(), applied to the OPC_TDA_RA_RX_PATTERN or OPC_TDA_RA_TX_PATTERN transmission data attribute, will also obtain an antenna pattern table pointer)
- Use the KP op_td_set_dbl(), applied to the OPC_TDA_RA_RX_GAIN or OPC_TDA_RA_TX_GAIN transmission data attributes, to store a computed gain value into a packet’s transmission data