RENEWLab  1.1.0
RENEW project
getRxVec.m File Reference

Functions

 assert (length(ue_param.id)==n_ue)
 
 fadec (i)=0
 
num clusters if length (angcTx)
 
end if length (angspdRx)
 
end if length (angspdTx)
 
end if length (dlycns)
 
end if length (dlyspdns)
 
end if length (powcdB)
 
np, 1 zeros ()
 
 urx (:, i)
 
 utx (:, i)
 
nsub for fading if fadec (ic) nsubi
 
 angpTx (I)
 
 dlypns (I)
 
 powp (I)
 
end Compute the spatial signatures urx and utx urx (:, ip)
 
 utx (:, ip)
 
 zeros ((idlyMax-idly), 1)]
 
x delayed vector per idly y (:, irx)
 
if ~isempty (hub_id) node_bs
 
initialize UE node_ue sdr_configgainctrl ()
 
node_bs sdrsync ()
 
synchronize delays only for BS node_ue sdrrxsetup ()
 
for uplink only one frame schedule is sufficient node_bs set_tddconfig (1, bs_param.tdd_sched(tdd_sched_index))
 
configure the ue_param tdd_sched (tdd_sched_index))
 
if exist ('bs_param.beacon_sweep', 'var') if bs_param.beacon_sweep disp('Beacon sweep')
 
node_bs sdr_setupbeacon ()
 
Burn beacon to the BS RAM else disp ('Beacon from single TX')
 
node_bs sdr_setupbeacon_single ()
 
Burn beacon to the BS (1) RAM end else disp('Beacon from single TX')
 
Burn data to the UE RAM end node_bs sdr_activate_rx ()
 
activate reading stream node_ue sdr_setcorr ()
 
activate correlator node_bs sdrtrigger (trig)
 
read data node_ue sdr_gettriggers ()
 
node_bs sdr_close ()
 
 fprintf ('Length of the received vector from HW:\tUE:%d\n', data0_len)
 
 fprintf ("No valid channel type was given!")
 

Variables

function y
 
if chan_type
 
 nvar = tx_var / 10^(0.1*snr)
 
