Simulation of the METIS scenario with rooms in one floor

This notebook simulates the scenario with one access point in each room of a given floor building.

Some Initialization Code

First we do some initializations and import the required modules.


In [16]:
%matplotlib inline

# xxxxxxxxxx Add the parent folder to the python path. xxxxxxxxxxxxxxxxxxxx
import sys
import os
sys.path.append('../')
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

from matplotlib import pyplot as plt
import numpy as np

from IPython.html.widgets import interact, interactive, fixed
from IPython.html import widgets
from IPython.display import display_latex

# Import the simulation runner
from apps.metis_scenarios.simulate_metis_scenario import *

Simulation Configuration

Now we set the simulation configuration.


In [17]:
scenario_params = {
    'side_length': 10,  # 10 meters side length
    'single_wall_loss_dB': 5,
    'num_rooms_per_side': 12,
    'ap_decimation': 1}

power_params = {
    'Pt_dBm': 20,  # 20 dBm transmit power
    'noise_power_dBm': -300  # Very low noise power
}

Perform the Simulation

calculate the SINRs


In [18]:
out = perform_simulation_SINR_heatmap(scenario_params, power_params)

(sinr_array_pl_nothing_dB,
 sinr_array_pl_3gpp_dB,
 sinr_array_pl_free_space_dB,
 sinr_array_pl_metis_ps7_dB) = out

In [19]:
num_discrete_positions_per_room = 15

sinr_array_pl_nothing_dB2 = prepare_sinr_array_for_color_plot(
    sinr_array_pl_nothing_dB,
    scenario_params['num_rooms_per_side'],
    num_discrete_positions_per_room)
sinr_array_pl_3gpp_dB2 = prepare_sinr_array_for_color_plot(
    sinr_array_pl_3gpp_dB,
    scenario_params['num_rooms_per_side'],
    num_discrete_positions_per_room)
sinr_array_pl_free_space_dB2 = prepare_sinr_array_for_color_plot(
    sinr_array_pl_free_space_dB,
    scenario_params['num_rooms_per_side'],
    num_discrete_positions_per_room)
sinr_array_pl_metis_ps7_dB2 = prepare_sinr_array_for_color_plot(
    sinr_array_pl_metis_ps7_dB,
    scenario_params['num_rooms_per_side'],
    num_discrete_positions_per_room)

In [20]:
print(("Min/Mean/Max SINR value (no PL):"
       "\n    {0}\n    {1}\n    {2}").format(
           sinr_array_pl_nothing_dB.min(),
           sinr_array_pl_nothing_dB.mean(),
           sinr_array_pl_nothing_dB.max()))
print(("Min/Mean/Max SINR value (3GPP):"
       "\n    {0}\n    {1}\n    {2}").format(
           sinr_array_pl_3gpp_dB.min(),
           sinr_array_pl_3gpp_dB.mean(),
           sinr_array_pl_3gpp_dB.max()))
print(("Min/Mean/Max SINR value (Free Space):"
       "\n    {0}\n    {1}\n    {2}").format(
           sinr_array_pl_free_space_dB.min(),
           sinr_array_pl_free_space_dB.mean(),
           sinr_array_pl_free_space_dB.max()))
print(("Min/Mean/Max SINR value (METIS PS7):"
       "\n    {0}\n    {1}\n    {2}").format(
           sinr_array_pl_metis_ps7_dB.min(),
           sinr_array_pl_metis_ps7_dB.mean(),
           sinr_array_pl_metis_ps7_dB.max()))


Min/Mean/Max SINR value (no PL):
    -4.310463903511446
    -3.5007264964664984
    -0.5645878953050728
Min/Mean/Max SINR value (3GPP):
    2.269722156239432
    14.203519642714394
    54.58025181506546
Min/Mean/Max SINR value (Free Space):
    0.5797906159685279
    7.12399255068239
    52.72914014707784
Min/Mean/Max SINR value (METIS PS7):
    14.505289792773912
    21.049754859440554
    67.59854094888976

Create the Plots for the different cases

First we will create the plots for a noise variance equal to zero.

Plot case without path loss (only wall loss)


In [21]:
fig1, ax1 = plt.subplots(figsize=(10, 8))
print("Max SINR: {0}".format(sinr_array_pl_nothing_dB.max()))
print("Min SINR: {0}".format(sinr_array_pl_nothing_dB.min()))
print("Mean SINR: {0}".format(sinr_array_pl_nothing_dB.mean()))
im1 = ax1.imshow(sinr_array_pl_nothing_dB2, interpolation='nearest', vmax=-1.5, vmin=-5)
fig1.colorbar(im1)
plt.show()


Max SINR: -0.5645878953050728
Min SINR: -4.310463903511446
Mean SINR: -3.5007264964664984

Plot case with 3GPP path loss


In [22]:
fig2, ax2 = plt.subplots(figsize=(10, 8))
print("Max SINR: {0}".format(sinr_array_pl_3gpp_dB.max()))
print("Min SINR: {0}".format(sinr_array_pl_3gpp_dB.min()))
print("Mean SINR: {0}".format(sinr_array_pl_3gpp_dB.mean()))
im2 = ax2.imshow(sinr_array_pl_3gpp_dB2, interpolation='nearest', vmax=30, vmin=-2.5)
fig2.colorbar(im2)
plt.show()


