RENEWLab  1.1.0
RENEW project
rl_ofdm_calib.m File Reference

Functions

Number of CP samples to use in FFT (on average) %% Define the preamble % LTS for fine CFO and channel estimation lts_f
 
 sched_id (REF_ANT)
 
 preamble (nid, start_index+1:start_index+N_SYM_SAMP)
 
 preamble (REF_ANT, start_index+1:start_index+N_SYM_SAMP)
 
initialize BS node_bs sdrsync ()
 
synchronize delays only for BS node_bs sdrrxsetup ()
 
configure the N_ZPAD_PRE preamble (i, :) zeros(1
 
node_bs sdrtx_single (tx_data, i)
 
Burn data to the UE RAM end node_bs sdr_activate_rx ()
 
end payload_rx (ibs, :)
 
 if (ibs==REF_ANT) rx_fft_ref(sid
 
id start_index: (id N_SC)
 
else rx_fft (sid, :)
 
end node_bs sdr_close ()
 
 figure (cf)
 
 plot (-32:1:31, abs(cal_mat(i, :)))
 
 axis ([-40 40 0 5]) grid on
 
 title ('Calibration MAGNITUDE')
 
 plot (-32:1:31, angle(cal_mat(i, :)))
 
 title ('Calibration ANGLE')
 

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 Iris params
 
 TX_FRQ = 2.5e9
 
 RX_FRQ = TX_FRQ
 
 TX_GN = 70
 
 RX_GN = 50
 
 SMPL_RT = 5e6
 
 N_FRM = 1
 
 bs_ids = string.empty()
 
 bs_sched = string.empty()
 
Waveform params OFDM params SC_IND_PILOTS = [8 22 44 58]
 
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_SYM_SAMP = N_SC + CP_LEN
 
Number of samples that will go over the air N_ZPAD_PRE = 100
 
Number of OFDM symbols for burst
 
Number of OFDM symbols for it needs to be less than Rx processing params FFT_OFFSET = 16
 
 lts_t = ifft(lts_f, 64)
 
time domain Init Iris nodes Set up the Iris experiment Create BS Hub and UE objects Note
 
else hub_id = []
 
All BS schedule
 
All BS Ref Schedule N_BS_NODE = length(bs_ids)
 
 REF_ANT = floor(N_BS_NODE/2)
 
 sched_id = ones(1, N_BS_NODE)
 
 lts = [lts_t(49:64) lts_t]
 
 N_BS = N_BS_NODE - 1
 
 DATA_REP = floor(N_OFDM_SYM / N_BS)
 
 data_len = N_BS * DATA_REP * N_SYM_SAMP
 
 preamble = zeros(N_BS_NODE, data_len)
 
for jp
 
for rp
 
end end n_samp = N_ZPAD_PRE + data_len + N_ZPAD_POST
 
 payload_rx = zeros(N_BS_NODE, data_len)
 
 rx_fft = zeros(N_BS, N_SC)
 
 rx_fft_ref = zeros(N_BS, N_SC)
 
 cal_mat = zeros(N_BS, N_SC)
 
Iris nodes parameters bs_sdr_params
 
 node_bs = iris_py(bs_sdr_params, hub_id)
 
for i
 
configure the BS
 
configure the N_ZPAD_PRE N_ZPAD_POST
 
activate reading stream [rx_vec_iris, data0_len] = node_bs.sdrrx(n_samp)
 
read data process received reciprocity pilots a = 1
 
 unos = ones(size(conj(lts)))
 
for ibs
 
 v1 = filter(unos, a, abs(rx_vec_iris(ibs, end - DATA_REP * N_SYM_SAMP: end)) .^ 2)
 
 lts_corr = (abs(v0) .^ 2) ./ v1
 
normalized correlation position of the last peak [~, max_idx] = max(abs(lts_corr))
 
 rx_data_start
 
 break
 
for sid
 
 start_index = CP_LEN + ((rid - 1) + (sid - 1) * DATA_REP) * N_SYM_SAMP
 
 __pad2__
 
 __pad3__
 
 cf = 0
 
 clf
 

Function Documentation

◆ axis()

axis ( )

◆ FFT()

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

◆ figure()

figure ( cf  )

◆ if()

if ( ibs  = REF_ANT)

◆ payload_rx()

end payload_rx ( ibs  ,
 
)

◆ plot() [1/2]

plot ( -32:1:31  ,
abs(cal_mat(i, :))   
)

◆ plot() [2/2]

plot ( -32:1:31  ,
angle(cal_mat(i, :))   
)

◆ preamble() [1/3]

configure the N_ZPAD_PRE preamble ( i  ,
 
)

◆ preamble() [2/3]

preamble ( nid  ,
start_index+1:start_index N_SYM_SAMP 
)

◆ preamble() [3/3]

preamble ( REF_ANT  ,
start_index+1:start_index N_SYM_SAMP 
)

◆ rx_fft()

else rx_fft ( sid  ,
 
)

◆ sched_id()

sched_id ( REF_ANT  )

◆ sdr_activate_rx()

Burn data to the UE RAM end node_bs sdr_activate_rx ( )

◆ sdr_close()

end node_bs sdr_close ( )

◆ sdrrxsetup()

synchronize delays only for BS node_bs sdrrxsetup ( )

◆ sdrsync()

initialize BS node_bs sdrsync ( )

◆ sdrtx_single()

node_ue sdrtx_single ( tx_data  ,
i   
)

◆ start_index:()

id start_index: ( id  N_SC)
staticvirtual

◆ title() [1/2]

title ( 'Calibration ANGLE'  )

◆ title() [2/2]

title ( 'Calibration MAGNITUDE'  )

Variable Documentation

◆ __pad2__

__pad2__

◆ __pad3__

__pad3__

◆ a

read data process received reciprocity pilots a = 1

◆ Author

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

◆ break

break

◆ BS

configure the BS

◆ bs_ids

else bs_ids = string.empty()

◆ bs_sched

All BS Ref Schedule bs_sched = string.empty()

◆ bs_sdr_params

Iris nodes parameters bs_sdr_params
Initial value:
= struct(...
'id', bs_ids, ...
'n_sdrs', 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', 1, ...
'tdd_sched', bs_sched, ... % number of zero-paddes samples
)

◆ burst

Number of OFDM symbols for burst

◆ cal_mat

cal_mat = zeros(N_BS, N_SC)

◆ cf

end cf = 0

◆ clf

clf

◆ CP_LEN

Number of subcarriers CP_LEN = 16

◆ data_len

data_len = N_BS * DATA_REP * N_SYM_SAMP

◆ DATA_REP

DATA_REP = floor(N_OFDM_SYM / N_BS)

◆ FFT_OFFSET

Number of OFDM symbols for it needs to be less than Rx processing params FFT_OFFSET = 16

◆ hub_id

else hub_id = []

◆ i

additional pilot as noise for i
Initial value:
node_bs.set_tddconfig_single(1, bs_sched(sched_id(i)), i)

◆ ibs

for ibs
Initial value:
% Correlation through filtering

◆ jp

for jp
Initial value:
= 1:N_BS
nid = jp + (jp >= REF_ANT)

◆ lts

lts = [lts_t(49:64) lts_t]

◆ lts_corr

lts_corr = (abs(v0) .^ 2) ./ v1

◆ lts_t

lts_t = ifft(lts_f, 64)

◆ N_BS

N_BS = N_BS_NODE - 1

◆ N_BS_NODE

All BS Ref Schedule N_BS_NODE = length(bs_ids)

◆ N_FRM

N_FRM = 1

◆ n_samp

◆ N_SC

N_SC = 64

◆ N_SYM_SAMP

Cyclic prefix length N_SYM_SAMP = N_SC + CP_LEN

◆ N_ZPAD_POST

id N_ZPAD_POST

◆ N_ZPAD_PRE

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

◆ node_bs

node_bs = iris_py(bs_sdr_params, hub_id)

◆ Note

time domain Init Iris nodes Set up the Iris experiment Create BS Hub and UE objects Note

◆ params

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 Iris params

◆ payload_rx

payload_rx = zeros(N_BS_NODE, data_len)

◆ peak

normalized correlation position of the last peak[~, max_idx] = max(abs(lts_corr))

◆ preamble

preamble = zeros(N_BS_NODE, data_len)

◆ REF_ANT

REF_ANT = floor(N_BS_NODE/2)

◆ rp

for rp
Initial value:
start_index = ((rp - 1) + (jp - 1) * DATA_REP) * N_SYM_SAMP

◆ rx_data_start

rx_data_start
Initial value:

◆ rx_fft

rx_fft = zeros(N_BS, N_SC)

◆ rx_fft_ref

rx_fft_ref = zeros(N_BS, N_SC)

◆ RX_FRQ

RX_FRQ = TX_FRQ

◆ RX_GN

RX_GN = 50

◆ 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]'

◆ SC_IND_PILOTS

Waveform params OFDM params SC_IND_PILOTS = [8 22 44 58]

◆ sched_id

sched_id = ones(1, N_BS_NODE)

◆ schedule

All BS schedule

◆ sid

end end end end for sid
Initial value:
= 1:N_BS
for rid = 1:DATA_REP
% nid = sid + (sid >= REF_ANT)

◆ SMPL_RT

SMPL_RT = 5e6

◆ start_index

start_index = CP_LEN + ((rid - 1) + (sid - 1) * DATA_REP) * N_SYM_SAMP

◆ stream

activate reading stream[rx_vec_iris, data0_len] = node_bs.sdrrx(n_samp)

◆ TX_FRQ

TX_FRQ = 2.5e9

◆ TX_GN

TX_GN = 70

◆ unos

unos = ones(size(conj(lts)))

◆ v1

v1 = filter(unos, a, abs(rx_vec_iris(ibs, end - DATA_REP * N_SYM_SAMP: end)) .^ 2)
filter
Interpolate Zero pad then filter(same as interp or upfirdn without signal processing toolbox) tx_vec_air
rx_data_start
rx_data_start
Definition: rl_ofdm_calib.m:140
bs_sched
bs_sched
Definition: rl_ofdm_calib.m:34
DATA_REP
DATA_REP
Definition: rl_ofdm_calib.m:83
RX_FRQ
RX_FRQ
Definition: rl_ofdm_calib.m:28
jp
for jp
Definition: rl_ofdm_calib.m:86
n_zpad_samp
n_zpad_samp
Definition: iris_py.m:35
bs_ids
bs_ids
Definition: rl_ofdm_calib.m:33
start_index
start_index
Definition: rl_ofdm_calib.m:150
rp
for rp
Definition: rl_ofdm_calib.m:88
ibs
for ibs
Definition: rl_ofdm_calib.m:132
n_samp
end end n_samp
Definition: rl_ofdm_calib.m:95
sid
for sid
Definition: rl_ofdm_calib.m:147
preamble
preamble
Definition: rl_ofdm_calib.m:85
node_bs
node_bs
Definition: rl_ofdm_calib.m:116
REF_ANT
REF_ANT
Definition: rl_ofdm_calib.m:77
max_idx
position of the last peak max_idx
Definition: ofdm_mimo.m:228
v0
v0
Definition: siso_ofdm_mf_sim.m:143
SMPL_RT
SMPL_RT
Definition: rl_ofdm_calib.m:31
data_len
data_len
Definition: rl_ofdm_calib.m:84
i
for i
Definition: rl_ofdm_calib.m:121
display
if TX_GN display('WARNING:MAXIMUM TX GAIN IS 81!')
samples
end Rx payload processing Extract the payload samples(integral number of OFDM symbols following preamble) payload_vec
sched_id
sched_id
Definition: rl_ofdm_calib.m:78
TX_FRQ
TX_FRQ
Definition: rl_ofdm_calib.m:27
N_BS_NODE
All BS Ref Schedule N_BS_NODE
Definition: rl_ofdm_calib.m:76
a
read data process received reciprocity pilots a
Definition: rl_ofdm_calib.m:130
TX_GN
TX_GN
Definition: rl_ofdm_calib.m:29
extract_pilots_data.frame
frame
Definition: extract_pilots_data.py:58
if
if(ibs==REF_ANT) rx_fft_ref(sid
N_BS
N_BS
Definition: rl_ofdm_calib.m:82
rx_vec_iris
rx_vec_iris
Definition: ofdm_mimo.m:139
N_ZPAD_PRE
Number of samples that will go over the air N_ZPAD_PRE
Definition: rl_ofdm_calib.m:45
RX_GN
RX_GN
Definition: rl_ofdm_calib.m:30
N_SYM_SAMP
Cyclic prefix length N_SYM_SAMP
Definition: rl_ofdm_calib.m:44