Agora  1.2.0
Agora project
inspect_single_frame.m File Reference

Functions

function inspect_single_frame (dataset_filename, inspect_frame, verbose) %%Load data from the input file and inspect evm and snr %dataset_filename
 
id Data ()
 
*for complex type (native float) total_samples
 
 Samples (complex) x User Ant x Downlink Data Symbol Id tx_data_cxdouble
 
 figure ('Name', ['User ' num2str(u) ', Frame ' num2str(inspect_frame) ' Receive WaveForm'])
 
 tiledlayout (2, 1) %Top(Real) nexttile
 
 plot (real(combined_rx))
 
 axis ([0 inf -1 1])
 
 title ('Rx Real(I)')
 
 Bottom (Q) nexttile
 
 plot (imag(combined_rx))
 
 title ('Rx Imag(Q)')
 
 plot (real(combined_tx))
 
 title ('Tx Real(I)')
 
 plot (imag(combined_tx))
 
 title ('Tx Imag(Q)')
 
 figure ('Name', ['Constellation[User ', num2str(u), ']'])
 
 scatter (real(rx_cnstl(:)), imag(rx_cnstl(:)), pt_size, 'r', 'filled')
 
 scatter (real(tx_cnstl(:)), imag(tx_cnstl(:)), pt_size, 'b', 'p', 'filled')
 
 title (['Constellation[User ', num2str(u), ', Frame ', num2str(inspect_frame), ']'])
 
 disp (['Frame Inspect:', num2str(inspect_frame)])
 

Variables

 inspect_frame = 100
 
 verbose = "false"
 
end samples_per_slot = double(h5readatt(dataset_filename, group_id, 'SLOT_SAMP_LEN'))
 
 tx_zero_prefix_len = double(h5readatt(dataset_filename, group_id, 'TX_ZERO_PREFIX_LEN'))
 
 data_size = double(h5readatt(dataset_filename, group_id, 'OFDM_DATA_NUM'))
 
 data_start = double(h5readatt(dataset_filename, group_id, 'OFDM_DATA_START'))
 
 data_stop = double(h5readatt(dataset_filename, group_id, 'OFDM_DATA_STOP'))
 
 fft_size = double(h5readatt(dataset_filename, group_id, 'OFDM_CA_NUM'))
 
 cp_len = double(h5readatt(dataset_filename, group_id, 'CP_LEN'))
 
 total_dl_symbols = double(h5readatt(dataset_filename, group_id, 'DL_SLOTS'))
 
 dl_pilot_symbols = double(h5readatt(dataset_filename, group_id, 'DL_PILOT_SLOTS'))
 
 total_users = double(h5readatt(dataset_filename, group_id, 'CL_NUM'))
 
 beacon_syms = 1
 
 configs
 
Choose the downlink data dataset_id = '/DownlinkData'
 
end Dimensions[Samples, Ant, Symbol, Cells, Frame] start = [1 1 1 1 inspect_frame]
 
 count = [(samples_per_slot * 2) total_users total_dl_symbols 1 1]
 
Generate a int16 array rx_syms_hdf5 = h5read(dataset_filename, strcat(group_id, dataset_id), start, count)
 
Convert to double and scale rx_syms_scaled_double = double(rx_syms_hdf5) ./ double(intmax('int16'))
 
Convert to complex double Samples x User x Symbol rx_syms_cxdouble = complex(rx_syms_scaled_double(1:2:end, :, :), rx_syms_scaled_double(2:2:end, :, :))
 
Split off pilots and data rx_pilot_cxdouble = rx_syms_cxdouble(:,:,1:dl_pilot_symbols)
 
 rx_data_cxdouble = rx_syms_cxdouble(:,:,1+dl_pilot_symbols:end)
 
end Generate a int16 array rx_beacon_hdf5 = h5read(dataset_filename, strcat(group_id,dataset_id), start, count)
 
Convert to double and scale rx_beacon_scaled_double = double(rx_beacon_hdf5) ./ double(intmax('int16'))
 
