|
| 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!") |
|
|
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) |
|