This repository contains a modified version of srsRAN_4G that includes an internal channel emulator. This allows simulating real propagation conditions (fading, noise, delay, Doppler) directly in software, without the need for external RF hardware or expensive physical channel simulators.
The channel emulator has been implemented by intercepting the I/Q sample flow at the UE's physical layer (PHY).
srsRAN_4G/srsue/src/phy/sync.cc: Channel emulator logic has been added in the receiver (DL) for LTE and NSA.syncclass: Instances ansrsran::channelobject if configuration enables it.radio_recv_fncmethod: Samples received from the "radio" (which can be virtual or USRP connected via cable) pass through thechannel_emulator->run(...)method before being processed by the protocol stack.
srsRAN_4G/srsue/src/phy/sync_sa.cc: Implementation for 5G Standalone (SA).- Supports emulation in both Downlink (DL) and Uplink (UL).
srsRAN_4G/lib/include/srsran/phy/channel/channel.h: Definition of thechannelclass and its arguments.srsRAN_4G/lib/src/phy/channel/fading.candsrsRAN_4G/lib/include/srsran/phy/channel/fading.h:- Added support for new fading models (TDL-A, TDL-B, TDL-C).
srsRAN_4G/srsue/src/ue.cc: Reading and passing configuration arguments fromue.conf.
The emulator uses the srsran::channel class which supports:
- AWGN (Additive White Gaussian Noise): Adds configurable noise to simulate different SNR levels.
- Fading:
- Standard 3GPP models: EPA, EVA, ETU, TDL-A, TDL-B, TDL-C.
- Maximum Doppler configuration.
- Delay:
- Constant or time-varying delay (sinusoidal).
- Useful for simulating variable distances or synchronization issues.
- HST (High Speed Train):
- Simulates the extreme Doppler effect of a high-speed train.
- RLF (Radio Link Failure):
- Simulates connection drops by periodically turning the channel off and on.
To use the emulator, it is not necessary to modify the ue.conf file. All parameters can be passed directly via the command line when running the application.
Parameters follow the structure --section.parameter=value. Below are the main available arguments:
--channel.dl.enable=true: Enables the emulator in Downlink.--channel.ul.enable=true: Enables the emulator in Uplink.
--channel.dl.awgn.enable=true: Activates the noise generator.--channel.dl.awgn.snr=30: Sets the Signal-to-Noise Ratio (SNR) in dB.
--channel.dl.fading.enable=true: Activates fading.--channel.dl.fading.model=epa5: Selects the model (e.g.,epa5,eva70,etu300,tdl-a, etc.).
--channel.dl.delay.enable=true: Activates delay.--channel.dl.delay.minimum_us=10: Minimum delay in microseconds.--channel.dl.delay.maximum_us=100: Maximum delay in microseconds.--channel.dl.delay.period_s=3600: Delay variation period.
--channel.dl.rlf.enable=true: Activates failure simulation.--channel.dl.rlf.t_on_ms=10000: Connection active time (ms).--channel.dl.rlf.t_off_ms=2000: Disconnection time (ms).
--channel.dl.hst.enable=true: Activates the HST model.--channel.dl.hst.fd_hz=750.0: Doppler frequency in Hz.
Note: To configure the emulator for Uplink, simply change
dltoulin any of the above commands (e.g.,--channel.ul.fading.enable=true).
Ensure you have the srsRAN dependencies installed (CMake, Boost, ZMQ simulator if used, etc.).
cd srsRAN_4G
mkdir build
cd build
cmake ..
make -j$(nproc)Run the UE with the default configuration file:
sudo ./srsue/src/srsue ../srsue/ue.confTo enable the emulator in the uplink, activating the TDL-B fading model with a maximum Doppler of 50Hz, use the following command:
sudo ./srsue/src/srsue ../srsue/ue.conf --channel.ul.enable=true --channel.ul.fading.enable=true --channel.ul.fading.model=tdlb50If you are using ZMQ to simulate the radio (no RF hardware) and want to add AWGN in Downlink:
sudo ./srsue/src/srsue ../srsue/ue_zmq.conf --channel.dl.enable=true --channel.dl.awgn.enable=true --channel.dl.awgn.snr=25.0Important: Ensure that
ue.conf(or whichever configuration file you use) has the[channel.*]sections present, even if commented out or empty, so that the argument parser recognizes them. If you followed the installation instructions in this repo, they should already be there.