|
RENEWLab
1.1.0
RENEW project
|
Functions | |
| Scale for Tx | waveform ([0:1]) else nt |
| Theoretical BER | fprintf ("Channel type: %s \n", chan_type) |
| if TX_GN | display ('WARNING:MAXIMUM TX GAIN IS 81!') |
| 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 | fdd_mat (SC_IND_DATA, :) |
| fdd_mat (SC_IND_PILOTS, :) | |
| 1, N_ZPAD_POST | zeros () |
| abs(tx_vec_iris | max () |
| id | a () |
Variables | |
| Author(s) close | all |
| 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 = "rayleigh" |
| nt = 100 | |
| sim_SNR_db = 1:20 | |
| nsnr = length(sim_SNR_db) | |
| snr_plot = 20 | |
| TX_SCALE = 1 | |
| end | ber_SIM = zeros(nt,nsnr) |
| BER | berr_th = zeros(nsnr,1) |
| Iris | params |
| N_UE = 1 | |
| TX_FRQ = 3.6e9 | |
| RX_FRQ = TX_FRQ | |
| TX_GN = 75 | |
| RX_GN = 70 | |
| SMPL_RT = 5e6 | |
| N_FRM = 10 | |
| end | bs_ids = string.empty() |
| bs_sched = string.empty() | |
| ue_ids = string.empty() | |
| ue_sched = string.empty() | |
| 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 | 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) |
| Time Domain Do | yourselves |
| Insert the data and pilot | values |
| Do Insert the cyclic prefix if(CP_LEN > 0) % Do yourselves | tdd_tx_payload_mat = [tx_cp |
| end Reshape to a vector | tx_payload_vec = reshape(tdd_tx_payload_mat, 1, numel(tdd_tx_payload_mat)) |
| Leftover from zero | padding |
| for | isnr |
| n_samp = length(tx_vec_iris) | |
| 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 two Iris node | objects |
| ue_sdr_params | tdd_sched = ue_sched |
| l_rx_dec =length(rx_vec_iris) | |
|
virtual |

| other subcarriers will remain at fdd_mat | ( | SC_IND_DATA | , |
| : | |||
| ) |
| fdd_mat | ( | SC_IND_PILOTS | , |
| : | |||
| ) |
|
virtual |
| Theoretical BER fprintf | ( | "Channel type: %s \n" | , |
| chan_type | |||
| ) |
|
staticvirtual |
| Modulation order | ( | 2/4/16/ | 64 = BSPK/QPSK/16-QAM/64-QAM | ) |
| Scale for Tx waveform | ( | ) |
|
virtual |
| Author (s) close all |
| end 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 |
| ue_sdr_params id = ue_ids |
| 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 |
| Time Domain Do N_OFDM_SYM = 46 |
| UE schedule n_samp = length(tx_vec_iris) |
| Do N_SC = 64 |
| ue_sdr_params n_sdrs = N_UE |
| N_UE = 1 |
| Number of samples that will go over the air N_ZPAD_PRE = 90 |
| nsnr = length(sim_SNR_db) |
| nt = 100 |
| just to agree with what the hardware spits out else Init Iris nodes Set up the Iris experiment Create two Iris node objects |
| Leftover from zero padding |
| Iris params |
| PLOT = 0 |
| RX_FRQ = TX_FRQ |
| RX_GN = 70 |
| 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] |
| 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 |
| tdd_tx_payload_mat = [tx_cp |
| Generate a payload of random integers tx_data = randi(MOD_ORDER, 1, N_DATA_SYMS) - 1 |
| TX_FRQ = 3.6e9 |
| TX_GN = 75 |
| end Reshape to a vector tx_payload_vec = reshape(tdd_tx_payload_mat, 1, numel(tdd_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) |
| ue_sdr_params txgain = [] |
| ue_ids = string.empty() |
| ue_sdr_params = bs_sdr_params |
| Insert the data and pilot values |
| Do yourselves |