Max SINR: 54.58025181506546
Min SINR: 2.269722156239432
Mean SINR: 14.203519642714394

Case with Free Space Path Loss


In [23]:
fig3, ax3 = plt.subplots(figsize=(10, 8))
print("Max SINR: {0}".format(sinr_array_pl_free_space_dB.max()))
print("Min SINR: {0}".format(sinr_array_pl_free_space_dB.min()))
print("Mean SINR: {0}".format(sinr_array_pl_free_space_dB.mean()))
im3 = ax3.imshow(sinr_array_pl_free_space_dB2, interpolation='nearest', vmax=30, vmin=-2.5)
fig3.colorbar(im3)
plt.show()


Max SINR: 52.72914014707784
Min SINR: 0.5797906159685279
Mean SINR: 7.12399255068239

Plot case with METIS PS7 path loss


In [24]:
fig4, ax4 = plt.subplots(figsize=(10, 8))
print("Max SINR: {0}".format(sinr_array_pl_metis_ps7_dB.max()))
print("Min SINR: {0}".format(sinr_array_pl_metis_ps7_dB.min()))
print("Mean SINR: {0}".format(sinr_array_pl_metis_ps7_dB.mean()))
im4 = ax4.imshow(sinr_array_pl_metis_ps7_dB2, interpolation='nearest', vmax=30, vmin=-2.5)
fig4.colorbar(im4)
plt.show()


Max SINR: 67.59854094888976
Min SINR: 14.505289792773912
Mean SINR: 21.049754859440554

Create the plots with interact

Here we repeat the plots, but now using IPython interact. This allow us to change unput parameters and see the result in the plot.


In [25]:
@interact(Pt_dBm=(0., 40., 5.), noise_power_dBm=(-160., 0.0, 5.), pl_model=['nothing', '3gpp', 'free_space', 'metis'], ap_decimation=['1', '2', '4', '9'])
def plot_SINRs(Pt_dBm=30., noise_power_dBm=-160, pl_model='3gpp', ap_decimation=1):
    scenario_params = {
    'side_length': 10,  # 10 meters side length
    'single_wall_loss_dB': 5,
    'num_rooms_per_side': 12,
    'ap_decimation': int(ap_decimation)}
    
    power_params = {
        'Pt_dBm': Pt_dBm,  # 20 dBm transmit power
        'noise_power_dBm': noise_power_dBm  # Very low noise power
    }
    
    out = perform_simulation_SINR_heatmap(scenario_params, power_params)

    (sinr_array_pl_nothing_dB,
     sinr_array_pl_3gpp_dB,
     sinr_array_pl_free_space_dB,
     sinr_array_pl_metis_ps7_dB) = out
    
    
    #sinr_array_pl_nothing_dB, sinr_array_pl_3gpp_dB, sinr_array_pl_free_space_dB, sinr_array_pl_metis_ps7_dB = calc_SINRs(Pt_dBm, noise_var)

    fig, ax = plt.subplots(figsize=(10, 8))
    
    if pl_model == 'nothing':    
        im = ax.imshow(sinr_array_pl_nothing_dB2, interpolation='nearest', vmax=-1.5, vmin=-5.)
        fig.colorbar(im)
        plt.show()
        print(("Min/Mean/Max SINR value (no PL):"
               "\n    {0}\n    {1}\n    {2}").format(
                   sinr_array_pl_nothing_dB.min(),
                   sinr_array_pl_nothing_dB.mean(),
                   sinr_array_pl_nothing_dB.max()))
    elif pl_model == '3gpp':
        im = ax.imshow(sinr_array_pl_3gpp_dB2, interpolation='nearest', vmax=30, vmin=-2.5)
        fig.colorbar(im)
        ax.set_title('ka')
        plt.show()
        print(("Min/Mean/Max SINR value (3GPP):"
           "\n    {0}\n    {1}\n    {2}").format(
               sinr_array_pl_3gpp_dB.min(),
               sinr_array_pl_3gpp_dB.mean(),
               sinr_array_pl_3gpp_dB.max()))
    elif pl_model == 'free_space':
        im = ax.imshow(sinr_array_pl_free_space_dB2, interpolation='nearest', vmax=30, vmin=-2.5)
        fig.colorbar(im)
        plt.show()
        print(("Min/Mean/Max SINR value (Free Space):"
           "\n    {0}\n    {1}\n    {2}").format(
               sinr_array_pl_free_space_dB.min(),
               sinr_array_pl_free_space_dB.mean(),
               sinr_array_pl_free_space_dB.max()))
    elif pl_model == 'metis':
        im = ax.imshow(sinr_array_pl_metis_ps7_dB2, interpolation='nearest', vmax=30, vmin=-2.5)
        fig.colorbar(im)
        plt.show()
        print(("Min/Mean/Max SINR value (METIS PS7):"
           "\n    {0}\n    {1}\n    {2}").format(
               sinr_array_pl_metis_ps7_dB.min(),
               sinr_array_pl_metis_ps7_dB.mean(),
               sinr_array_pl_metis_ps7_dB.max()))
    else:
         raise ValueError('Invalid path loss model: {0}'.format(pl_model))