Issue Connecting Multiple UEs in RFSIM using Channelmod
Edit:
This is a branch showing the currently proposed changes.
oliverxsch/openairinterface5g@cee8a8e3
Dear OAI developers,
There is a problem in the current code when multiple UEs are connected to the gNB using RFSIM and Channelmod. I started a discussion on the mailing list last month: see https://lists.eurecom.fr/sympa/arc/openair5g-user/2024-12/msg00109.html In the meantime I have written to Robert Schmidt about this. He had the following suspicion:
"RFsim channel emulation works such that the signal of the other side (@gNB from UE, @UE from gNB) is processed, then summed across all the remote ends (see rxAddInput()). My suspicion is that this also sums up multiple noise signals, so for each UE end, you get additional noise, or in other words, assuming you have N UEs, something like y = N * x_n + N*n where y is output, x_n the signal from UE n=1..N, and n the noise. So you might have simply more noise than you expect."
After examining apply_channelmod.c https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/radio/rfsimulator/apply_channelmod.c I came to the conclusion that his theory may be correct. So the problem could possibly be solved with a simple normalisation of the noise. To try this I did the following:
- Add this code:
// Scale the noise to account for the number of UEs
const double adjusted_noise_per_sample = noise_per_sample / sqrt(N_UEs); // Normalise the noise
For this to work, I would need access to the number of UEs connected (N_UEs). Unfortunately, I don't understand the code well enough to figure out how to add this parameter myself. For my test, I simply hardcoded N_UEs to "2".
- Replace the following lines in the loop
out_ptr->r = lround(rx_tmp.r * pathLossLinear + adjusted_noise_per_sample * gaussZiggurat(0.0, 1.0));
out_ptr->i = lround(rx_tmp.i * pathLossLinear + adjusted_noise_per_sample * gaussZiggurat(0.0, 1.0));
With these changes (using the hardcoded N_UEs = 2) the connection was stable for both UEs using the same commands as before (see mailing list). (This is not correct. See #895 (comment 148440))
Robert suggested using the global variable "nb_ue" for N_UEs, however this results in a failing build with the following error:
ERROR: 1 error. See
~/openairinterface5g/cmake_targets/log/all.txt
compilation of oai_usrpdevif nr-softmodem nr-cuup params_libconfig coding
rfsimulator dfts params_yaml failed
build have failed
Does anyone have a solution/idea for this?
Thanks for your help.
Best regards, Oliver