Convert to complex double Samples x User x Symbol rx_beacon_cxdouble = complex(rx_beacon_scaled_double(1:2:end,:,:), rx_beacon_scaled_double(2:2:end,:, :))
 
 rx_beacon_rssi = process_beacon(rx_beacon_cxdouble, tx_zero_prefix_len)
 
 tx_pilot_hdf5 = double(h5read(dataset_filename, strcat(group_id,dataset_id), start, count))
 
Convert to complex tx_pilot_cxdouble = complex(tx_pilot_hdf5(1:2:end,:), tx_pilot_hdf5(2:2:end,:))
 
 tx_data_hdf5 = double(h5read(dataset_filename, strcat(group_id,dataset_id), start, count))
 
Convert to complex type tx_syms_cxdouble = complex(tx_data_hdf5(1:2:end,:,:), tx_data_hdf5(2:2:end,:,:))
 
clear dataset_filename group_id
 
Plot Rx waveform for u
 
 combined_tx = reshape(squeeze(tx_waveform(:, u, :)), [], 1)
 
 tx_cnstl = tx_data_cxdouble(data_sc_idx, u, :)
 
 pt_size = 15
 
end clear total_users tx_data_cxdouble rx_beacon_cxdouble rx_syms_cxdouble tx_syms_cxdouble combined_rx
 
 precision = 3
 

Function Documentation

◆ axis()

axis ( )

◆ Bottom()

Bottom ( )

◆ Data()

id Data ( )
virtual

◆ disp()

disp ( )

◆ figure() [1/2]

figure ( 'Name'  ,
['Constellation[User ', num2str(u), '] ']   
)

◆ figure() [2/2]

figure ( 'Name'  )

◆ inspect_single_frame()

function inspect_single_frame ( dataset_filename  ,
inspect_frame  ,
verbose   
)

◆ plot() [1/4]

