| | 113 | 4. Configure Tx/Rx. This example uses the built-in TR 38.901 Antenna Pattern operating at 3.7 GHz: |
| | 114 | |
| | 115 | {{{ |
| | 116 | #!python |
| | 117 | # Set the operating frequency (n48 band for 5G) |
| | 118 | scene.frequency = 3.7e9 # 3.7 GHz |
| | 119 | |
| | 120 | # Define Rx position |
| | 121 | ue_position = [10.0, 0.0, 0.0] # Rx position (x, y, z in meters) |
| | 122 | |
| | 123 | # Define Tx position |
| | 124 | gnb_position = [0.0, 0.0, 20.0] |
| | 125 | |
| | 126 | # gNB antenna: 3GPP TR 38.901 pattern (AIRSTRAN D 2200) |
| | 127 | gnb_pattern_factory = antenna_pattern_registry.get("tr38901") |
| | 128 | gnb_pattern = gnb_pattern_factory(polarization="V") |
| | 129 | |
| | 130 | # UE antenna: Isotropic pattern (typical for mobile devices) |
| | 131 | # This will be required for matching the calculations of the RadioMapSolver() |
| | 132 | ue_pattern_factory = antenna_pattern_registry.get("iso") |
| | 133 | # Polarization should also match the transmitter |
| | 134 | ue_pattern = ue_pattern_factory(polarization="V") |
| | 135 | |
| | 136 | # SISO: Single antenna element at origin [0, 0, 0] for both TX and RX |
| | 137 | single_element = np.array([[0.0, 0.0, 0.0]]) # Shape: (1, 3) |
| | 138 | |
| | 139 | # Configure antenna arrays |
| | 140 | scene.tx_array = AntennaArray( |
| | 141 | antenna_pattern=gnb_pattern, |
| | 142 | normalized_positions=single_element.T # Shape: (3, 1) |
| | 143 | ) |
| | 144 | |
| | 145 | scene.rx_array = AntennaArray( |
| | 146 | antenna_pattern=ue_pattern, |
| | 147 | normalized_positions=single_element.T # Shape: (3, 1) |
| | 148 | ) |
| | 149 | |
| | 150 | # Create Rx |
| | 151 | rx = Receiver(name="ue", position=ue_position, display_radius=0.03) |
| | 152 | scene.add(rx) |
| | 153 | |
| | 154 | # Create Tx |
| | 155 | tx = Receiver(name="gnb", position=gnb_position, display_radius=0.03) |
| | 156 | scene.add(tx) |
| | 157 | |
| | 158 | }}} |
| | 159 | |