Fading channel#
This module contains the FadingChan
class
which can be used to simulate OFDM transmission through a tapped delay line
(TDL) fading channel. The implementation is using GPU acceleration.
- class aerial.phy5g.chan_models.fading_chan.FadingChan#
Fading channel class.
This class implements the fading channel that processes the frequency Tx samples and outputs frequency Rx samples. It includes OFDM modulation, tapped delay line (TDL) channel, OFDM demodulation, and adds noise based on input SNR.
- __init__(
- cuphy_carrier_prms,
- tdl_cfg=None,
- cdl_cfg=None,
- fading_type=1,
- freq_in=None,
- proc_sig_freq=False,
- disable_noise=False,
- rand_seed=0,
Initialize the FadingChan class.
cuphy_carrier_prms: carrier parameters for the channel
tdl_config: configuration of TDL channel
cdl_config: configuration of CDL channel
fading_type: 0: AWGN, 1: TDL, 2: CDL
freq_in: input frequency tx
proc_sig_freq: processing signal in freq domain will use the CFR from TDL class to process data on frequency domain. This mode may be inaccurate if CFO presents.
disable_noise: disable additive Gaussian noise
rand_seed: random seed for TDL/CDL channel generation
- Parameters:
cuphy_carrier_prms (aerial.pycuphy.CuphyCarrierPrms)
tdl_cfg (aerial.pycuphy.TdlConfig | None)
cdl_cfg (aerial.pycuphy.CdlConfig | None)
fading_type (int)
freq_in (numpy.ndarray | None)
proc_sig_freq (bool)
disable_noise (bool)
rand_seed (int)
- Return type:
None
- add_noise_with_snr(snr_db, enable_swap_tx_rx=False)#
Add Gaussian noise to a complex signal with a specified SNR.
- Parameters:
snr_db (float) – Desired Signal-to-Noise Ratio in decibels.
enable_swap_tx_rx (bool) – Swap tx and rx to simulate UL channel using DL class.
- Returns:
The frequency-domain signal with noise added.
- Return type:
np.ndarray
- add_noise_with_snr_numpy(snr_db, enable_swap_tx_rx=False)#
Add Gaussian noise to a complex signal with a specified SNR.
- Parameters:
snr_db (float) – Desired Signal-to-Noise Ratio in decibels.
enable_swap_tx_rx (bool) – Swap tx and rx to simulate UL channel using DL class.
pycuphy.GauNoiseAdder (This function is GPU-accelerated by add_noise_with_snr() and)
- Returns:
The frequency-domain signal with noise added.
- Return type:
np.ndarray
- dump_channel(freq_in=None, enable_swap_tx_rx=False)#
Dump TDL channel to numpy arrays.
- Returns:
A tuple containing two numpy arrays (cfr_sc, cfr_prbg).
- Return type:
tuple
- Parameters:
freq_in (numpy.ndarray | None)
enable_swap_tx_rx (bool)
- get_genie_channel(
- freq_in=None,
- cfr_sc=None,
- enable_swap_tx_rx=False,
need to do ofdm demodulation of the rx-tx ant pair sample to get genie channel
- Parameters:
freq_in (numpy.ndarray | None)
cfr_sc (numpy.ndarray | None)
enable_swap_tx_rx (bool)
- Return type:
None
- reset()#
Reset the fading channel.
- Return type:
None
- run(
- tti_idx,
- snr_db,
- enable_swap_tx_rx=False,
- tx_column_major_ind=False,
- freq_in=None,
Run the fading channel.
- Parameters:
tti_idx (int) – TTI index.
snr_db (float) – Signal-to-Noise Ratio in dB.
enable_swap_tx_rx (bool) – Swap tx and rx to simulate UL channel using DL class.
freq_in (np.ndarray) – Frequency domain input samples.
tx_column_major_ind (bool)
- Returns:
Frequency domain samples after channel processing.
- Return type:
np.ndarray