### Basic Sionna Setup and Usage Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb Demonstrates the fundamental setup of Sionna, including importing necessary modules and creating a basic simulation environment. This is useful for getting started with the library. ```python import sionna from sionna.rt import LayerIndoors, IndoorChannel from sionna.ofdm import ResourceGrid, OFDMSymbolsInfo, OFDMModulation from sionna.mapping import Mapper, Demapper from sionna.utils import BinarySource, SionnaConfig # Sionna configuration config = SionnaConfig() config.parse("config.ini") # Resource grid definition num_ofdm_symbols = 14 subcarrier_spacing = 15 # kHz num_resource_blocks = 52 # Create a resource grid resource_grid = ResourceGrid(num_ofdm_symbols=num_ofdm_symbols, subcarrier_spacing=subcarrier_spacing, num_resource_blocks=num_resource_blocks) # OFDM symbols information ofdm_info = OFDMSymbolsInfo(num_ofdm_symbols=num_ofdm_symbols, subcarrier_spacing=subcarrier_spacing, num_resource_blocks=num_resource_blocks) # OFDM modulation ofdm_modulation = OFDMModulation(ofdm_info=ofdm_info) # Mapper and Demapper mapper = Mapper(k=2, # Number of bits per symbol modulation_type="QAM") demapper = Demapper(k=2, modulation_type="QAM", log_likelihood_ratio=True) # Binary source num_bits_source = 10000 binary_source = BinarySource(size=num_bits_source) # Indoor channel model # Define a simple indoor environment # This is a placeholder and would typically be loaded from a file or defined more elaborately # For demonstration, we'll use a simplified setup # layer_indoors = LayerIndoors() # indoor_channel = IndoorChannel(layer_indoors=layer_indoors) print("Sionna setup complete.") print(f"Resource Grid: {resource_grid}") print(f"OFDM Info: {ofdm_info}") ``` -------------------------------- ### Basic Sionna Setup Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb.txt This snippet shows the basic imports and setup required to start using Sionna for simulations. Ensure Sionna is installed before running. ```python import sionna import numpy as np import tensorflow as tf # Sionna setup sionna.config.set_log_level(log_level='INFO') # TensorFlow setup tf.random.set_seed(1) np.random.seed(1) print(f'Sionna version: {sionna.__version__}') print(f'TensorFlow version: {tf.__version__}') ``` -------------------------------- ### Full System Configuration Example Source: https://nvlabs.github.io/sionna/_sources/sys/tutorials/notebooks/SYS_Meets_RT.ipynb.txt A comprehensive example showing the setup of a complete wireless system. ```python # Full system setup sys = rt.System(...) tx = rt.Transmitter(...) rx = rt.Receiver(...) channel = rt.RayTracingChannel(...) sys.add(tx) sys.add(rx) sys.add(channel) tx.antenna_array = rt.AntennaArray(...) rx.antenna_array = rt.AntennaArray(...) input_bits = tf.random.uniform(...) sim_output = sys(input_bits) ``` -------------------------------- ### Start System Script Examples Source: https://nvlabs.github.io/sionna/rk/scripts/start-system.html Examples demonstrating how to run the start-system.sh script with and without a specific configuration name. ```bash start-system.sh ``` ```bash start-system.sh rfsim ``` ```bash start-system.sh b200 ``` -------------------------------- ### Basic Sionna Setup Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb.txt Initializes Sionna and sets up basic parameters for a simulation. This is a common starting point for many Sionna examples. ```python import sionna from sionna.rt import MapLayer, Map, Camera, Sensor, Scene, Body, Material, Transform, PointCloud from sionna.utils import Bilal, Plot from sionna.utils.files import download_file import numpy as np import open3d as o3d import os # Set the Sionna log level to INFO sionna.config.log_level = "INFO" # Define the path to the dataset dataset_path = "./data" # Create the dataset directory if it does not exist os.makedirs(dataset_path, exist_ok=True) # Download the dataset if it does not exist if not os.path.exists(os.path.join(dataset_path, "map_layer.png")): download_file( url="https://github.com/tf-encrypted/tf-encrypted/raw/master/examples/data/map_layer.png", save_path=dataset_path, show_progress=True, ) # Load the map layer map_layer = MapLayer(os.path.join(dataset_path, "map_layer.png")) # Create a map object map_obj = Map(map_layer) # Create a scene object scene = Scene(map_obj=map_obj) ``` -------------------------------- ### Example with Specific Parameters Source: https://nvlabs.github.io/sionna/_sources/sys/tutorials/notebooks/End-to-End_Example.ipynb.txt A concrete example demonstrating the setup and execution with specific simulation parameters. ```python # Example parameters num_rays = 5000 max_depth = 5 frequency = 2.4e9 # 2.4 GHz scene.frequency = frequency cir = scene.ray_tracing(num_rays=num_rays, max_depth=max_depth).get_cir("rx_1") plt.figure() plt.stem(cir.delay_bins * 1e9, np.abs(cir.cir)) plt.xlabel("Delay (ns)") plt.ylabel("Amplitude") plt.title(f"CIR at {frequency/1e9} GHz") plt.show() ``` -------------------------------- ### Scattering Simulation Setup Example Source: https://nvlabs.github.io/sionna/_sources/rt/tutorials/Scattering.ipynb.txt Example of setting up a scattering simulation. ```python def setup_scattering_simulation_example(sim_type): print(f"Setting up {sim_type} simulation.") # Initialize simulation parameters return "Setup complete." ``` -------------------------------- ### Basic Sionna Setup Source: https://nvlabs.github.io/sionna/_sources/rt/tutorials/Introduction.ipynb.txt Demonstrates the basic setup for using Sionna, including necessary imports. This is a starting point for most Sionna applications. ```python import sionna import numpy as np import tensorflow as tf # Example usage (not functional without further definitions) # num_bits = 1000 # x = np.random.randint(0, 2, num_bits) # print(x) ``` -------------------------------- ### Basic Sionna Setup Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb Initializes Sionna and sets up basic parameters for a communication system simulation. Requires Sionna to be installed. ```python import sionna from sionna.rt import ChannelScene, Camera, PlanarArray, Point, Scene, Sensor, Transmitter, Receiver, Material, Sky from sionna.utils import Plotting, Config import numpy as np import tensorflow as tf from matplotlib import pyplot as plt from scipy.spatial.transform import Rotation as R # Configure Sionna # Config.root = "/path/to/sionna/" # Config.log_level = "INFO" # Config.gpu_allow_growth = True # Create a ChannelScene scene = ChannelScene(name="scene") # Add a transmitter tx = Transmitter(name="tx") scene.add(tx) # Add a receiver rx = Receiver(name="rx") scene.add(rx) # Add a camera cam = Camera(name="cam") scene.add(cam) # Add a sensor sensor = Sensor(name="sensor") scene.add(sensor) # Add a planar array pa = PlanarArray(name="pa") scene.add(pa) # Add a point point = Point(name="point") scene.add(point) # Add a sky sky = Sky(name="sky") scene.add(sky) # Add a material material = Material(name="material") scene.add(material) # Print scene information print(scene.info()) ``` -------------------------------- ### OFDM MIMO System Setup Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/OFDM_MIMO_Detection.ipynb Sets up a basic OFDM MIMO system with specified parameters. Ensure Sionna is installed and imported. ```python import numpy as np import tensorflow as tf from sionna.rt import LayerlessScenario, Transmitter, Receiver from sionna.ofdm import * # noqa from sionna.mimo import * # noqa from sionna.channel import * # noqa from sionna.utils import * # noqa from sionna.training import * # noqa from sionna.constants import * # noqa # System parameters num_rx = 2 num_tx = 2 num_ofdm_symbols = 10 fft_size = 64 subcarrier_spacing = 15 num_data_subcarriers = 52 num_pilot_subcarriers = 4 num_bits = 1 num_users = 1 # Create a LayerlessScenario scenario = LayerlessScenario() tx = Transmitter(scenario=scenario, num_antennas=num_tx) rx = Receiver(scenario=scenario, num_antennas=num_rx) # Create an OFDMModem ofdm_modem = OFDMModem(fft_size=fft_size, shift_subcarriers=True, num_data_subcarriers=num_data_subcarriers, num_pilot_subcarriers=num_pilot_subcarriers, pilot_pattern='dh', pilot_subcarrier_spacing=num_data_subcarriers//num_pilot_subcarriers, pilot_subcarriers_offset=0, pilot_value=1+1j, num_bits_per_symbol=num_bits) # Create a MIMOChannel # The channel is created on the fly in the simulation loop ``` -------------------------------- ### Channel Modeling Example Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb Demonstrates channel modeling with Sionna. This requires a scene and a transmitter/receiver setup. ```python from sionna.rt import Scene, Camera, PlanarArray from sionna.channel import Dരുവനന്തപുരം from sionna.utils import Plot import numpy as np # Create a scene scene = Scene() # Add a camera camera = Camera(name="camera", position=[0,0,0], look_at=[1,0,0], up=[0,0,1], near_clip=0.1, far_clip=100.0, fov=90.0) scene.add_camera(camera) # Add a planar array array = PlanarArray(name="array", position=[0,0,0], orientation=[1,0,0,0], num_rows=1, num_cols=1, element_spacing=[0.5, 0.5], polarization="dual rx") scene.add_object(array) # Create a channel channel = Dരുവനന്തപുരം() # Simulate channel # This part would typically involve defining a transmitter and receiver # and then calling channel.sample(..., ...) # Plot the scene (optional) plot = Plot() plot.plot_scene(scene) ``` -------------------------------- ### OFDM MIMO System Setup Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/OFDM_MIMO_Detection.ipynb Sets up a basic OFDM MIMO system with specified parameters. Ensure Sionna is installed and configured. ```python import numpy as np import tensorflow as tf from sionna.rt import LayerPath, Camera, Scene, Transmitter, Receiver from sionna.ofdm import * from sionna.mimo import * from sionna.channel import * from sionna.utils import * from sionna.training import * from sionna.constants import * from sionna.utils.plot import plot_scatter_diagram # System parameters num_rx = 2 num_tx = 2 n_fft = 64 num_ofdm_symbols = 14 subcarrier_spacing = 15e3 # Channel parameters # For simplicity, we use a flat fading channel model here. # For more complex scenarios, consider using sionna.rt for ray tracing. # For this example, we use a simple AWGN channel. # Define the OFDM system ofdm_mod = OFDMModulation(fft_size=n_fft, num_ofdm_symbols=num_ofdm_symbols, subcarrier_spacing=subcarrier_spacing, pilot_pattern='dpd', pilot_re=np.arange(1, n_fft, 2), pilot_re_len=1) # Define the MIMO channel # For this example, we use a simple AWGN channel. # For more complex scenarios, consider using sionna.rt for ray tracing. # For this example, we use a simple AWGN channel. # Define the MIMO detector # This will be defined later based on the chosen algorithm. ``` -------------------------------- ### Run quickstart-cn5g.sh Examples Source: https://nvlabs.github.io/sionna/_sources/rk/scripts/quickstart-cn5g.rst.txt Demonstrates various ways to execute the quickstart-cn5g.sh script with different options for cleaning, specifying architecture, branch, and tags. ```bash ./quickstart-cn5g.sh ``` ```bash ./quickstart-cn5g.sh --clean ``` ```bash ./quickstart-cn5g.sh --clean --arch arm64 ``` ```bash ./quickstart-cn5g.sh --branch v2.1.0-1.2 --tag latest ``` -------------------------------- ### Basic Scattering Example Source: https://nvlabs.github.io/sionna/_sources/rt/tutorials/Scattering.ipynb.txt Demonstrates a basic setup for simulating scattering. Ensure you have the necessary Sionna libraries installed. ```python import numpy as np import tensorflow as tf from sionna.rt import Scene, Transmitter, Receiver, PlanarArray from sionna.rt.scene.objects import Box from sionna.rt.scene.materials import Material from sionna.rt.scene.materials.scattering import RayleighScattering # Create a scene scene = Scene(name="scattering_scene") # Add a transmitter tx = Transmitter(name="tx") tx.add_sub_object(PlanarArray(num_rows=1, num_cols=1, element_spacing=[0.5, 0.5], carrier_frequency=2.4e9)) scene.add_object(tx) # Add a receiver rx = Receiver(name="rx") rx.add_sub_object(PlanarArray(num_rows=1, num_cols=1, element_spacing=[0.5, 0.5], carrier_frequency=2.4e9)) scene.add_object(rx) # Add a scattering object (e.g., a box) material = Material(name="concrete", scattering_model=RayleighScattering(coefficient=0.1)) obj = Box(center=[0, 0, 10], size=[5, 5, 5], material=material) scene.add_object(obj) # Simulate # Note: Actual simulation would involve path tracing and ray launching. # This is a placeholder to show scene setup. print("Scene setup complete. Ready for simulation.") ``` -------------------------------- ### Clean Setup with quickstart-cn5g.sh Source: https://nvlabs.github.io/sionna/rk/scripts/quickstart-cn5g.html Runs the quickstart-cn5g.sh script with the --clean flag to remove existing directories before proceeding with the setup. ```bash ./quickstart-cn5g.sh --clean ``` -------------------------------- ### Channel Modeling Example Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb Demonstrates how to use Sionna's channel modeling capabilities. This snippet shows the setup of a basic channel model. ```python import sionna from sionna.rt import ChannelModel, LayerlessChannel # Parameters num_tx_ant = 2 num_rx_ant = 4 # Create a layerless channel model # This is a simple channel model with no spatial effects. # For more realistic simulations, use other channel models like: # - GeometricChannel # - MassiveMIMOChannel channel = LayerlessChannel(num_tx_ant=num_tx_ant, num_rx_ant=num_rx_ant) # You would typically use this channel model within an OFDMModem or similar # to simulate the wireless environment. # For example: # ofdm_modem = OFDMModem(channel_model=channel, ...) print("Channel model created successfully.") ``` -------------------------------- ### Link Adaptation Example Source: https://nvlabs.github.io/sionna/_sources/sys/tutorials/notebooks/LinkAdaptation.ipynb.txt This snippet shows a basic link adaptation setup. It requires the 'sionna' library to be installed. ```python import sionna from sionna.rt import LayerPath, LinkAdaptation # Define a path loss model path_loss_model = LayerPath(model="trace", trace_file="path_loss.csv") # Initialize link adaptation # This example uses a simple fixed MCS selection for demonstration link_adaptation = LinkAdaptation(path_loss_model=path_loss_model, num_tx_antennas=2, num_rx_antennas=2) # Simulate link adaptation over time # In a real scenario, this would involve channel estimation and feedback # For simplicity, we'll just iterate through a predefined set of MCS indices mcs_indices = [0, 5, 10, 15] for i in range(len(mcs_indices)): # In a real system, the MCS would be selected based on channel conditions # Here, we manually set it for demonstration link_adaptation.set_tx_mcs(mcs_indices[i]) print(f"Transmitting with MCS index: {mcs_indices[i]}") # Further simulation steps would follow, e.g., data transmission, decoding # ... print("Link adaptation simulation finished.") ``` -------------------------------- ### Basic Sionna Setup and 'Hello, World!' Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/Hello_World.ipynb This snippet demonstrates the fundamental setup for using Sionna, including necessary imports and a basic 'Hello, World!' print statement. It serves as the entry point for new users. ```python import sionna print("Hello, World!") ``` -------------------------------- ### Basic Scattering Example Source: https://nvlabs.github.io/sionna/_sources/rt/tutorials/Scattering.ipynb.txt Demonstrates a fundamental scattering setup. This code is typically used as a starting point for more complex scattering simulations. ```python import numpy as np import tensorflow as tf from sionna.rt import Scene, Camera, Sky, Ray, BSDF, Material, Texture from sionna.rt.render import render_rays # Create a scene scene = Scene() # Add a camera cam = Camera(position=[0, 0, 0], look_at=[0, 0, 1], up=[0, 1, 0], fov=90) scene.add_camera(cam) # Add a ground plane scene.add_geometry(Scene.create_plane(material=Material(diffuse_color=[0.5, 0.5, 0.5]))) # Add a sphere with a diffuse material mat_diffuse = Material(diffuse_color=[0.8, 0.2, 0.2]) scene.add_geometry(Scene.create_sphere(center=[0, 0, 5], radius=1.0, material=mat_diffuse)) # Add a sphere with a specular material mat_specular = Material(specular_color=[0.8, 0.8, 0.8], specular_roughness=0.1) scene.add_geometry(Scene.create_sphere(center=[2, 0, 5], radius=1.0, material=mat_specular)) # Add a sphere with a transmission material mat_transmission = Material(transmission_color=[0.8, 0.8, 0.8], transmission_roughness=0.1) scene.add_geometry(Scene.create_sphere(center=[-2, 0, 5], radius=1.0, material=mat_transmission)) # Add a sky sky = Sky(turbidity=2.0, ground_albedo=0.5) scene.set_sky(sky) # Render the scene image = render_rays(scene, cam, num_samples=128, max_depth=10) # Display the image (e.g., using matplotlib) import matplotlib.pyplot as plt plt.imshow(image) plt.show() ``` -------------------------------- ### End-to-End Example with Custom Channel Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb A complete example demonstrating the flow from data generation to BER calculation, using a custom-defined channel model. ```python from sionna.utils import BinarySource, BER from sionna.mapping import QAMModulator from sionna.channel import ... # Import custom channel class # Data generation bits = BinarySource(100000)() # Modulation modulator = QAMModulator(num_bits_per_symbol=2, const_type='qam') symbols = modulator.keras_layer(bits) # Custom Channel # Assume CustomChannel is defined elsewhere channel = CustomChannel(param1=..., param2=...) received_symbols = channel(symbols, bits) # Demodulation demodulator = QAMModulator(num_bits_per_symbol=2, const_type='qam', demodulate=True) demodulated_bits = demodulator.keras_layer(received_symbols) # BER Calculation ber = BER(bits, demodulated_bits) print(f"BER: {ber}") ``` -------------------------------- ### Basic Execution of quickstart-cn5g.sh Source: https://nvlabs.github.io/sionna/rk/scripts/quickstart-cn5g.html Executes the quickstart-cn5g.sh script with default settings to set up the 5G Core Network. ```bash ./quickstart-cn5g.sh ``` -------------------------------- ### quickstart-cn5g.sh Usage Source: https://nvlabs.github.io/sionna/_sources/rk/scripts/quickstart-cn5g.rst.txt This script automates the setup of a 5G Core Network. It clones the OpenAirInterface Core Network Federated repository, applies patches, and builds Docker images. Use options to customize the build process. ```bash quickstart-cn5g.sh [-h|--help] [--arch (x86|arm64)] [--branch ] [--clean] [--debug] [--no-build] [--tag ] [--source ] [--dest ] ``` -------------------------------- ### BICM Transmitter and Receiver Example Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Bit_Interleaved_Coded_Modulation.ipynb.txt This example shows a basic BICM transmitter and receiver setup. It includes channel coding, interleaving, mapping, AWGN channel, and decoding. Ensure you have the necessary Sionna components installed. ```python import numpy as np import tensorflow as tf from sionna.rt import ChannelModel, Gmrac from sionna.ofdm import ResourceGrid, OFDMGrid, ResourceGridMapper from sionna.mapping import Constellation, Mapper, Demapper from sionna.channel import AWGN from sionna.coding import CodedBitInterleaver, LDG2, LDG2_decoder from sionna.utils import BinarySource, SionnaException # Transmitter parameters num_bits_per_symbol = 2 num_codeword_bits = 1024 num_data_bits = int(num_codeword_bits / num_bits_per_symbol) # Receiver parameters num_iter = 6 # Sionna components # Source bits = BinarySource() # Encoder encoder = LDG2(k=num_data_bits, n=num_codeword_bits) # Interleaver coded_bit_interleaver = CodedBitInterleaver() # Mapper constellation = Constellation("QAM", num_bits_per_symbol) mapper = Mapper(constellation=constellation) # Channel channel_model = Gmrac(num_rx=1, num_tx=1) channel_awsgn = AWGN(num_rx=1, num_tx=1) # Demapper demapper = Demapper(constellation=constellation, hard_decision=False) # Decoder decoder = LDG2_decoder(k=num_data_bits, n=num_codeword_bits) # Simulation loop num_steps = 10000 for i in range(num_steps): # Transmitter batch_size = 1 x = bits(batch_size=batch_size, nbits=num_data_bits) x_encoded = encoder(x) x_interleaved = coded_bit_interleaver(x_encoded) x_mapped = mapper(x_interleaved) # Channel # Note: The channel model is not used in this example, only AWGN. # For a more realistic simulation, you would use the channel_model. # y, H = channel_model(x_mapped, batch_size=batch_size) y = channel_awsgn(x_mapped, batch_size=batch_size) # Receiver llr = demapper(y) llr_deinterleaved = coded_bit_interleaver.inverse_transform(llr) x_hat = decoder(llr_deinterleaved, num_iter=num_iter) # Calculate BER (Bit Error Rate) ber = tf.reduce_mean(tf.cast(tf.not_equal(x, x_hat), tf.float32)) if i % 100 == 0: print(f"Step {i}, BER: {ber.numpy()}") print(f"Final BER: {ber.numpy()}") ``` -------------------------------- ### Link-Level Simulation Setup Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/Sionna_tutorial_part4.ipynb Provides a basic setup for conducting link-level simulations using Sionna. This involves defining the simulation parameters and components. ```python import numpy as np import tensorflow as tf from sionna.rt import ... from sionna.ofdm import ... from sionna.channel import ... from sionna.utils import ... # ... (rest of the simulation setup code) ``` -------------------------------- ### configure-system.sh - Example Commands Source: https://nvlabs.github.io/sionna/_sources/rk/scripts/configure-system.rst.txt Examples demonstrating how to run the configuration script. The first example runs with auto-detection, the second forces a specific platform, and the third enables dry-run and verbose modes. ```bash ./configure-system.sh ``` ```bash ./configure-system.sh --force-platform dgx-spark ``` ```bash ./configure-system.sh --dry-run --verbose ``` -------------------------------- ### BICM Transmitter and Receiver Example Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Bit_Interleaved_Coded_Modulation.ipynb.txt This example demonstrates a basic BICM transmitter and receiver setup. It includes essential components for encoding, interleaving, modulation, channel simulation, and decoding. Ensure you have the necessary Sionna libraries installed. ```python import numpy as np import tensorflow as tf from sionna.rt import LayerAwareCam, Camera, Scene from sionna.ofdm import ResourceGrid, ResourceGridMapper, LS GerrardMapper from sionna.mapping import Mapping from sionna.channel import AWGN, SubLOS, SubNLOS, SubUrban, SubUrban_NLOS, SubUrban_LOS from sionna.utils import calculate_ber from sionna.ofdm import LinearEqualizer, ZFEqualizer, MMSEEqualizer from sionna.fec.utils import r2s, s2r from sionna.fec.ldpc import LDPCa from sionna.fec.interleaver import Interleaver from sionna.modulation import QAM from sionna.utils import BinarySource # Parameters num_bits_per_symbol = 2 # QPSK num_tx = 1 num_rx = 1 num_ofdm_symbols = 14 subcarrier_spacing = 15 fft_size = 1024 num_ofdm_carriers = 810 num_data_carriers = 600 num_pilot_carriers = 24 num_null_carriers = 186 num_ldpc_iterations = 4 # Create resource grid rg = ResourceGrid(num_ofdm_symbols=num_ofdm_symbols, fft_size=fft_size, subcarrier_spacing=subcarrier_spacing, num_tx=num_tx, num_rx=num_rx) # Create resource grid mapper mapper = ResourceGridMapper(rg, num_data_carriers=num_data_carriers, num_pilot_carriers=num_pilot_carriers, num_null_carriers=num_null_carriers) # Create LDPC encoder and decoder encoder = LDPCa(k=num_data_carriers * num_bits_per_symbol, n=num_data_carriers * num_bits_per_symbol * 2, num_iterations=num_ldpc_iterations) decoder = LDPCa(k=num_data_carriers * num_bits_per_symbol, n=num_data_carriers * num_bits_per_symbol * 2, num_iterations=num_ldpc_iterations) # Create interleaver and deinterleaver interleaver = Interleaver(num_bits_per_symbol * num_data_carriers) deinterleaver = Interleaver(num_bits_per_symbol * num_data_carriers) # Create QAM mapper and demapper mapper_qam = QAM(num_bits_per_symbol) demapper_qam = QAM(num_bits_per_symbol) # Create channel model channel = AWGN() # Create equalizer # equalizer = ZFEqualizer() # equalizer = MMSEEqualizer() # equalizer = LinearEqualizer() # Create binary source # source = BinarySource() # --- Transmitter --- # Generate random bits # x = source(batch_size=1, nbits=num_data_carriers * num_bits_per_symbol) # LDPC encoding # c = encoder(x) # Interleaving # i = interleaver(c) # QAM mapping # y = mapper_qam(i) # Resource grid mapping # rg_out = mapper(y) # OFDM modulation # tx_signal = rg_out.ofdm_mod(rg) # --- Channel --- # rx_signal = channel(tx_signal, num_rx=num_rx) # --- Receiver --- # OFDM demodulation # rg_in = rg.ofdm_demod(rx_signal) # Resource grid demapping # y_hat = mapper.demap_ অশ(rg_in) # QAM demapping # i_hat = demapper_qam.demap(y_hat) # Deinterleaving # c_hat = deinterleaver(i_hat) # LDPC decoding # x_hat = decoder(c_hat) # Calculate BER # ber = calculate_ber(x, x_hat) # print(f"BER: {ber}") ``` -------------------------------- ### Create a Beamforming Example Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb Sets up a basic beamforming simulation scenario. This example focuses on demonstrating beamforming techniques in a simplified environment. ```python beamforming_system = sn.configs.system_model.BeamformingSystemModel(sampling_rate=sampling_rate, carrier_frequency=carrier_frequency, bandwidth=bandwidth, nrbs=nrbs, fft_size=fft_size, cp_len=cp_len) ``` -------------------------------- ### Basic quickstart-oai.sh Execution Source: https://nvlabs.github.io/sionna/rk/scripts/quickstart-oai.html Demonstrates the simplest way to run the script to set up OpenAirInterface Docker images with default settings. ```bash ./quickstart-oai.sh ``` -------------------------------- ### Basic Python Setup for Sionna Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Hello_World.ipynb.txt This snippet shows the essential imports required to start using Sionna for signal processing tasks. Ensure these libraries are installed. ```python import numpy as np import tensorflow as tf from sionna.rt import Scene, Camera, Parser from sionna.utils import Plotting from sionna.rt.render import render_scene ``` -------------------------------- ### PUSCH Transmission with Different PUSCH UCI Bundling Setup Example Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/5G_NR_PUSCH.ipynb This example shows an example setup for bundled UCI on the PUSCH signal. ```python # PUSCH UCI bundling setup example (example) # ... (details of UCI bundling setup example would follow) ``` -------------------------------- ### Basic Sionna Setup and Initialization Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb.txt Demonstrates the basic setup and initialization of Sionna, including importing necessary libraries and creating a simulation environment. This is a starting point for most Sionna simulations. ```python import sionna import numpy as np import tensorflow as tf # Create a simulation environment sim_env = sionna.SimulationEnvironment() # Print the simulation environment details print(sim_sim_env) ``` -------------------------------- ### Create a Fronthaul Example Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb Sets up a simulation to demonstrate fronthaul communication, which connects remote radio heads to a baseband unit. This example focuses on the data transmission aspects. ```python fronthaul_system = sn.configs.system_model.FronthaulSystemModel(sampling_rate=sampling_rate, carrier_frequency=carrier_frequency, bandwidth=bandwidth, nrbs=nrbs, fft_size=fft_size, cp_len=cp_len) ``` -------------------------------- ### Example extlinux.conf Configuration Source: https://nvlabs.github.io/sionna/_sources/rk/setup/kernel.rst.txt An example configuration for extlinux.conf, demonstrating how to set up boot entries for both a primary (new) kernel and an original (backup) kernel. Adjust root device and other parameters as needed for your specific setup. ```bash TIMEOUT 30 DEFAULT primary MENU TITLE L4T boot options LABEL primary MENU LABEL primary kernel LINUX /boot/Image INITRD /boot/initrd APPEND ${cbootargs} root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config LABEL original MENU LABEL original precompiled kernel LINUX /boot/Image.original INITRD /boot/initrd.original APPEND ${cbootargs} root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config ``` -------------------------------- ### PUSCH Transmission with Different PUSCH UCI Timing Setup Example Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/5G_NR_PUSCH.ipynb This example illustrates an example setup for the UCI transmission timing on the PUSCH signal. ```python # PUSCH UCI timing setup example (example) # ... (details of UCI timing setup example would follow) ``` -------------------------------- ### ARM64 Build with quickstart-cn5g.sh Source: https://nvlabs.github.io/sionna/rk/scripts/quickstart-cn5g.html Executes the quickstart-cn5g.sh script with --clean and --arch arm64 flags for a clean setup targeting ARM64 architecture. ```bash ./quickstart-cn5g.sh --clean --arch arm64 ``` -------------------------------- ### PUSCH Transmission with Different PUSCH UCI Channel Selection Setup Example Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/5G_NR_PUSCH.ipynb This example demonstrates an example setup for selected UCI channels on the PUSCH signal. ```python # PUSCH UCI channel selection setup example (example) # ... (details of UCI channel selection setup example would follow) ``` -------------------------------- ### End-to-End Example Snippet Source: https://nvlabs.github.io/sionna/sys/tutorials/notebooks/End-to-End_Example.ipynb A more complete example combining data generation, modulation, channel simulation, and BER calculation. This snippet illustrates a typical workflow. ```python import tensorflow as tf from sionna.utils import BinarySource, BER from sionna.ofdm import LinearModem from sionna.channel import AWGN # Parameters num_bits = 10000 msg_len = 100 # Create a binary source bits = BinarySource(msg_len)(num_bits=num_bits) # Initialize modem and channel modem = LinearModem() awgn_channel = AWGN() # Apply modulation symbols = modem.keras_layer(bits) # Simulate channel noisy_symbols = awgn_channel([symbols, tf.zeros_like(symbols)]) # Apply demodulation estimated_bits = modem.keras_layer(noisy_symbols, training=False) # Calculate BER ber_calculator = BER() ber = ber_calculator(bits, estimated_bits) ``` -------------------------------- ### Basic Sionna Usage Example Source: https://nvlabs.github.io/sionna/_sources/rt/tutorials/Introduction.ipynb.txt This snippet demonstrates a fundamental Sionna workflow, likely involving signal processing or deep learning model setup. Ensure Sionna is installed and any required dependencies are met before running. ```python import sionna import tensorflow as tf # Example usage placeholder print("Sionna imported successfully!") ``` -------------------------------- ### PUSCH Transmission with Different PUSCH UCI Multiplexing Setup Example Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/5G_NR_PUSCH.ipynb This snippet illustrates an example setup for multiplexed UCI on the PUSCH signal. ```python # PUSCH UCI multiplexing setup example (example) # ... (details of UCI multiplexing setup example would follow) ``` -------------------------------- ### Start the demo with GUI Source: https://nvlabs.github.io/sionna/_sources/rk/tutorials/channel_emulation/channel_emulation.rst.txt Launches the demo with the Sionna RT GUI. This requires a connected monitor. ```bash sionna-rt-gui --priority --config spark_quectel.yaml ``` -------------------------------- ### Basic Sionna Setup and Initialization Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb.txt Demonstrates the fundamental setup for using Sionna, including necessary imports and initialization of core components. This is the starting point for most Sionna applications. ```python import sionna import tensorflow as tf # Initialize Sionna sionna.config.init_torch() # or sionna.config.init_tf() print(f"Sionna version: {sionna.__version__}") print(f"TensorFlow version: {tf.__version__}") ``` -------------------------------- ### PUSCH Transmission with Different PUSCH UCI Priority Setup Example Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/5G_NR_PUSCH.ipynb This snippet demonstrates an example setup for the UCI priority on the PUSCH signal. ```python # PUSCH UCI priority setup example (example) # ... (details of UCI priority setup example would follow) ``` -------------------------------- ### quickstart-oai.sh Script Usage Source: https://nvlabs.github.io/sionna/_sources/rk/scripts/quickstart-oai.rst.txt This script automates the process of setting up OpenAirInterface Docker images. It clones the repository, applies patches, and builds images. Use the options to customize the build process. ```bash quickstart-oai.sh [-h|--help] [--clean] [--debug] [--no-build] [--tag ] [--oai-version ] [--ci] [--source ] [--dest ] ``` ```bash ./quickstart-oai.sh ``` ```bash ./quickstart-oai.sh --clean ``` ```bash ./quickstart-oai.sh --clean --tag experimental ``` ```bash ./quickstart-oai.sh --oai-version 2025.w34 --no-build ``` -------------------------------- ### PUSCH Transmission with Different PUSCH UCI Payload Size Setup Example Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/5G_NR_PUSCH.ipynb This snippet shows an example setup for the UCI payload size on the PUSCH signal. ```python # PUSCH UCI payload size setup example (example) # ... (details of UCI payload size setup example would follow) ``` -------------------------------- ### Advanced Link Simulation Setup Source: https://nvlabs.github.io/sionna/phy/tutorials/notebooks/Sionna_tutorial_part4.ipynb Configure an advanced link simulation by defining the number of samples, the number of time steps, and the simulation parameters. This setup is crucial for accurate performance evaluation. ```python num_samples = 10000 num_time_steps = 10 sim_params = {"num_tx": 2, "num_rx": 2} # Initialize simulation components with parameters ``` -------------------------------- ### Basic Sionna Setup Source: https://nvlabs.github.io/sionna/_sources/rt/tutorials/Introduction.ipynb.txt Demonstrates the basic setup for using Sionna, including importing necessary modules and defining simulation parameters. ```python import sionna import numpy as np # General simulation parameters num_of_ants = [1, 1] # Number of antennas at the base station and the UE num_of_users = 1 # Instantiate the Sionna framework sf = sionna.framework.srsframework.SRSFramework(num_of_ants, num_of_users) # Instantiate a channel model # For simplicity, we use a simple flat fading channel # In a real scenario, you would use a more complex channel model like # sionna.channel.models.CIRChannel # Define a flat fading channel # The channel matrix will be of shape (num_of_users, num_of_rx_antennas, num_of_tx_antennas) # For this example, it will be (1, 1, 1) channel = np.random.randn(num_of_users, sf.rx_ant[0], sf.tx_ant[0]) + 1j * np.random.randn(num_of_users, sf.rx_ant[0], sf.tx_ant[0]) ``` -------------------------------- ### LMMSE Estimator Setup Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb.txt This example demonstrates the setup of the LMMSEEstimator for channel estimation in Sionna. ```python from sionna.channel_estimation import LMMSEEstimator # LMMSE Estimator ce = LMMSEEstimator(rg, cfg) ``` -------------------------------- ### Basic Sionna Setup and Usage Source: https://nvlabs.github.io/sionna/_sources/phy/tutorials/notebooks/Sionna_tutorial_part1.ipynb.txt Demonstrates the initial setup and basic usage of Sionna for simulating communication systems. Ensure Sionna is installed before running. ```python import sionna import numpy as np import tensorflow as tf # Example usage (replace with actual Sionna components) print("Sionna imported successfully!") ```