noise variance per data sample H_ul = ones(size(tx_data.'))
 
noise vector W_ul
 
 hvar = 1
 
if n_ue
 
output vector y0 = H_ul.*tx_data.'
 
number of subpaths per cluster fmaxHz = 0
 
max Doppler spread in Hz NOT USED ! freqErrHz = 0
 
constant frequency error in Hz dlyns =0
 
constant delay in ns angMotion =0
 
angle of motion KEEP at Cluster parameters represented as a vector with one component per cluster angcRx = [0 90]'*pi/180
 
RX center angle in radians angspdRx = 10*pi/180
 
RX angular spread in radians angcTx = 0
 
TX center angle in radians angspdTx = 0
 
TX angular spread in radians dlycns = [0 100]'
 
excess delay of first path in cluster nsec dlyspdns = 30
 
delay spread within cluster in nsec powcdB = [-3 -3]'
 
gain power in dB the power on each cluster fadec = [1 1]'
 
number of TX antennas nantRx = n_bs
 
number of RX antennas dsepTx = 0.5
 
TX antenna separation dsepRx = 0.5
 
RX antenna separation nov = 16
 
oversampling ratio tx_var = mean(abs(tx_data).^2 ) * (64/48)
 
noise variance per data sample Carrier and sample rate fsampMHz = 5
 
sample frequency in MHz x = tx_data
 
Convert scalar parameters to vectors nc = length(angcRx)
 
end Compute total number of paths ncfade = sum(fadec)
 
num fading clusters np = nsub*ncfade + nc-ncfade
 
AoA in radians angpTx = zeros(np,1)
 
AoD in radians dlypns = zeros(np,1)
 
delay in us of each path powp = zeros(np,1)
 
power of each path in linear scale ip = 0
 
Spatial signature of each path urx = double.empty()
 
else nsubi = 1
 
end I = (ip+1:ip+nsubi)'
 
 omgiTx = 2*pi*dsepTx*cos(angpTx)
 
end Generate complex gains and Doppler shifts gain = sqrt(powp).*exp(2*pi*1i*rand(np,1))
 
complex gain of each path fdHz = fmaxHz*cos(angpRx-angMotion) + freqErrHz
 
Doppler shift in Hz
 
sample period in ms nt = size(x,1)
 
number of input samples ntx = nt*nov
 
num input time samples after upconverting Compute size of y based on maximum path delay ts1 = tsms/nov
 
sample period of upcoverted signal in ms idlyMax = max( round((dlypns+dlyns)*1e-6/ts1))
 
idlyMax expressed in units of ts1 nty = ntx + idlyMax
 
Upsample x1 = resample(x,nov,1)
 
 t = (0:nty-1)'*ts1*1e-3
 
must be in sec since dfHz is in sec ! y = zeros(nty,nantRx)
 
Filter the signal by summing each path Sum shifted and scaled versions of x1 to create the output y for irx
 
delay of path ip xs = [zeros(idly,1)
 
Add noise ny = size(y0,1)
 
 w = sqrt(nvar/2)*(randn(ny,nantRx) + 1i*randn(ny,nantRx))
 
else node_bs = iris_py(bs_param,[])
 
initialize BS end node_ue = iris_py(ue_param,[])
 
 tdd_sched_index = 1
 
configure the BS
 
set trigger to start the frame Iris Rx Only UL data
 
set trigger to start the frame Iris Rx Only UL data0_len = node_bs.sdrrx(n_samp)
 

Function Documentation

◆ angpTx()

angpTx ( I  )

◆ assert()

assert ( length(ue_param.id = =n_ue)
Here is the caller graph for this function:

◆ BS()

Burn beacon to the BS ( )

◆ disp()

Burn beacon to the BS RAM else disp ( 'Beacon from single TX'  )

◆ dlypns()

dlypns ( I  )

◆ exist()

if exist ( 'bs_param.beacon_sweep'  ,
'var'   
)

◆ fadec() [1/2]

fadec ( i  )
pure virtual

◆ fadec() [2/2]

nsub for fading if fadec ( ic  )

◆ fprintf() [1/2]

fprintf ( "No valid channel type was given!"  )

◆ fprintf() [2/2]

fprintf ( 'Length of the received vector from HW:\tUE:%d\n'  ,
data0_len   
)

◆ length() [1/6]

num clusters if length ( angcTx  )
Here is the caller graph for this function:

◆ length() [2/6]

end if length ( angspdRx  )

◆ length() [3/6]

end if length ( angspdTx  )

◆ length() [4/6]

end if length ( dlycns  )

◆ length() [5/6]

end if length ( dlyspdns  )

◆ length() [6/6]

end if length ( powcdB  )

◆ powp()

powp ( I  )

◆ sdr_activate_rx()

node_ue sdr_activate_rx ( )

◆ sdr_close()

if n_ue node_ue2 sdr_close ( )

◆ sdr_configgainctrl()

initialize UE node_ue sdr_configgainctrl ( )

◆ sdr_gettriggers()

read data node_ue sdr_gettriggers ( )

◆ sdr_setcorr()

Burn data to the UE RAM end if ~WIRED_UE node_ue sdr_setcorr ( )

◆ sdr_setupbeacon()

node_bs sdr_setupbeacon ( )

◆ sdr_setupbeacon_single()

node_bs sdr_setupbeacon_single ( )

◆ sdrrxsetup()

node_ue sdrrxsetup ( )

◆ sdrsync()

node_bs sdrsync ( )

◆ sdrtrigger()

activate correlator node_bs sdrtrigger ( trig  )

◆ set_tddconfig()

for uplink only one frame schedule is sufficient node_bs set_tddconfig ( ,
bs_param.  tdd_schedtdd_sched_index 
)

◆ tdd_sched()

configure the ue_param tdd_sched ( tdd_sched_index  )

◆ urx() [1/2]

urx ( ,
i   
)

◆ urx() [2/2]

end Compute the spatial signatures urx and utx urx ( ,
ip   
)

◆ utx() [1/2]

utx ( ,
i   
)

◆ utx() [2/2]

utx ( ,
ip   
)

◆ y()

x delayed vector per idly y ( ,
irx   
)

◆ zeros() [1/2]

zeros ( (idlyMax-idly)  ,
 
)

◆ zeros() [2/2]

N_UE N_SC N_OFDM_SYM zeros ( )
virtual
Here is the caller graph for this function:

◆ ~isempty()

if ~isempty ( hub_id  )

Variable Documentation

◆ ! freqErrHz

max Doppler spread in Hz NOT USED ! freqErrHz = 0

◆ ! y

must be in sec since dfHz is in sec ! y = zeros(nty,nantRx)

◆ angcRx

angle of motion KEEP at Cluster parameters represented as a vector with one component per cluster angcRx = [0 90]'*pi/180

◆ angcTx

RX angular spread in radians angcTx = 0

◆ angMotion

constant delay in ns angMotion =0

◆ angpTx

AoA in radians angpTx = zeros(np,1)

◆ angspdRx

RX center angle in radians angspdRx = 10*pi/180

◆ angspdTx

TX center angle in radians angspdTx = 0

◆ BS

configure the BS
Initial value:
=1:n_ue
node_ue.sdrtx_single(tx_data(:,i), i)

◆ chan_type

SIMULATION chan_type
Initial value:
== "awgn"
% AWGN
tx_var = mean(mean(abs(tx_data).^2 )) * (64/48)

◆ data

set trigger to start the frame Iris Rx Only UL data

◆ data0_len

set trigger to start the frame Iris Rx Only UL data0_len = node_bs.sdrrx(n_samp)

◆ dlycns

TX angular spread in radians dlycns = [0 100]'

◆ dlyns

constant frequency error in Hz dlyns =0

◆ dlypns

AoD in radians dlypns = zeros(np,1)

◆ dlyspdns

excess delay of first path in cluster nsec dlyspdns = 30

◆ dsepRx

TX antenna separation dsepRx = 0.5

◆ dsepTx

number of RX antennas dsepTx = 0.5

◆ fadec

gain power in dB the power on each cluster fadec = [1 1]'

◆ fdHz

complex gain of each path fdHz = fmaxHz*cos(angpRx-angMotion) + freqErrHz

◆ fmaxHz

number of subpaths per cluster fmaxHz = 0

◆ fsampMHz

noise variance per data sample Carrier and sample rate fsampMHz = 5

◆ gain

end Generate complex gains and Doppler shifts gain = sqrt(powp).*exp(2*pi*1i*rand(np,1))

◆ H_ul

else H_ul = ones(size(tx_data.'))

◆ hvar

hvar = 1

◆ Hz

Doppler shift in Hz
Initial value:
= fmaxHz*cos(angp)
% Get dimensions
tsms = 1e-3/fsampMHz

◆ I

end I = (ip+1:ip+nsubi)'

◆ idlyMax

sample period of upcoverted signal in ms idlyMax = max( round((dlypns+dlyns)*1e-6/ts1))

◆ ip

for ip = 0

◆ irx

Filter the signal by summing each path Sum shifted and scaled versions of x1 to create the output y for irx
Initial value:
=1:size(urx,1)
for ip=1:np
idly = round((dlypns(ip) + dlyns)...
*1e-6/ts1)

◆ n_ue

if n_ue
Initial value:
== 1
H_ul = sqrt(hvar/2).*randn(n_bs, length(tx_data)) + 1i*randn(n_bs, length(tx_data))

◆ nantRx

number of TX antennas nantRx = n_bs

◆ nc

Convert scalar parameters to vectors nc = length(angcRx)

◆ ncfade

end Compute total number of paths ncfade = sum(fadec)

◆ node_bs

else node_bs = iris_py(bs_param,[])

◆ node_ue

initialize BS end node_ue = iris_py(ue_param,[])

◆ nov

RX antenna separation nov = 16

◆ np

num fading clusters np = nsub*ncfade + nc-ncfade

◆ nsubi

else nsubi = 1

◆ nt

else nt = size(x,1)

◆ ntx

number of input samples ntx = nt*nov

◆ nty

idlyMax expressed in units of ts1 nty = ntx + idlyMax

◆ nvar

nvar = tx_var / 10^(0.1*snr)

◆ ny

Add noise ny = size(y0,1)

◆ omgiTx

omgiTx = 2*pi*dsepTx*cos(angpTx)

◆ powcdB

delay spread within cluster in nsec powcdB = [-3 -3]'

◆ powp

delay in us of each path powp = zeros(np,1)

◆ t

t = (0:nty-1)'*ts1*1e-3

◆ tdd_sched_index

tdd_sched_index = 1

◆ ts1

num input time samples after upconverting Compute size of y based on maximum path delay ts1 = tsms/nov

◆ tx_var

oversampling ratio tx_var = mean(abs(tx_data).^2 ) * (64/48)

◆ urx

Spatial signature of each path urx = double.empty()

◆ w

w = sqrt(nvar/2)*(randn(ny,nantRx) + 1i*randn(ny,nantRx))

◆ W_ul

noise variance per data sample noise vector W_ul
Initial value:
= sqrt(nvar/2).* (randn(n_bs, length(tx_data)) + ...
1i*randn(n_bs, length(tx_data)) )

◆ x

sample frequency in MHz x = tx_data

◆ x1

x1 = resample(x,nov,1)

◆ xs

delay of path ip xs = [zeros(idly,1)

◆ y

else y
Initial value:
= getRxVec(tx_data, n_bs, n_ue, chan_type, snr, bs_param, ue_param, hub_id)
%%% Returns Rx vector passed through the channel type given in the input
%%% list.
assert(length(bs_param.id) == n_bs)

◆ y0

end end y0 = H_ul.*tx_data.'
iris_py.type
type
Definition: iris_py.py:333
np
num fading clusters np
Definition: getRxVec.m:112
length
num clusters if length(angcTx)
tx_var
oversampling ratio tx_var
Definition: getRxVec.m:80
ip
power of each path in linear scale ip
Definition: getRxVec.m:120
channel
Equalize with *known * channel
Definition: berr_perfect.m:49
node_ue
initialize BS end node_ue
Definition: getRxVec.m:203
fmaxHz
number of subpaths per cluster fmaxHz
Definition: getRxVec.m:57
ts1
num input time samples after upconverting Compute size of y based on maximum path delay ts1
Definition: getRxVec.m:167
nvar
nvar
Definition: getRxVec.m:11
tx_data
tx_data
Definition: berr_perfect.m:5
snr
number of bits snr
Definition: mod_demod.m:16
i
for i
Definition: rl_ofdm_calib.m:121
n_ue
if n_ue
Definition: getRxVec.m:29
dlyns
constant frequency error in Hz dlyns
Definition: getRxVec.m:59
urx
Spatial signature of each path urx
Definition: getRxVec.m:122
dlypns
AoD in radians dlypns
Definition: getRxVec.m:118
hvar
hvar
Definition: getRxVec.m:28
fsampMHz
noise variance per data sample Carrier and sample rate fsampMHz
Definition: getRxVec.m:84
vector
Maybe you need to transpose bits_matrix before reshaping it to a vector
Definition: syms2bits.m:62
chan_type
if chan_type
Definition: getRxVec.m:8
hub_id
else hub_id
Definition: rl_ofdm_calib.m:70
H_ul
noise variance per data sample H_ul
Definition: getRxVec.m:13