|
| function [data_phase_corr, data_sc_idx, evm, snr, rf_snr_db, tx_waveform] |
|
| samples_per_slot = configs(1) |
|
| tx_zero_prefix_len = configs(2) |
|
| data_size = configs(3) |
|
| data_start = configs(4) |
|
| data_stop = configs(5) |
|
| fft_size = configs(6) |
|
| cp_len = configs(7) |
|
| total_dl_symbols = configs(8) |
|
| dl_pilot_symbols = configs(9) |
|
| total_users = configs(10) |
|
| dl_data_symbols = total_dl_symbols - dl_pilot_symbols |
|
| snr = zeros(1, total_users) |
|
| evm = zeros(1, total_users) |
|
| rf_snr_db = zeros(1, total_users) |
|
| nz_start_idx = (fft_size - data_size)/2 |
|
| nz_sc_idx = nz_start_idx+1:nz_start_idx+data_size |
|
| nz_stop_idx = nz_start_idx+data_size |
|
| plt_trk_sp = 16 |
|
| data_sc_idx = setdiff(1:data_size, 1:plt_trk_sp:data_size) |
|
| data_phase_corr = zeros(data_size, dl_data_symbols, total_users) |
|
for | u |
|
| pilot_power = 0 |
|
| noise_power = 0 |
|
for | p |
|
| noise = [rx_pilot_f_tmp(1:nz_start_idx) |
|
end | rf_snr = (pilot_power - noise_power)/noise_power |
|
else | ch_est_mean = mean(ch_est, 2) |
|
| aevms = zeros(1, dl_data_symbols) |
|
for | d |
|
| data_eq = rx_data_f_tmp(nz_sc_idx) ./ ch_est_mean |
|
pilot tracking | phase_err = angle(mean((data_eq(1:plt_trk_sp:end) .* conj(tx_pilot_cxdouble(1:plt_trk_sp:end, u))))) |
|
| evm_mat = abs(data_phase_corr(data_sc_idx, d, u) - tx_data_cxdouble(data_sc_idx, u, d)).^2 |
|
end | data_slot_range = dl_pilot_symbols + 1: total_dl_symbols |
|
| tx_waveform_f = zeros(fft_size, total_users, total_dl_symbols) |
|
| tx_waveform = zeros(samples_per_slot, total_users, total_dl_symbols) |
|