anomaly-detection-material-parameters-calibration

Sionna param calibration (research proj)
git clone https://git.ea.contact/anomaly-detection-material-parameters-calibration
Log | Files | Refs | README

rma.py (4983B)


      1 #
      2 # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
      3 # SPDX-License-Identifier: Apache-2.0
      4 #
      5 """Rural macrocell (RMa) channel model from 3GPP TR38.901 specification"""
      6 
      7 import tensorflow as tf
      8 
      9 from . import SystemLevelChannel
     10 from . import RMaScenario
     11 
     12 
     13 class RMa(SystemLevelChannel):
     14     # pylint: disable=line-too-long
     15     r"""RMa(carrier_frequency, ut_array, bs_array, direction, enable_pathloss=True, enable_shadow_fading=True, always_generate_lsp=False, dtype=tf.complex64)
     16 
     17     Rural macrocell (RMa) channel model from 3GPP [TR38901]_ specification.
     18 
     19     Setting up a RMa model requires configuring the network topology, i.e., the
     20     UTs and BSs locations, UTs velocities, etc. This is achieved using the
     21     :meth:`~sionna.channel.tr38901.RMa.set_topology` method. Setting a different
     22     topology for each batch example is possible. The batch size used when setting up the network topology
     23     is used for the link simulations.
     24 
     25     The following code snippet shows how to setup an RMa channel model assuming
     26     an OFDM waveform:
     27 
     28     >>> # UT and BS panel arrays
     29     >>> bs_array = PanelArray(num_rows_per_panel = 4,
     30     ...                       num_cols_per_panel = 4,
     31     ...                       polarization = 'dual',
     32     ...                       polarization_type = 'cross',
     33     ...                       antenna_pattern = '38.901',
     34     ...                       carrier_frequency = 3.5e9)
     35     >>> ut_array = PanelArray(num_rows_per_panel = 1,
     36     ...                       num_cols_per_panel = 1,
     37     ...                       polarization = 'single',
     38     ...                       polarization_type = 'V',
     39     ...                       antenna_pattern = 'omni',
     40     ...                       carrier_frequency = 3.5e9)
     41     >>> # Instantiating RMa channel model
     42     >>> channel_model = RMa(carrier_frequency = 3.5e9,
     43     ...                     ut_array = ut_array,
     44     ...                     bs_array = bs_array,
     45     ...                     direction = 'uplink')
     46     >>> # Setting up network topology
     47     >>> # ut_loc: UTs locations
     48     >>> # bs_loc: BSs locations
     49     >>> # ut_orientations: UTs array orientations
     50     >>> # bs_orientations: BSs array orientations
     51     >>> # in_state: Indoor/outdoor states of UTs
     52     >>> channel_model.set_topology(ut_loc,
     53     ...                            bs_loc,
     54     ...                            ut_orientations,
     55     ...                            bs_orientations,
     56     ...                            ut_velocities,
     57     ...                            in_state)
     58     >>> # Instanting the OFDM channel
     59     >>> channel = OFDMChannel(channel_model = channel_model,
     60     ...                       resource_grid = rg)
     61 
     62     where ``rg`` is an instance of :class:`~sionna.ofdm.ResourceGrid`.
     63 
     64     Parameters
     65     -----------
     66 
     67     carrier_frequency : float
     68         Carrier frequency [Hz]
     69 
     70     rx_array : PanelArray
     71         Panel array used by the receivers. All receivers share the same
     72         antenna array configuration.
     73 
     74     tx_array : PanelArray
     75         Panel array used by the transmitters. All transmitters share the
     76         same antenna array configuration.
     77 
     78     direction : str
     79         Link direction. Either "uplink" or "downlink".
     80 
     81     enable_pathloss : bool
     82         If `True`, apply pathloss. Otherwise doesn't. Defaults to `True`.
     83 
     84     enable_shadow_fading : bool
     85         If `True`, apply shadow fading. Otherwise doesn't.
     86         Defaults to `True`.
     87 
     88     average_street_width : float
     89         Average street width [m]. Defaults to 5m.
     90 
     91     average_street_width : float
     92         Average building height [m]. Defaults to 20m.
     93 
     94     always_generate_lsp : bool
     95         If `True`, new large scale parameters (LSPs) are generated for every
     96         new generation of channel impulse responses. Otherwise, always reuse
     97         the same LSPs, except if the topology is changed. Defaults to
     98         `False`.
     99 
    100     dtype : Complex tf.DType
    101         Defines the datatype for internal calculations and the output
    102         dtype. Defaults to `tf.complex64`.
    103 
    104     Input
    105     -----
    106 
    107     num_time_steps : int
    108         Number of time steps
    109 
    110     sampling_frequency : float
    111         Sampling frequency [Hz]
    112 
    113     Output
    114     -------
    115         a : [batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps], tf.complex
    116             Path coefficients
    117 
    118         tau : [batch size, num_rx, num_tx, num_paths], tf.float
    119             Path delays [s]
    120     """
    121 
    122     def __init__(self, carrier_frequency, ut_array, bs_array,
    123         direction, enable_pathloss=True, enable_shadow_fading=True,
    124         average_street_width=20.0, average_building_height=5.0,
    125         always_generate_lsp=False, dtype=tf.complex64):
    126 
    127         # RMa scenario
    128         scenario = RMaScenario(carrier_frequency, ut_array, bs_array,
    129             direction, enable_pathloss, enable_shadow_fading,
    130             average_street_width, average_building_height, dtype)
    131 
    132         super().__init__(scenario, always_generate_lsp)