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 system where the DeepMIMO scenarios are stored
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 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:        46,774
  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"

../../../../_images/source_Playground_Notebooks_RayTracing_DeepMimo_4_0.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, 15 kHz 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:          198,292
  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%

../../../../_images/source_Playground_Notebooks_RayTracing_DeepMimo_6_1.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. 24 points selected.
Selected Points:
 [[-165.47820142 -133.14898815]
 [-206.42451626 -128.59939761]
 [-215.52369733  -94.93242764]
 [-216.43361544  -47.61668606]
 [-211.8840249    -4.85053501]
 [-209.15427058   39.73545225]
 [-193.68566275   48.83463332]
 [-157.28893846   59.75365061]
 [-114.52278741   52.47430575]
 [ -86.31532608   41.55528847]
 [ -68.11696394    9.70815471]
 [ -43.54917504    1.51889174]
 [  -8.97228696    5.15856417]
 [  28.33435545   17.89741767]
 [  38.34345463   45.1949609 ]
 [  64.73107974   78.86193087]
 [  98.39804971   79.77184898]
 [ 132.97493779   63.39332304]
 [ 145.7137913    16.98749957]
 [ 150.26338183  -37.60758688]
 [ 144.80387319 -109.49111736]
 [ 129.33526536 -126.7795614 ]
 [  96.5782135  -135.87874247]
 [  57.45173488 -126.7795614 ]]
[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):          (-165.55, -133.17, 1.50)
  No. of points:          66,965
  curIdx:                 0 (0.00%)
  curSpeed:               [-14.08   0.     0.  ]
  Total distance:         941.40 meters
  Total time:             66.964 seconds
  Average Speed:          14.058 m/s
  Carrier Frequency:      3.5 GHz
  Paths (Min, Avg, Max):  4, 9.04, 10
  Totally blocked:        0
  LOS percentage:         34.06%

[7]:
<Axes: title={'center': 'Map of LOS/NLOS paths'}, xlabel='X', ylabel='Y'>
../../../../_images/source_Playground_Notebooks_RayTracing_DeepMimo_9_2.png
[ ]: