Working with DeepMIMO Scenarios

NeoRadium’s DeepMimoData class can be used with DeepMIMO scenarios to generate trajectories of user movements within a ray-tracing environment. By employing the TrjChannel class, designed as a trajectory-based channel model, you can construct sequences of channels that adhere to temporal and spatial consistency, based on the provided trajectory.

This notebook shows how to:

  • Use the DeepMimoData class to open a DeepMIMO scenario

  • Use its visialization method to draw the scenario map

  • Create randomly generated trajectories

  • Create your own trajectories interactively on the scenario map

  • Draw the generated trajectory on the map

[1]:
import numpy as np
import os, time
import scipy
import matplotlib.pyplot as plt

from neoradium import DeepMimoData, Carrier, random
[2]:
# Replace this with the folder on your computer where you store DeepMIMO scenarios
dataFolder = "/data/RayTracing/DeepMIMO/Scenarios/V4/"
DeepMimoData.setScenariosPath(dataFolder)

# Get information about a scenario:
DeepMimoData.showScenarioInfo("asu_campus_3p5")
Scenario:          asu_campus_3p5
File Version:      4.0.0a3
Carrier Frequency: 3.5 GHz
Data Folder:       /Users/shahab/data/RayTracing/DeepMIMO/Scenarios/V4/asu_campus_3p5/

UE Grids: (1)
  rx_grid: ID:0, Num UEs:131,931, xRange:-225.55..184.45, yRange:-160.17..159.83

Base Stations: (1)
  BS: ID:1, Position:(166.00,104.00,22.00)
[3]:
# Using the above information we create a DeepMimoData object for user grid 0 and base station 1:
deepMimoData = DeepMimoData("asu_campus_3p5", baseStationId=1, gridId=0)
deepMimoData.print()


DeepMimoData Properties:
  Scenario:                   asu_campus_3p5
  Version:                    4.0.0a3
  UE Grid:                    rx_grid
  Grid Size:                  411 x 321
  Base Station:               BS (at [166. 104.  22.])
  Total Grid Points:          131,931
  UE Spacing:                 [1. 1.]
  UE bounds (xyMin, xyMax)    [-225.55 -160.17], [184.45 159.83]
  UE Height:                  1.50
  Carrier Frequency:          3.5 GHz
  Num. paths (Min, Avg, Max): 0, 6.21, 10
  Num. total blockage:        46774
  LOS percentage:             19.71%

[4]:
# Draw a map of the scenario showing the Line-Of-Sight (LOS) vs Non-Line-Of-Sight (NLOS) communication
# between the UEs and the base station.
deepMimoData.drawMap("LOS-NLOS")  # Also try "1stPathDelays" or "1stPathPowers"

[4]:
(<Figure size 742.518x471.734 with 1 Axes>,
 <Axes: title={'center': 'Map of LOS/NLOS paths'}, xlabel='X', ylabel='Y'>)
../../../../_images/source_Playground_Notebooks_RayTracing_DeepMimo_4_1.png

Creating Random Trajectory

[5]:
# Now let's create a random trajectory:
random.setSeed(1234)     # Remark this out if you want new random trajectories on each run.

# The points on a trajectory are determined by the timing of slots within 3GPP subframes, which are
# governed by a specific numerology. The “getRandomTrajectory” function utilizes a BandwidthPart object
# to extract the necessary timing information. Therefore, let’s first create the Carrier and BandwidthPart
# objects.
carrier = Carrier(startRb=0, numRbs=25, spacing=15) # Carrier with 25 Resource Blocks, 15KHz subcarrier spacing
bwp = carrier.curBwp                                # The only bandwidth part in the carrier

# We need to specify the bounding box of the trajectory. Here we select a wide area
# from the map that has both LOS and NLOS points:
xyBounds = np.array([[-210, 40], [-120, 100]])    # [[minX, minY], [maxX, maxY]]
segLen = 5                                        # The number of grid points on the shortest segment

trajectory = deepMimoData.getRandomTrajectory(xyBounds, segLen, bwp,
                                              trajLen=200,            # Number of grid points on trajectory
                                              speedMps=1.2)           # Speed in mps (Walking)
# Print the trajectory information:
trajectory.print()

# Draw the Map with the trajectory:
deepMimoData.drawMap("LOS-NLOS", trajectory)


Trajectory Properties:
  start (x,y,z):         (-164.55, 69.83, 1.50)
  No. of points:         198292
  curIdx:                0 (0.00%)
  curSpeed:              [1.2 0.  0. ]
  Total distance:        237.94 meters
  Total time:            198.291 seconds
  Average Speed:         1.200 m/s
  Carrier Frequency:     3.5 GHz
  Paths (Min, Avg, Max): 5, 9.04, 10
  Totally blocked:       0
  LOS percentage:        54.30%

[5]:
(<Figure size 742.518x471.734 with 1 Axes>,
 <Axes: title={'center': 'Map of LOS/NLOS paths'}, xlabel='X', ylabel='Y'>)
../../../../_images/source_Playground_Notebooks_RayTracing_DeepMimo_6_2.png

Interactive trajectory generation

[6]:
# You can also define your own trajectory interactively by selecting points on the map. The function
# “interactiveTrajPoints” can be used to obtain a list of points on the map representing the trajectory.
# This function opens a new window displaying the current scenario’s map, and you can click on the points
# of the trajectory one by one. Use left-click to select new points and right-click to undo last point.
points = deepMimoData.interactiveTrajPoints(mapType="LOS-NLOS")
print("Selected Points:\n",points)

Running the interactive map for 'asu_campus_3p5'...
Done. 20 points selected.
Selected Points:
 [[ -73.57647258 -115.86054411]
 [ -49.91860179  -84.92332846]
 [ -63.5673734    -3.9406169 ]
 [-103.60377012   32.45610739]
 [-158.19885657   42.46520657]
 [-175.48730061   64.30324115]
 [-171.84762818   82.5016033 ]
 [-153.64926603   97.06029302]
 [-110.88311498   85.23135762]
 [ -58.10786475   84.32143951]
 [ 128.42534726   90.69086626]
 [ 155.72289048   61.57348683]
 [ 150.26338183   12.43790903]
 [ 154.81297237  -63.08529388]
 [ 153.90305426 -114.04070789]
 [ 126.60551104 -139.5184149 ]
 [  58.36165299 -124.95972518]
 [  30.15419166  -94.02250953]
 [  29.24427355  -31.23816012]
 [  31.06410977    6.06848228]]
[7]:
# Now create a trajectory using the selected points:
trajectory = deepMimoData.trajectoryFromPoints(points, bwp, speedMps=14)

# Print the trajectory information:
trajectory.print()

# Draw the Map with the trajectory:
deepMimoData.drawMap("LOS-NLOS", trajectory)


Trajectory Properties:
  start (x,y,z):         (-73.55, -116.17, 1.50)
  No. of points:         76849
  curIdx:                0 (0.00%)
  curSpeed:              [9.9 9.9 0. ]
  Total distance:        1080.31 meters
  Total time:            76.848 seconds
  Average Speed:         14.058 m/s
  Carrier Frequency:     3.5 GHz
  Paths (Min, Avg, Max): 4, 9.11, 10
  Totally blocked:       0
  LOS percentage:        54.68%

[7]:
(<Figure size 742.518x471.734 with 1 Axes>,
 <Axes: title={'center': 'Map of LOS/NLOS paths'}, xlabel='X', ylabel='Y'>)
../../../../_images/source_Playground_Notebooks_RayTracing_DeepMimo_9_2.png
[ ]: