RENEWLab  1.1.0
RENEW project
iris_py.m File Reference

Functions

Parameters to feed python (pun very intended!) serial_ids
 
 disp (hub_id) id_str
 
obj py_obj_array (ipy,:)
 
end end end function sdr_set_n_frame (obj, n_frame) obj.n_frame
 
The trigger is set only on the fist node else obj py_obj_hub set_trigger ()
 
 disp ('triggering FAROS hub...') end end function sdrsync(obj) if ~obj.use_hub obj.py_obj_array
 
 sync_delays ()
 
end end function sdr_setcorr (obj) for ipy
 
 fprintf ('Beacon detected at UE %d ? %d \n', ipy, trig_found)
 
end end function sdr_unsetcorr (obj) for ipy
 
end end function sdr_settxgain (obj, tx_gain) for ipy
 
end end function sdr_configgainctrl (obj) for ipy
 
end end function sdr_setupbeacon (obj) % Assume Beacon only from the first Iris board in the BS array for ipy
 
end end function sdr_setupbeacon_single (obj) % Assume Beacon only from the first Iris board in the BS array obj.py_obj_array
 
 burn_beacon ()
 
end function set_tddconfig (obj, is_bs, tdd_sched) obj.is_bs
 
end end function set_tddconfig_single (obj, is_bs, tdd_sched, index) sched
 
end function sdrrxsetup (obj) for ipy
 
end end function sdr_activate_rx (obj) for ipy
 
obj, data ipy: (id py_obj_array)
 
 burn_data (pyargs('data_r', real(data), 'data_i', imag(data)))
 
end end function sdrtx_single (obj, data, index) obj.py_obj_array
 
 data_raw (ipy,(jf-1) *n_samp+1:jf *n_samp)
 
end end if ~exist ('choose_best_frame', 'var') data
 
 data_raw (ipy, :)
 
end function sdr_close (obj) for ipy
 
 delete (obj.py_obj_array{ipy})
 
 lts_corr_dr (:, nc)
 
id peaks: (lts_corr_sum< 0.2 lts_corr_sum)
 
 elseif (obj.n_sdrs > 1) &&length(lts_corr_frm) >
 
obj.n_samp, obj.n_sdrs, obj.n_frame zeros ()
 
 data_split (:,:, nf)
 
 fprintf ('Returning frame number %d with max mean correlation=%f \n', m_idx, max_corr)
 

Variables

Author(s) pyhton object array This array decribes Iris board or a collection of Iris boards that belong to the same entity E g
 
Author(s) pyhton object array This array decribes Iris board or a collection of Iris boards that belong to the same entity E a BS py_obj_array = {}
 
 use_hub = 0
 
 py_obj_hub = py.hub_py.Hub_py( pyargs('serial_id',id_str))
 
 n_sdrs = 0
 
number of Iris boards in a chain sample_rate = 0
 
 tx_freq = 0
 
 rx_freq = 0
 
 bw = 0
 
 tx_gain = 0
 
 rx_gain = 0
 
 n_samp = 0
 
 tdd_sched = ""
 
 n_zpad_samp = 0
 
 is_bs = 1
 
end methods function obj
 
end obj sdr_params = sdr_params
 
obj serial_ids = sdr_params.id
 
obj n_frame = sdr_params.n_frame
 
for ipy
 
 py_obj
 
end NB
 
 sched = convertStringsToChars(tdd_sched)
 
end Read n_frame x n_samp data function [data, len]
 
end data_raw = zeros(obj.n_sdrs, obj.n_frame * n_samp)
 
Change this to max frame ! for jf
 
elseif choose_best_frame
 
end len = length(data)
 
end data = data_raw.'
 
TD LTS lts_t = ifft(lts_f, 64)
 
Add CP and a second TD LTS lts_cp = lts_t(33:end)
 
Correlation through filtering lts_corr_dr = zeros(size(data_frame))
 
 unos = ones(size(lts_t))
 
 a = 1
 
for nc
 
 v1 = filter(unos,a,abs(data_frame(:,nc)).^2)
 
normalized correlation end Sum accross antennas lts_corr_sum = sum(lts_corr_dr,2)
 
Assume peak in the first samples lts_corr_frm = reshape(lts_corr_sum, [], obj.n_frame)
 
