RENEWLab  1.1.0
RENEW project
ofdm_siso.m File Reference

Functions

Scale for Tx waveform ([0:1]) else nt
 
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 fdd_mat (SC_IND_DATA, :)
 
 fdd_mat (SC_IND_PILOTS, :)
 
1, N_ZPAD_POST zeros ()
 
abs(tx_vec_iris max ()
 
 ue_ids (end+1)
 
 sdr_params (2)
 
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 CHANNEL = 11
 
Channel to tune Tx and Rx radios SIM_MOD = 1
 
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 = 2.5e9
 
 RX_FRQ = TX_FRQ
 
 TX_GN = 43
 
 RX_GN = 20
 
 SMPL_RT = 5e6
 
 N_FRM = 10
 
 b_ids = string.empty()
 
 b_scheds = string.empty()
 
 ue_ids = string.empty()
 
 ue_scheds = 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
 
 rx_vec_iris = rx_vec_iris.'
 
just to agree with what the hardware spits out else Init Iris nodes Set up the Iris experiment Create two Iris node objects
 
 b_prim_sched = "PGGGGGRG"
 
BS primary noede s schedule
 
for iu
 
end n_samp = length(tx_vec_iris)
 
Iris nodes parameters sdr_params
 
 l_rx_dec =length(rx_vec_iris)
 

Function Documentation

◆ a()

id a ( )
virtual

◆ fdd_mat() [1/2]

other subcarriers will remain at fdd_mat ( SC_IND_DATA  ,
 
)

◆ fdd_mat() [2/2]

fdd_mat ( SC_IND_PILOTS  ,
 
)

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

◆ max()

abs(tx_vec_iris max ( )
staticvirtual

◆ order()

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

◆ sdr_params()

sdr_params ( )

◆ symbols()

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

◆ ue_ids()

ue_ids ( end 1)

◆ waveform()

Scale for Tx waveform ( )

◆ zeros()

1,N_ZPAD_POST zeros ( )
virtual

Variable Documentation

◆ all

Author (s) close all

◆ b_ids

b_ids = string.empty()

◆ b_prim_sched

b_prim_sched = "PGGGGGRG"

◆ b_scheds

UE schedule b_scheds = string.empty()

◆ ber_SIM

end ber_SIM = zeros(nt,nsnr)

◆ berr_th

BER berr_th = zeros(nsnr,1)

◆ burst

Number of OFDM symbols for burst

◆ chan_type

if SIM_MOD chan_type = "rayleigh"

◆ CHANNEL

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 CHANNEL = 11

◆ CP_LEN

Number of subcarriers CP_LEN = 16

◆ isnr

for isnr
Initial value:

◆ iu

for iu
Initial value:

◆ 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_DATA_SYMS

Cyclic prefix length N_DATA_SYMS = N_OFDM_SYM * length(SC_IND_DATA)

◆ N_FRM

N_FRM = 10

◆ N_OFDM_SYM

Time Domain Do N_OFDM_SYM = 46

◆ n_samp

end n_samp = length(tx_vec_iris)

◆ N_SC

Do N_SC = 64

◆ N_SYM_SAMP

Number of N_SYM_SAMP = N_SC + CP_LEN

◆ N_UE

N_UE = 1

◆ N_ZPAD_PRE

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

◆ nsnr

nsnr = length(sim_SNR_db)

◆ nt

nt = 100

◆ objects

just to agree with what the hardware spits out else Init Iris nodes Set up the Iris experiment Create two Iris node objects

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

◆ preamble

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

◆ RX_FRQ

RX_FRQ = TX_FRQ

◆ RX_GN

RX_GN = 20

◆ rx_vec_iris

end rx_vec_iris = rx_vec_iris.'

◆ SC_IND_DATA

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

◆ schedule

BS primary noede s schedule

◆ sdr_params

Iris nodes parameters sdr_params
Initial value:
= struct(...
'id', b_ids, ...
'n_chain',N_BS_NODE, ...
'txfreq', TX_FRQ, ...
'rxfreq', RX_FRQ, ...
'txgain', TX_GN, ...
'rxgain', RX_GN, ...
'sample_rate', SMPL_RT, ...
'n_samp', n_samp, ... % number of samples per frame time.
'n_frame', N_FRM, ...
'tdd_sched', b_scheds, ... % number of zero-paddes samples
)

◆ SIM_MOD

Channel to tune Tx and Rx radios SIM_MOD = 1

◆ sim_SNR_db

sim_SNR_db = 1:20

◆ SMPL_RT

SMPL_RT = 5e6

◆ snr_plot

snr_plot = 20

◆ tdd_tx_payload_mat

tdd_tx_payload_mat = [tx_cp

◆ tx_data

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

◆ TX_FRQ

TX_FRQ = 2.5e9

◆ TX_GN

TX_GN = 43

◆ tx_payload_vec

end Reshape to a vector tx_payload_vec = reshape(tdd_tx_payload_mat, 1, numel(tdd_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)

◆ ue_ids

ue_ids = string.empty()

◆ ue_scheds

ue_scheds = string.empty()

◆ values

Insert the data and pilot values

◆ yourselves

Do yourselves
N_ZPAD_PRE
Number of samples that will go over the air N_ZPAD_PRE
Definition: ofdm_siso.m:75
nt
nt
Definition: ofdm_siso.m:31
n_zpad_samp
n_zpad_samp
Definition: iris_py.m:35
rx_vec_iris
rx_vec_iris
Definition: ofdm_siso.m:140
N_FRM
N_FRM
Definition: ofdm_siso.m:55
SIM_MOD
Channel to tune Tx and Rx radios SIM_MOD
Definition: ofdm_siso.m:27
b_scheds
b_scheds
Definition: ofdm_siso.m:58
iu
for iu
Definition: ofdm_siso.m:158
RX_GN
RX_GN
Definition: ofdm_siso.m:53
chan_type
if SIM_MOD chan_type
Definition: ofdm_siso.m:30
ue_sched
ue_sched
Definition: ofdm_mimo.m:153
TX_GN
TX_GN
Definition: ofdm_siso.m:52
TX_FRQ
TX_FRQ
Definition: ofdm_siso.m:50
N_ZPAD_POST
configure the N_ZPAD_PRE N_ZPAD_POST
Definition: rl_ofdm_calib.m:123
samples
end Rx payload processing Extract the payload samples(integral number of OFDM symbols following preamble) payload_vec
isnr
for isnr
Definition: ofdm_siso.m:136
N_UE
N_UE
Definition: ofdm_siso.m:49
RX_FRQ
RX_FRQ
Definition: ofdm_siso.m:51
sim_SNR_db
sim_SNR_db
Definition: ofdm_siso.m:32
N_BS_NODE
SIMULATION N_BS_NODE
Definition: ofdm_mimo.m:138
ue_scheds
ue_scheds
Definition: ofdm_siso.m:60
n_samp
end n_samp
Definition: ofdm_siso.m:162
SMPL_RT
SMPL_RT
Definition: ofdm_siso.m:54
extract_pilots_data.frame
frame
Definition: extract_pilots_data.py:58
b_ids
b_ids
Definition: ofdm_siso.m:57
nsnr
nsnr
Definition: ofdm_siso.m:33