Channel Modeling
- class Channel(transmitter=None, receiver=None, active=None, gain=None, sync_offset_low=0.0, sync_offset_high=0.0, impulse_response_interpolation=True, seed=None)
Bases:
hermespy.core.factory.SerializableArray
,hermespy.core.random_node.RandomNode
An ideal distortion-less channel.
It also serves as a base class for all other channel models.
For MIMO systems, the received signal is the addition of the signal transmitted at all antennas. The channel will provide number_rx_antennas outputs to a signal consisting of number_tx_antennas inputs. Depending on the channel model, a random number generator, given by rnd may be needed. The sampling rate is the same at both input and output of the channel, and is given by sampling_rate samples/second.
- Parameters
transmitter (Transmitter, optional) – The modem transmitting into this channel.
receiver (Receiver, optional) – The modem receiving from this channel.
active (bool, optional) – Channel activity flag. Activated by default.
gain (float, optional) – Channel power gain. 1.0 by default.
sync_offset_low (float, optional) – Minimum synchronization error in seconds.
sync_offset_high (float, optional) – Maximum synchronization error in seconds.
impulse_response_interpolation (bool, optional) – Allow the impulse response to be interpolated during sampling.
seed (int, optional) – Seed used to initialize the pseudo-random number generator.
- yaml_tag: str = 'Channel'
YAML serialization tag.
- yaml_matrix = True
- impulse_response_interpolation: bool
- property active: bool
Access channel activity flag.
- Returns
Is the channel currently activated?
- Return type
bool
- property transmitter: hermespy.simulation.simulated_device.SimulatedDevice
SimulatedDevice transmitting into this channel.
- Returns
A handle to the modem transmitting into this channel.
- Return type
- Raises
RuntimeError – If a transmitter is already configured.
- property receiver: hermespy.simulation.simulated_device.SimulatedDevice
SimulatedDevice receiving from this channel.
- Returns
A handle to the device receiving from this channel.
- Return type
- Raises
RuntimeError – If a receiver is already configured.
- property sync_offset_low: float
Synchronization error minimum.
- Returns
Minimum synchronization error in seconds.
- Return type
float
- property sync_offset_high: float
Synchronization error maximum.
- Returns
Maximum synchronization error in seconds.
- Return type
float
- property gain: float
Access the channel gain.
The default channel gain is 1. Realistic physical channels should have a gain less than one.
- Returns
The channel gain.
- Return type
float
- property num_inputs: int
The number of streams feeding into this channel.
Actually shadows the num_streams property of his channel’s transmitter.
- Returns
The number of input streams.
- Return type
int
- Raises
RuntimeError – If the channel is currently floating.
- property num_outputs: int
The number of streams emerging from this channel.
Actually shadows the num_streams property of his channel’s receiver.
- Returns
The number of output streams.
- Return type
int
- Raises
RuntimeError – If the channel is currently floating.
- propagate(forwards=None, backwards=None)
Propagate radio-frequency band signals over a channel instance.
For the ideal channel in the base class, the MIMO channel is modeled as a matrix of ones. The routine samples a new impulse response, which will be converted to ChannelStateInformation.
- Parameters
- Returns
- forwards_receptions (List[Signal]):
Signal models impinging onto device_beta after channel propagation.
- backwards_receptions (List[Signal]):
Signal models impinging onto device_alpha after channel propagation.
- csi (ChannelStateInformation):
State of the channel during signal propagation.
- Return type
Tuple[List[Signal], List[Signal], ChannelStateInformation]
- Raises
ValueError – If the number of streams in forwards is not one or the number of antennas in device_alpha. If the number of streams in backwards is not one or the number of antennas in device_beta.
RuntimeError – If the scenario configuration is not supported by the default channel model.
RuntimeError – If the channel is currently floating.
- static Propagate(signal, impulse_response, delay)
Propagate a single signal model given a specific channel impulse response.
- impulse_response(num_samples, sampling_rate)
Sample a new channel impulse response.
Note that this is the core routine from which propagate will create the channel state.
- Parameters
num_samples (int) – Number of samples within the impulse response.
sampling_rate (float) – The rate at which the delay taps will be sampled, i.e. the delay resolution.
- Returns
Impulse response in all number_rx_antennas x number_tx_antennas. 4-dimensional array of size T x number_rx_antennas x number_tx_antennas x (L+1) where L is the maximum path delay (in samples). For the ideal channel in the base class, L = 0.
- Return type
np.ndarray
- property min_sampling_rate: float
Minimal sampling rate required to adequately model the channel.
- Returns
The minimal sampling rate in Hz.
- Return type
float
- classmethod to_yaml(representer, node)
Serialize a channel object to YAML.
- Parameters
representer (SafeRepresenter) – A handle to a representer used to generate valid YAML code. The representer gets passed down the serialization tree to each node.
node (Channel) – The channel instance to be serialized.
- Returns
The serialized YAML node.
- Return type
Node