Contents

Generate Dataset

addpath('DeepMIMO_functions')
dataset_params = read_params('DeepMIMOv2_example_1_params.m');

% Generate the dataset with the loaded parameters
[DeepMIMO_dataset, dataset_params] = DeepMIMO_generator(dataset_params);
 DeepMIMO Dataset Generation started
 Reading the channel parameters of the ray-tracing scenario O1_60
 Basestation 1
 Basestation 2
 Constructing the DeepMIMO Dataset for BS 1 - Percentage completed: 100.0
 Constructing the DeepMIMO Dataset for BS 2 - Percentage completed: 100.0
 DeepMIMO Dataset Generation completed 

Variable Inspection (BS-UE channel)

Select a transmit basestation and a receive user pair. Note: These variables will be used later to select a single user.

TX_BS = 1; RX_User = 1;

% Let's check the size of the dataset
size_of_BSuser_channel = size(DeepMIMO_dataset{TX_BS}.user{RX_User}.channel)

% BS-user link information
BS_user_link = DeepMIMO_dataset{TX_BS}.user{RX_User}

% Channel path information
BS_user_path_params = DeepMIMO_dataset{TX_BS}.user{RX_User}.path_params
size_of_BSuser_channel =

     1    32    64


BS_user_link = 

  struct with fields:

        channel: [1×32×64 single]
       rotation: [0 0 0]
            loc: [242.4230 297.1710 2]
     LoS_status: 1
       distance: 92.6780
       pathloss: 104.6560
    path_params: [1×1 struct]


BS_user_path_params = 

  struct with fields:

       DoD_phi: [1×9 single]
     DoD_theta: [1×9 single]
       DoA_phi: [1×9 single]
     DoA_theta: [1×9 single]
         phase: [1×9 single]
           ToA: [1×9 single]
         power: [1×9 single]
     num_paths: 9
    LoS_status: 1

Variable Inspection (BS-BS channel)

Select a transmit basestation and a receive basesation pair

TX_BS = 1; RX_BS = 2;

% Let's check the size of the dataset
size_of_BSBS_channel = size(DeepMIMO_dataset{TX_BS}.basestation{RX_BS}.channel)

% BS-BS link information
BS_BS_link = DeepMIMO_dataset{TX_BS}.basestation{RX_BS}

% Channel path information
BS_BS_path_params = DeepMIMO_dataset{TX_BS}.basestation{RX_BS}.path_params
size_of_BSBS_channel =

    32    32    64


BS_BS_link = 

  struct with fields:

        channel: [32×32×64 single]
       rotation: [0 0 0]
            loc: [287.5040 389.5040 6]
     LoS_status: 1
       distance: 52
       pathloss: 103.4520
    path_params: [1×1 struct]


BS_BS_path_params = 

  struct with fields:

       DoD_phi: [0 0 179.5880 0 179.5880 0 179.5820 179.5820 0.1432 0.1432]
     DoD_theta: [90 102.1550 100.3180 99.9960 90 90 98.7150 90 90 93.6194]
       DoA_phi: [1×10 single]
     DoA_theta: [90 102.1550 100.3180 99.9960 90 90 98.7150 90 90 93.6194]
         phase: [1×10 single]
           ToA: [1×10 single]
         power: [1×10 single]
     num_paths: 10
    LoS_status: 1

Visualization of a channel matrix

H = squeeze(DeepMIMO_dataset{TX_BS}.user{RX_User}.channel);
subcarriers = 1:dataset_params.OFDM_sampling_factor:dataset_params.OFDM_limit;
ant_ind = 1:prod(dataset_params.num_ant_BS);

figure;
imagesc(ant_ind, subcarriers, abs(H).');
xlabel('TX Antennas');
ylabel('Subcarriers');
title('Channel Magnitude Response');
colorbar;

Visualization of the UE positions and path-losses

bs_loc = DeepMIMO_dataset{TX_BS}.loc;
num_ue = 100*181; % 100 rows of 181 UEs

ue_locs = zeros(num_ue, 3);
ue_pl = zeros(num_ue, 1);
for ue_idx = 1:num_ue
    ue_locs(ue_idx, :) = DeepMIMO_dataset{TX_BS}.user{ue_idx}.loc;
    ue_pl(ue_idx) = DeepMIMO_dataset{TX_BS}.user{ue_idx}.pathloss;
end

% 3D Grid visualization with basestation
figure;
scatter3(ue_locs(:, 1), ue_locs(:, 2), ue_locs(:, 3), [], ue_pl);
hold on
scatter3(bs_loc(1), bs_loc(2), bs_loc(3), 'rx');
colorbar()
xlabel('x (m)');
ylabel('y (m)');
zlabel('z (m)');
title('Path Loss (dB)')
legend('UE', 'BS', 'Location', 'best')

% 2D Grid Visualization
figure;
scatter(ue_locs(:, 1), ue_locs(:, 2), [], ue_pl);
colorbar()
xlabel('x (m)');
ylabel('y (m)');
title('UE Grid Path Loss (dB)')
xlim([min(ue_locs(:, 1)), max(ue_locs(:, 1))])
ylim([min(ue_locs(:, 2)), max(ue_locs(:, 2))])