RENEWLab  1.1.0
RENEW project
rl_ofdm_simo.m File Reference

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
 

Function Documentation

◆ chains:()

id chains: ( id  RF3E000303)
virtual

◆ FFT()

Number of CP samples to use in FFT ( on  average)

◆ FFT_OFFSET()

id FFT_OFFSET ( )
virtual

◆ fprintf()

Theoretical BER fprintf ( "Channel type: %s \n"  ,
chan_type   
)

◆ if()

Insert the cyclic prefix if ( CP_LEN  ,
 
)

◆ ifft_in_mat() [1/2]

other subcarriers will remain at ifft_in_mat ( SC_IND_DATA  ,
 
)

◆ ifft_in_mat() [2/2]

ifft_in_mat ( SC_IND_PILOTS  ,
 
)

◆ max()

abs(tx_vec_iris max ( )
staticvirtual

◆ NODES()

x BS NODES ( multiple-  output)

◆ order()

Modulation order ( 2/4/16/  64 = BSPK/QPSK/16-QAM/64-QAM)

◆ symbols()

Number of data symbols ( one per data-bearing subcarrier per OFDM  symbol)

◆ UE()

UE ( single-  input)

◆ waveform()

Scale for Tx waveform ( )

◆ zeros()

1,N_ZPAD_POST zeros ( )
virtual

Variable Documentation

◆ a

Correlate for LTS a = 1

◆ Author

Author(s)[version, executable, isloaded] = pyversion

◆ ber_SIM

end ber_SIM = zeros(nt,nsnr)

◆ berr_th

BER berr_th = zeros(nsnr,1)

◆ bs_ids

else bs_ids = string.empty()

◆ bs_sched

bs_sched = string.empty()

◆ bs_sdr_params

Iris nodes parameters bs_sdr_params
Initial value:
= struct(...
'id', bs_ids, ...
'n_sdrs', N_BS_NODE, ... % number of nodes chained together
'txfreq', [], ...
'rxfreq', [], ...
'txgain', [], ...
'rxgain', [], ...
'sample_rate', [], ...
'n_samp', n_samp, ... % number of samples per frame time.
'n_frame', [], ...
'tdd_sched', [], ... % number of zero-paddes samples
)

◆ burst

Number of OFDM symbols for burst

◆ chan_type

if SIM_MOD chan_type = "awgn"

◆ CP_LEN

Number of subcarriers CP_LEN = 16

◆ hub_id

hub_id = "FH4B000021"

◆ id

◆ ifft_in_mat

IFFT Construct the IFFT input matrix ifft_in_mat = zeros(N_SC, N_OFDM_SYM)

◆ isnr

for isnr
Initial value:
= 1:nsnr
for it = 1:nt
if (SIM_MOD)
% Iris nodes' parameters
n_samp = length(tx_vec_iris)

◆ l_rx_dec

l_rx_dec =length(rx_vec_iris)

◆ lts_f

Enable Residual CFO estimation correction Define the preamble LTS for fine CFO and channel estimation lts_f
Initial value:
= [0 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 -1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 ...
1 1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 1 1 1]

◆ lts_t

lts_t = ifft(lts_f, 64)

◆ MOD_ORDER

Number of OFDM symbols for it needs to be less than MOD_ORDER = 16

◆ N_BS_NODE

N_BS_NODE = length(bs_ids)

◆ N_DATA_SYMS

Cyclic prefix length N_DATA_SYMS = N_OFDM_SYM * length(SC_IND_DATA)

◆ N_FRM

N_FRM = 10

◆ N_OFDM_SYM

Waveform params N_OFDM_SYM = 46

◆ n_samp

◆ N_SC

N_SC = 64

◆ n_sdrs

ue_sdr_params n_sdrs = N_UE

◆ N_SYM_SAMP

Number of N_SYM_SAMP = N_SC + CP_LEN

◆ N_UE

N_UE = length(ue_ids)

◆ N_ZPAD_PRE

Number of samples that will go over the air N_ZPAD_PRE = 90

◆ Note

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

nsnr = length(sim_SNR_db)

◆ nt

else nt = 100

◆ padding

Leftover from zero padding

◆ params

Iris params

◆ pilots

Define the pilot tone values as BPSK symbols pilots = [1 1 -1 1].'

◆ pilots_mat

Repeat the pilots across all OFDM symbols pilots_mat = repmat(pilots, 1, N_OFDM_SYM)

◆ PLOT

PLOT = 0

◆ preamble

time domain preamble = [lts_t(33:64) lts_t lts_t]

◆ RX_FRQ

RX_FRQ = TX_FRQ

◆ RX_GN

RX_GN = 70

◆ rx_vec_iris

◆ SC_IND_DATA

Pilot subcarrier indices SC_IND_DATA = [2:7 9:21 23:27 39:43 45:57 59:64]

◆ SC_IND_DATA_PILOT

Data subcarrier indices SC_IND_DATA_PILOT = [2:27 39:64]'

◆ SIM_MOD

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

sim_SNR_db = 1:20

◆ SMPL_RT

SMPL_RT = 5e6

◆ snr_plot

snr_plot = 20

◆ tdd_sched

ue_sdr_params tdd_sched = ue_sched

◆ tx_data

Generate a payload of random integers tx_data = randi(MOD_ORDER, 1, N_DATA_SYMS) - 1

◆ TX_FRQ

TX_FRQ = 3.55e9

◆ TX_GN

TX_GN = 70

◆ tx_payload_mat

tx_payload_mat = ifft(ifft_in_mat, N_SC, 1)

◆ tx_payload_vec

end Reshape to a vector tx_payload_vec = reshape(tx_payload_mat, 1, numel(tx_payload_mat))

◆ TX_SCALE

TX_SCALE = 1

◆ tx_syms

tx_syms = mod_sym(tx_data, MOD_ORDER)

◆ tx_syms_mat

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

◆ txgain

ue_sdr_params txgain = []

◆ ue_ids

end ue_ids = ones(1, N_UE)

◆ ue_sched

BS schedule ue_sched = ["GGGGGGPG"]

◆ ue_scheds

ue_scheds = string.empty()

◆ ue_sdr_params

ue_sdr_params = bs_sdr_params

◆ values

Insert the data and pilot values
nt
nt
Definition: rl_ofdm_simo.m:46
bs_ids
bs_ids
Definition: rl_ofdm_simo.m:71
n_zpad_samp
n_zpad_samp
Definition: iris_py.m:35
SIM_MOD
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
Definition: rl_ofdm_simo.m:41
nsnr
nsnr
Definition: rl_ofdm_simo.m:48
samples
end Rx payload processing Extract the payload samples(integral number of OFDM symbols following preamble) payload_vec
N_ZPAD_PRE
Number of samples that will go over the air N_ZPAD_PRE
Definition: rl_ofdm_simo.m:95
extract_pilots_data.frame
frame
Definition: extract_pilots_data.py:58
n_samp
UE schedule n_samp
Definition: rl_ofdm_simo.m:215
N_BS_NODE
N_BS_NODE
Definition: rl_ofdm_simo.m:209