Simulated Devices
- class SimulatedDevice(scenario=None, rf_chain=None, adc=None, sampling_rate=None, carrier_frequency=0.0, *args, **kwargs)
Bases:
hermespy.core.device.Device
,hermespy.core.random_node.RandomNode
,hermespy.core.factory.Serializable
Representation of a device simulating hardware.
Simulated devices are required to attach to a scenario in order to simulate proper channel propagation.
Warning
When configuring simulated devices within simulation scenarios, channel models may ignore spatial properties such as
position()
,orientation()
orvelocity()
.- Parameters
scenario (Scenario, optional) – Scenario this device is attached to. By default, the device is considered floating.
rf_chain (RfChain, optional) – Model of the device’s radio frequency amplification chain.
adc (AnalogDigitalConverter, optional) – Model of receiver’s ADC converter.
sampling_rate (float, optional) – Sampling rate at which this device operates. By default, the sampling rate of the first operator is assumed.
carrier_frequency (float, optional) – Center frequency of the mixed signal in rf-band in Hz. Zero by default.
*args – Device base class initialization parameters.
**kwargs – Device base class initialization parameters.
- yaml_tag: Optional[str] = 'SimulatedDevice'
YAML serialization tag.
- adc: AnalogDigitalConverter
Model of receiver’s ADC
- property orientation: numpy.ndarray
Orientation of the device within its scenario as a quaternion.
- Returns
The modem orientation as a normalized quaternion. None if the position is considered to be unknown.
- Return type
orientation (Optional[np.array])
- Raises
ValueError – If orientation is not a valid quaternion.
- property scenario: hermespy.core.scenario.Scenario
Scenario this device is attached to.
- Returns
Handle to the scenario this device is attached to.
- Return type
- Raises
FloatingError – If the device is currently floating.
RuntimeError – Trying to overwrite the scenario of an already attached device.
- property topology: numpy.ndarray
Antenna array topology.
The topology is represented by an Mx3 numpy array, where the first dimension M is the number of antennas and the second dimension their cartesian position within the device’s local coordinate system.
- Returns
A matrix of Mx3 entries describing the sensor array topology.
- Return type
topology (np.ndarray)
- Raises
ValueError – If the first dimension topology is smaller than 1 or its second dimension is larger than 3.
- property attached: bool
Attachment state of this device.
- Returns
True if the device is currently attached, False otherwise.
- Return type
bool
- property noise: hermespy.simulation.noise.noise.Noise
Model of the hardware noise.
- Returns
Handle to the noise model.
- Return type
- property sampling_rate: float
Sampling rate at which the device’s analog-to-digital converters operate.
- Returns
Sampling rate in Hz.
- Return type
sampling_rate (float)
- Raises
ValueError – If the sampling rate is not greater than zero.
RuntimeError – If the sampling rate could not be inferred.
- property carrier_frequency: float
Central frequency of the device’s emissions in the RF-band.
- Returns
Carrier frequency in Hz.
- Return type
frequency (float)
- Raises
ValueError – On negative carrier frequencies.
- property velocity: numpy.ndarray
Cartesian device velocity vector.
- Returns
Velocity vector.
- Return type
np.ndarray
- Raises
ValueError – If velocity is not three-dimensional.
NotImplementedError – If velocity is unknown.
- property operator_separation: bool
Separate operators during signal modeling.
- Return type
bool
- Returns
Enabled flag.
- transmit(clear_cache=True)
Transmit signal over this device.
- Parameters
clear_cache (bool, optional) – Clear the cache of operator signals to be transmitted. Enabled by default.
- Returns
Signal emitted by this device.
- Return type
- property snr: float
Signal to noise ratio at the receiver side.
- Return type
float
- Returns
Linear ratio of signal to noise power.
- receive(device_signals, snr=None, snr_type=SNRType.EBN0)
Receive signals at this device.
- Parameters
device_signals (Union[List[Signal], np.ndarray]) – List of signal models arriving at the device. May also be a two-dimensional numpy object array where the first dimension indicates the link and the second dimension contains the transmitted signal as the first element and the link channel as the second element.
snr (float, optional) – Signal to noise power ratio. Infinite by default, meaning no noise will be added to the received signals.
snr_type (SNRType, optional) – Type of signal to noise ratio.
- Returns
Baseband signal sampled after hardware-modeling.
- Return type
baseband_signal (Signal)
- classmethod to_yaml(representer, node)
Serialize a SimulatedDevice object to YAML.
- Parameters
representer (SimulatedDevice) – A handle to a representer used to generate valid YAML code. The representer gets passed down the serialization tree to each node.
node (SimulatedDevice) – The Device instance to be serialized.
- Returns
The serialized YAML node.
- Return type
MappingNode
- classmethod from_yaml(constructor, node)
Recall a new SimulatedDevice class instance from YAML.
- Parameters
constructor (SafeConstructor) – A handle to the constructor extracting the YAML information.
node (MappingNode) – YAML node representing the SimulatedDevice serialization.
- Returns
Newly created serializable instance.
- Return type