plot ( imag(combined_rx )

◆ plot() [2/4]

plot ( imag(combined_tx )

◆ plot() [3/4]

plot ( real(combined_rx )

◆ plot() [4/4]

plot ( real(combined_tx )

◆ Samples()

Samples ( complex  )

◆ scatter() [1/2]

scatter ( real(rx_cnstl(:))  ,
imag(rx_cnstl(:))  ,
pt_size  ,
'r'  ,
'filled'   
)

◆ scatter() [2/2]

scatter ( real(tx_cnstl(:))  ,
imag(tx_cnstl(:))  ,
pt_size  ,
'b'  ,
'p ,
'filled'   
)

◆ tiledlayout()

tiledlayout ( ,
 
)

◆ title() [1/5]

title ( 'Rx Imag(Q)'  )

◆ title() [2/5]

title ( 'Rx Real(I)'  )

◆ title() [3/5]

title ( 'Tx Imag(Q)'  )

◆ title() [4/5]

title ( 'Tx Real(I)'  )

◆ title() [5/5]

title ( ['Constellation[User ', num2str(u), ', Frame ', num2str(inspect_frame), '] ']  )

◆ type()

* for complex type ( native float  )

Variable Documentation

◆ beacon_syms

beacon_syms = 1

◆ combined_rx

end clear total_users tx_data_cxdouble rx_beacon_cxdouble rx_syms_cxdouble tx_syms_cxdouble combined_rx

◆ combined_tx

combined_tx = reshape(squeeze(tx_waveform(:, u, :)), [], 1)

◆ configs

configs
Initial value:
= [samples_per_slot tx_zero_prefix_len data_size data_start data_stop fft_size cp_len ...
total_dl_symbols dl_pilot_symbols total_users]

◆ count

◆ cp_len

cp_len = double(h5readatt(dataset_filename, group_id, 'CP_LEN'))

◆ data_size

data_size = double(h5readatt(dataset_filename, group_id, 'OFDM_DATA_NUM'))

◆ data_start

data_start = double(h5readatt(dataset_filename, group_id, 'OFDM_DATA_START'))

◆ data_stop

data_stop = double(h5readatt(dataset_filename, group_id, 'OFDM_DATA_STOP'))

◆ dataset_id

clear start count total_samples tx_data_hdf5 dataset_id = '/DownlinkData'

◆ dl_pilot_symbols

dl_pilot_symbols = double(h5readatt(dataset_filename, group_id, 'DL_PILOT_SLOTS'))

◆ fft_size

clear beacon_syms cp_len data_size data_start data_stop dl_pilot_symbols samples_per_slot tx_zero_prefix_len total_dl_symbols fft_size = double(h5readatt(dataset_filename, group_id, 'OFDM_CA_NUM'))

◆ group_id

clear dataset_filename group_id

◆ inspect_frame

inspect_frame = 100

◆ precision

precision = 3

◆ pt_size

hold on pt_size = 15

◆ rx_beacon_cxdouble

Convert to complex double Samples x User x Symbol rx_beacon_cxdouble = complex(rx_beacon_scaled_double(1:2:end,:,:), rx_beacon_scaled_double(2:2:end,:, :))

◆ rx_beacon_hdf5

clear rx_beacon_hdf5 = h5read(dataset_filename, strcat(group_id,dataset_id), start, count)

◆ rx_beacon_rssi

rx_beacon_rssi = process_beacon(rx_beacon_cxdouble, tx_zero_prefix_len)

◆ rx_beacon_scaled_double

clear rx_beacon_scaled_double = double(rx_beacon_hdf5) ./ double(intmax('int16'))

◆ rx_data_cxdouble

clear configs tx_pilot_cxdouble rx_pilot_cxdouble rx_data_cxdouble = rx_syms_cxdouble(:,:,1+dl_pilot_symbols:end)

◆ rx_pilot_cxdouble

Split off pilots and data rx_pilot_cxdouble = rx_syms_cxdouble(:,:,1:dl_pilot_symbols)

◆ rx_syms_cxdouble

Convert to complex double Samples x User x Symbol rx_syms_cxdouble = complex(rx_syms_scaled_double(1:2:end, :, :), rx_syms_scaled_double(2:2:end, :, :))

◆ rx_syms_hdf5

clear rx_syms_hdf5 = h5read(dataset_filename, strcat(group_id, dataset_id), start, count)

◆ rx_syms_scaled_double

clear rx_syms_scaled_double = double(rx_syms_hdf5) ./ double(intmax('int16'))

◆ samples_per_slot

end samples_per_slot = double(h5readatt(dataset_filename, group_id, 'SLOT_SAMP_LEN'))

◆ start

end start = [1 1 1 1 inspect_frame]

◆ total_dl_symbols

total_dl_symbols = double(h5readatt(dataset_filename, group_id, 'DL_SLOTS'))

◆ total_users

total_users = double(h5readatt(dataset_filename, group_id, 'CL_NUM'))

◆ tx_cnstl

tx_cnstl = tx_data_cxdouble(data_sc_idx, u, :)

◆ tx_data_hdf5

tx_data_hdf5 = double(h5read(dataset_filename, strcat(group_id,dataset_id), start, count))

◆ tx_pilot_cxdouble

Convert to complex tx_pilot_cxdouble = complex(tx_pilot_hdf5(1:2:end,:), tx_pilot_hdf5(2:2:end,:))

◆ tx_pilot_hdf5

tx_pilot_hdf5 = double(h5read(dataset_filename, strcat(group_id,dataset_id), start, count))

◆ tx_syms_cxdouble

Convert to complex type tx_syms_cxdouble = complex(tx_data_hdf5(1:2:end,:,:), tx_data_hdf5(2:2:end,:,:))

◆ tx_zero_prefix_len

tx_zero_prefix_len = double(h5readatt(dataset_filename, group_id, 'TX_ZERO_PREFIX_LEN'))

◆ u

end clear u
Initial value:
combined_rx = reshape(squeeze(rx_syms_cxdouble(:, u, :)), [], 1)

◆ verbose

Compare the pilot data if verbose = "false"
total_users
total_users
Definition: inspect_single_frame.m:22
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
rx_syms_cxdouble
Convert to complex double Samples x User x Symbol rx_syms_cxdouble
Definition: inspect_single_frame.m:45
combined_rx
end clear total_users tx_data_cxdouble rx_beacon_cxdouble rx_syms_cxdouble tx_syms_cxdouble combined_rx
Definition: inspect_single_frame.m:148