RENEWLab
1.1.0
RENEW project
|
Functions | |
Scale for Tx | waveform ([0:1]) N_BS_NODE |
x BS | NODES (multiple-output) N_UE |
UE (single-input) bs_ids | |
Theoretical BER | fprintf ("Channel type: %s \n", chan_type) |
Modulation | order (2/4/16/64=BSPK/QPSK/16-QAM/64-QAM) % OFDM params SC_IND_PILOTS |
Number of data | symbols (one per data-bearing subcarrier per OFDM symbol) N_LTS_SYM |
id | FFT_OFFSET () |
Number of CP samples to use in | FFT (on average) DO_APPLY_PHASE_ERR_CORRECTION |
other subcarriers will remain at | ifft_in_mat (SC_IND_DATA, :) |
ifft_in_mat (SC_IND_PILOTS, :) | |
Insert the cyclic prefix | if (CP_LEN > 0) tx_cp |
1, N_ZPAD_POST | zeros () |
abs(tx_vec_iris | max () |
id | chains: (id RF3E000303) |
Variables | |
Author (s)[version, executable, isloaded] = pyversion | |
if ~isloaded pyversion usr bin python py print() %weird bug where py isn 't loaded in an external script end % Params Enable writing plots to PNG | SIM_MOD = 0 |
PLOT = 0 | |
if SIM_MOD | chan_type = "awgn" |
nt = 100 | |
sim_SNR_db = 1:20 | |
nsnr = length(sim_SNR_db) | |
snr_plot = 20 | |
TX_SCALE = 1 | |
ue_ids = ones(1, N_UE) | |
Iris | params |
TX_FRQ = 3.55e9 | |
RX_FRQ = TX_FRQ | |
TX_GN = 70 | |
RX_GN = 70 | |
SMPL_RT = 5e6 | |
N_FRM = 10 | |
bs_ids = string.empty() | |
bs_sched = string.empty() | |
ue_scheds = string.empty() | |
end | ber_SIM = zeros(nt,nsnr) |
BER | berr_th = zeros(nsnr,1) |
Waveform params | N_OFDM_SYM = 46 |
Number of OFDM symbols for | burst |
Number of OFDM symbols for it needs to be less than | MOD_ORDER = 16 |
Pilot subcarrier indices | SC_IND_DATA = [2:7 9:21 23:27 39:43 45:57 59:64] |
Data subcarrier indices | SC_IND_DATA_PILOT = [2:27 39:64]' |
N_SC = 64 | |
Number of subcarriers | CP_LEN = 16 |
Cyclic prefix length | N_DATA_SYMS = N_OFDM_SYM * length(SC_IND_DATA) |
Number of | N_SYM_SAMP = N_SC + CP_LEN |
Number of samples that will go over the air | N_ZPAD_PRE = 90 |
Enable Residual CFO estimation correction Define the preamble LTS for fine CFO and channel estimation | lts_f |
lts_t = ifft(lts_f, 64) | |
time domain | preamble = [lts_t(33:64) lts_t lts_t] |
Generate a payload of random integers | tx_data = randi(MOD_ORDER, 1, N_DATA_SYMS) - 1 |
tx_syms = mod_sym(tx_data, MOD_ORDER) | |
Reshape the symbol vector to a matrix with one column per OFDM symbol | tx_syms_mat = reshape(tx_syms, length(SC_IND_DATA), N_OFDM_SYM) |
Define the pilot tone values as BPSK symbols | pilots = [1 1 -1 1].' |
Repeat the pilots across all OFDM symbols | pilots_mat = repmat(pilots, 1, N_OFDM_SYM) |
IFFT Construct the IFFT input matrix | ifft_in_mat = zeros(N_SC, N_OFDM_SYM) |
Insert the data and pilot | values |
Perform the IFFT | tx_payload_mat = ifft(ifft_in_mat, N_SC, 1) |
end Reshape to a vector | tx_payload_vec = reshape(tx_payload_mat, 1, numel(tx_payload_mat)) |
tx_vec = [preamble tx_payload_vec] | |
Leftover from zero | padding |
for | isnr |
bs_sdr_params | |
ue_sdr_params = bs_sdr_params | |
ue_sdr_params | id = ue_ids |
ue_sdr_params | n_sdrs = N_UE |
ue_sdr_params | txgain = [] |
rx_vec_iris = getRxVec(tx_vec_iris, N_BS_NODE, N_UE, chan_type, sim_SNR_db(isnr), bs_sdr_params, ue_sdr_params, []) | |
just to agree with what the hardware spits out else Init Iris nodes Set up the Iris experiment Create BS Hub and UE objects | Note |
hub_id = "FH4B000021" | |
N_BS_NODE = length(bs_ids) | |
N_UE = length(ue_ids) | |
BS schedule | ue_sched = ["GGGGGGPG"] |
UE schedule | n_samp = length(tx_vec_iris) |
ue_sdr_params | tdd_sched = ue_sched |
l_rx_dec =length(rx_vec_iris) | |
Correlate for LTS | a = 1 |
|
virtual |
Theoretical BER fprintf | ( | "Channel type: %s \n" | , |
chan_type | |||
) |
other subcarriers will remain at ifft_in_mat | ( | SC_IND_DATA | , |
: | |||
) |
ifft_in_mat | ( | SC_IND_PILOTS | , |
: | |||
) |
|
staticvirtual |
Modulation order | ( | 2/4/16/ | 64 = BSPK/QPSK/16-QAM/64-QAM | ) |
UE | ( | single- | input | ) |
Scale for Tx waveform | ( | ) |
|
virtual |
Correlate for LTS a = 1 |
Author(s)[version, executable, isloaded] = pyversion |
else bs_ids = string.empty() |
bs_sched = string.empty() |
Iris nodes parameters bs_sdr_params |
Number of OFDM symbols for burst |
Number of subcarriers CP_LEN = 16 |
hub_id = "FH4B000021" |
ue_sdr_params id = ue_ids |
IFFT Construct the IFFT input matrix ifft_in_mat = zeros(N_SC, N_OFDM_SYM) |
for isnr |
l_rx_dec =length(rx_vec_iris) |
Enable Residual CFO estimation correction Define the preamble LTS for fine CFO and channel estimation lts_f |
lts_t = ifft(lts_f, 64) |
Number of OFDM symbols for it needs to be less than MOD_ORDER = 16 |
Cyclic prefix length N_DATA_SYMS = N_OFDM_SYM * length(SC_IND_DATA) |
N_FRM = 10 |
Waveform params N_OFDM_SYM = 46 |
UE schedule n_samp = length(tx_vec_iris) |
N_SC = 64 |
ue_sdr_params n_sdrs = N_UE |
Number of samples that will go over the air N_ZPAD_PRE = 90 |
just to agree with what the hardware spits out else Init Iris nodes Set up the Iris experiment Create BS Hub and UE objects Note |
nsnr = length(sim_SNR_db) |
else nt = 100 |
Leftover from zero padding |
Iris params |
PLOT = 0 |
RX_FRQ = TX_FRQ |
RX_GN = 70 |
end end rx_vec_iris = getRxVec(tx_vec_iris, N_BS_NODE, N_UE, chan_type, sim_SNR_db(isnr), bs_sdr_params, ue_sdr_params, []) |
Pilot subcarrier indices SC_IND_DATA = [2:7 9:21 23:27 39:43 45:57 59:64] |
Data subcarrier indices SC_IND_DATA_PILOT = [2:27 39:64]' |
if ~isloaded pyversion usr bin python py print () %weird bug where py isn't loaded in an external script end % Params Enable writing plots to PNG SIM_MOD = 0 |
sim_SNR_db = 1:20 |
SMPL_RT = 5e6 |
snr_plot = 20 |
ue_sdr_params tdd_sched = ue_sched |
Generate a payload of random integers tx_data = randi(MOD_ORDER, 1, N_DATA_SYMS) - 1 |
TX_FRQ = 3.55e9 |
TX_GN = 70 |
tx_payload_mat = ifft(ifft_in_mat, N_SC, 1) |
end Reshape to a vector tx_payload_vec = reshape(tx_payload_mat, 1, numel(tx_payload_mat)) |
TX_SCALE = 1 |
Reshape the symbol vector to a matrix with one column per OFDM symbol tx_syms_mat = reshape(tx_syms, length(SC_IND_DATA), N_OFDM_SYM) |
tx_vec = [preamble tx_payload_vec] |
ue_sdr_params txgain = [] |
ue_scheds = string.empty() |
ue_sdr_params = bs_sdr_params |
Insert the data and pilot values |