end save my_data mat lts_corr_dr lts_corr_frm Avg corr value per frame frm_avg_corr = sum(lts_corr_frm,1)./obj.n_sdrs
 
Take index of maximum corr value [max_corr, m_idx] = max(frm_avg_corr)
 
for nf
 
 end_idx = nf*obj.n_samp
 
end data_frame = reshape(data_frame,n_samp, [], obj.n_frame )
 

Function Documentation

◆ burn_beacon()

burn_beacon ( )

◆ burn_data()

burn_data ( pyargs( 'data_r', real(data), 'data_i', imag(data))  )

◆ data_raw() [1/2]

data_raw ( ipy  ,
 
)

◆ data_raw() [2/2]

data_raw ( ipy  ,
(jf-1) *n_samp+1:jf n_samp 
)

◆ data_split()

data_split ( ,
,
nf   
)

◆ delete()

delete ( obj.py_obj_array{ipy )

◆ disp() [1/2]

disp ( 'triggering FAROS hub...'  )
Initial value:
= 1:obj.n_sdrs
rcv_data = obj.py_obj_array{ipy}.recv_stream_tdd()

◆ disp() [2/2]

disp ( hub_id  )

◆ elseif()

elseif ( obj.  n_sdrs,
 
) &&

◆ fprintf() [1/2]

fprintf ( 'Beacon detected at UE %d ? %d \n'  ,
ipy  ,
trig_found   
)

◆ fprintf() [2/2]

fprintf ( 'Returning frame number %d with max mean  correlation = %f \n',
m_idx  ,
max_corr   
)

◆ ipy:()

obj, data ipy: ( id  py_obj_array)
virtual

◆ lts_corr_dr()

lts_corr_dr ( ,
nc   
)

◆ peaks:()

id peaks: ( )
virtual

◆ py_obj_array()

obj py_obj_array ( ipy  ,
 
)

◆ python()

Parameters to feed python ( pun very intended!  )

◆ sdr_activate_rx()

end end function sdr_activate_rx ( obj  )

◆ sdr_close()

end function sdr_close ( obj  )

◆ sdr_configgainctrl()

end end function sdr_configgainctrl ( obj  )

◆ sdr_set_n_frame()

end end end function sdr_set_n_frame ( obj  ,
n_frame   
)

◆ sdr_setcorr()

end end function sdr_setcorr ( obj  )

◆ sdr_settxgain()

end end function sdr_settxgain ( obj  ,
tx_gain   
)

◆ sdr_setupbeacon()

end end function sdr_setupbeacon ( obj  )

◆ sdr_setupbeacon_single()

end end function sdr_setupbeacon_single ( obj  )

◆ sdr_unsetcorr()

end end function sdr_unsetcorr ( obj  )

◆ sdrrxsetup()

end function sdrrxsetup ( obj  )

◆ sdrtx_single()

end end function sdrtx_single ( obj  ,
data  ,
index   
)

◆ set_tddconfig()

end function set_tddconfig ( obj  ,
is_bs  ,
tdd_sched   
)

◆ set_tddconfig_single()

end end function set_tddconfig_single ( obj  ,
is_bs  ,
tdd_sched  ,
index   
)

◆ set_trigger()

The trigger is set only on the fist node else obj py_obj_hub set_trigger ( )

◆ sync_delays()

else obj py_obj_hub sync_delays ( )

◆ zeros()

obj.n_samp, obj.n_sdrs,obj.n_frame zeros ( )
virtual

◆ ~exist()

end end if ~exist ( 'choose_best_frame ,
'var'   
)

Variable Documentation

◆ a

a = 1

◆ bw

bw = 0

◆ choose_best_frame

elseif choose_best_frame
Initial value:
== 0

◆ data

Return the frame with the highest value data = data_raw.'

◆ data_frame

end data_frame = reshape(data_frame,n_samp, [], obj.n_frame )

◆ data_raw

◆ end_idx

end_idx = nf*obj.n_samp

◆ frm_avg_corr

end save my_data mat lts_corr_dr lts_corr_frm Avg corr value per frame frm_avg_corr = sum(lts_corr_frm,1)./obj.n_sdrs

◆ function

end end function
Initial value:
if ~obj.is_bs
fprintf('sdrrx: Wrong function call on UE!')

◆ g

Author (s) pyhton object array This array decribes Iris board or a collection of Iris boards that belong to the same entity E g

◆ ipy

for ipy
Initial value:
=1:obj.n_sdrs
id_str = convertStringsToChars(obj.serial_ids(ipy))

◆ is_bs

is_bs = 1

◆ jf

Change this to max frame ! for jf
Initial value:
=1:obj.n_frame
%trigger base station
if obj.is_bs
if ~obj.use_hub
obj.py_obj_array{1}.set_trigger()

◆ len

len = length(data)

◆ lts_corr_dr

Correlation through filtering lts_corr_dr = zeros(size(data_frame))

◆ lts_corr_frm

Assume peak in the first samples lts_corr_frm = reshape(lts_corr_sum, [], obj.n_frame)

◆ lts_corr_sum

normalized correlation end Sum accross antennas lts_corr_sum = sum(lts_corr_dr,2)

◆ lts_cp

Add CP and a second TD LTS lts_cp = lts_t(33:end)

◆ lts_t

: lts_t = ifft(lts_f, 64)

◆ n_frame

obj n_frame = sdr_params.n_frame

◆ n_samp

UE schedule n_samp = 0

◆ n_sdrs

ue_sdr_params n_sdrs = 0

◆ n_zpad_samp

This is an array obj n_zpad_samp = 0

◆ NB

end NB

◆ nc

for nc
Initial value:
=1:size(data_frame,2)
v0 = filter(flipud(conj(lts_t)),a,data_frame(:,nc))

◆ nf

for nf
Initial value:
= 1:obj.n_frame
strt_idx = (nf-1)*obj.n_samp +1

◆ obj

end methods function obj
Initial value:
= iris_py(sdr_params, hub_id) % User must put 0 in hub_params in case hub is not used!
if nargin > 0
disp('Using hub with ID: ')

◆ py_obj

py_obj
Initial value:
= py.iris_py.Iris_py( pyargs('serial_id',id_str,...
'tx_freq', obj.tx_freq, 'rx_freq', obj.rx_freq,...
'tx_gain',obj.tx_gain,'rx_gain',obj.rx_gain,...
'sample_rate',obj.sample_rate, 'n_samp', obj.n_samp) )

◆ py_obj_array

obj py_obj_array = {}

◆ py_obj_hub

obj py_obj_hub = py.hub_py.Hub_py( pyargs('serial_id',id_str))

◆ rx_freq

obj rx_freq = 0

◆ rx_gain

obj rx_gain = 0

◆ sample_rate

obj sample_rate = 0

◆ sched

sched = convertStringsToChars(tdd_sched)

◆ sdr_params

sdr_params = sdr_params

◆ serial_ids

obj serial_ids = sdr_params.id

◆ tdd_sched

obj tdd_sched = ""

◆ tx_freq

obj tx_freq = 0

◆ tx_gain

obj tx_gain = 0

◆ unos

unos = ones(size(lts_t))

◆ use_hub

obj use_hub = 0

◆ v1

v1 = filter(unos,a,abs(data_frame(:,nc)).^2)

◆ value

Take index of maximum corr value[max_corr, m_idx] = max(frm_avg_corr)
filter
Interpolate Zero pad then filter(same as interp or upfirdn without signal processing toolbox) tx_vec_air
iris_py
Definition: iris_py.py:1
~isempty
if ~isempty(hub_id) node_bs
lts_t
TD LTS lts_t
Definition: iris_py.m:246
obj
end methods function obj
Definition: iris_py.m:41
a
a
Definition: iris_py.m:254
data_frame
end data_frame
Definition: iris_py.m:287
nf
for nf
Definition: iris_py.m:282
iris_py.hub
hub
Definition: iris_py.py:373
choose_best_frame
elseif choose_best_frame
Definition: iris_py.m:211
ipy
for ipy
Definition: iris_py.m:65
disp
disp(hub_id) id_str
v0
v0
Definition: siso_ofdm_mf_sim.m:143
data_raw
end data_raw
Definition: iris_py.m:190
n_samp
n_samp
Definition: iris_py.m:33
data
end data
Definition: iris_py.m:229
fprintf
fprintf('Beacon detected at UE %d ? %d \n', ipy, trig_found)
hub_id
else hub_id
Definition: rl_ofdm_calib.m:70
sdr_params
end obj sdr_params
Definition: iris_py.m:51
nc
for nc
Definition: iris_py.m:255