def __init__(self, args=args_default): # set basic paramters self.frequency = args['frequency'] self.bw = args['bw'] # Bandwidth in Hz self.tx_pow = args['tx_power'] # TX power in dBm self.nsect_t = args['nsect_t'] self.nsect_a = args['nsect_a'] self.uav_number = args['uav_number'] self.bs_elev_angle_t = args[ 'bs_elev_t'] # downtilt on terrestrial cells self.bs_elev_angle_a = args['bs_elev_a'] self.uav_elev_angle = args['uav_elev'] self.thetabw = args['thetabw'] self.phibw = args['phibw'] # set constant values self.lambda_ = const_values.speed_of_light / self.frequency self.pi = const_values.pi self.nf = 6 # Noise figure in dB self.kT = -174 # Thermal noise in dB/Hz ## let's get link state using the trained VAE model #model_dir = 'models/uav_beijing' self.pl_max = 200.0 # Construct the channel model object K.clear_session() self.chan_mod = load_model('uav_boston', src='remote') self.npath_max = self.chan_mod.npaths_max # Load the learned link classifier model self.chan_mod.load_link_model() # Load the learned path model self.chan_mod.load_path_model() self.npaths_max = self.chan_mod.npaths_max self.arr_gnb_list_a = [] self.arr_gnb_list_t = [] self.arr_ue_list = []
elem_ue = Elem3GPP(thetabw=65, phibw=65) elem_gnb_t = Elem3GPP(thetabw=65, phibw=65) elem_gnb_a = Elem3GPP(thetabw=65, phibw=65) frequency = 28e9 nsect = 1 arr_gnb_t = URA(elem=elem_gnb_t, nant=np.array([8, 8]), fc=frequency) arr_gnb_a = URA(elem=elem_gnb_a, nant=np.array([8, 8]), fc=frequency) arr_ue0 = URA(elem=elem_ue, nant=np.array([4, 4]), fc=frequency) #arr_gnb_list_a = multi_sect_array( arr_gnb_a, sect_type= 'azimuth', nsect=nsect, theta0=45 ) arr_gnb_list_t = RotatedArray(arr_gnb_t, theta0=90) #arr_gnb_list_t = multi_sect_array(arr_gnb_t, sect_type = 'azimuth', nsect= nsect,theta0=90) arr_ue = RotatedArray(arr_ue0, theta0=-90, drone=True) K.clear_session() chan_mod = load_model('uav_lon_tok', src='remote') #self.npath_max = self.chan_mod.npaths_max # Load the learned link classifier model chan_mod.load_link_model() # Load the learned path model chan_mod.load_path_model() bs_loc = np.array([0, 0, 0]) R = 20 height = 10 n = 21 drone = True if drone is True: type = 'E_Gain_Drone_Side_of_Measured_Patterns_using_new_rotation' else: type = 'E_Gain_Drone_Side_of_3GPP_Patterns_using_new_rotation'
def __init__(self, mod_name='uav_beijing', bs_type='Terrestrial', npts=100, nsect=3, cdf_prob=0.5, horizontal_axis_of_net=np.linspace(0, 100, 20), vertical_axis_of_net=np.linspace(1, 150, 20), cmap_name='plasma', plane_type='xz', plane_shift=0): """ This class plots a heat map showing strength of SNR values using color bar We can observe how SNR values change in different planes (x-y, y-z, x-z) for terrestrial and aerial BSs changing antenna configurations: number of sectors and tilted angle Parameters ---------- mod_name: model name depending on name of city bs_type: Either 'Terrestrial' or 'Aerial' npts: number of random channels generated at one point nsect: number of sectors for antenna array cdf_prob: the probability to take SNR value from its CDF net_work_area_hori: horizontal values consisting of network area ( observation plane) net_work_area_verti: vertical values consisting of network area (observation plane) cmap_name: types of color bar: https://matplotlib.org/3.3.3/tutorials/colors/colormaps.html plane_type: types of plane where we can observe data plan_shift: value for shifting observation plane """ # Paramters self.bw = 400e6 # Bandwidth in Hz self.nf = 6 # Noise figure in dB self.kT = -174 # Thermal noise in dBm/Hz self.tx_pow = 23 # TX power in dBm self.horizontal_axis_of_net = horizontal_axis_of_net self.vertical_axis_of_net = vertical_axis_of_net self.cmap_name = cmap_name self.plane_type = plane_type self.plane_shift = plane_shift # value for shifting plane fc = 28e9 # carrier frequency in Hz nant_gnb = np.array([8, 8]) # gNB array size nant_ue = np.array([4, 4]) # UE/UAV array size # We downtilt the array and then replicate it over three sectors elem_gnb = Elem3GPP(thetabw=65, phibw=65) self.arr_gnb0 = URA(elem=elem_gnb, nant=nant_gnb, fc=fc) # UE array. Array is pointing down. elem_ue = Elem3GPP(thetabw=65, phibw=65) arr_ue0 = URA(elem=elem_ue, nant=nant_ue, fc=fc) self.arr_ue = RotatedArray(arr_ue0, theta0=-90) # Construct and load the channel model object #print('Loading pre-trained model %s' % mod_name) K.clear_session() self.chan_mod = load_model(mod_name, src='remote') # Get types of cell; terrestrial or aerial cell_types = self.chan_mod.rx_types self.cell_type = np.where(np.array(cell_types) == bs_type)[0] self.npts = npts self.nsect = nsect self.cdf_prob = cdf_prob self.vmin = -10 self.vmax = 60
# Number of x and z bins nx = 40 nz = 20 # Range of x and z distances to test xlim = np.array([0, 500]) zlim = np.array([0, 130]) """ Create the arrays """ """ Load the pre-trained model """ # Construct and load the channel model object K.clear_session() chan_mod = load_model(mod_name) # Get types of RX rx_types = chan_mod.rx_types # Terrestrial gNB. # We downtilt the array and then replicate it over three sectors elem_gnb = Elem3GPP(thetabw=30, phibw=30) arr_gnb0 = URA(elem=elem_gnb, nant=nant_gnb, fc=fc) # UE array. Array is pointing down. elem_ue = Elem3GPP(thetabw=30, phibw=30) arr_ue0 = URA(elem=elem_ue, nant=nant_ue, fc=fc) arr_ue = RotatedArray(arr_ue0, theta0=180) SNR_median = [] uptilt_a_list = [-10, 0, 5, 10, 30, 40, 45, 60, 80, 90]