|
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)]) |
|
|
| 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 |
|