Device

Inheritance diagram of hermespy.core.device.Device
class Device(power=1.0, pose=None, seed=None)[source]

Bases: ABC, Transformable, RandomNode, Serializable

Physical device representation within HermesPy.

It acts as the basis for all transmissions and receptions of sampled electromagnetic signals.

Parameters:
  • power (float, optional) – Average power of the transmitted signals in Watts. 1.0 Watt by default.

  • pose (Transformation, optional) – Pose of the device with respect to its scenario coordinate system origin.

  • seed (int, optional) – Random seed used to initialize the pseudo-random number generator.

cache_transmission(transmission)[source]
Return type:

None

generate_output(operator_transmissions=None, resample=True)[source]

Generate the device’s output.

Parameters:

operator_transmissions (List[Transmissions], optional) – List of operator transmissions from which to generate the output. If the operator_transmissions are not provided, the transmitter’s caches will be queried.

Return type:

DeviceOutput

Returns: The device’s output.

Raises:

RuntimeError – If no operator_transmissions were provided and an operator has no cached transmission.

process_input(impinging_signals, cache=True)[source]

Process input signals impinging onto this device.

Parameters:
  • impinging_signals (Union[DeviceInput, Signal, Sequence[Signal]]) – The samples to be processed by the device.

  • cache (bool, optional) – Cache the operator inputs at the registered receive operators for further processing. Enabled by default.

Return type:

ProcessedDeviceInput

Returns: The processed device input information.

Raises:

ValueError – If the number of signal streams does not match the device configuration expectations.

receive(impinging_signals, cache=True)[source]

Receive over this device.

Internally calls Device.process_input() and Device.receive_operators().

Parameters:
  • impinging_signals (Union[DeviceInput, Signal, Sequence[Signal]]) – The samples to be processed by the device.

  • cache (bool, optional) – Cache the received information. Enabled by default.

Return type:

DeviceReception

Returns: The received device information.

receive_operators(operator_inputs=None, cache=True)[source]

Receive over the registered operators.

Parameters:
  • operator_inputs (ProcessedDeviceInput | Sequence[Signal | None], optional) – Signal models fed to the receive operators. If not provided, the operatores are expected to have inputs cached

  • cache (bool, optional) – Cache the generated received information at the device’s receive operators. Enabled by default.

Return type:

List[Reception]

Returns: List of information generated by receiving over the device’s operators.

Raises:
  • ValueError – If the number of operator inputs does not match the number of receive operators.

  • RuntimeError – If no operator inputs were specified and an operator has no cached inputs.

transmit(clear_cache=True)[source]

Transmit over this device.

Parameters:

clear_cache (bool, optional) – Clear the cache of operator signals to be transmitted. Enabled by default.

Return type:

DeviceTransmission

Returns: Information transmitted by this device.

transmit_operators()[source]

Generate transmitted information for all registered operators.

Calls Transmitter.transmit() for each transmit operator.

Returns: List of operator transmisisons.

Return type:

List[Transmission]

abstract property antennas: AntennaArray

Model of the device’s antenna array.

abstract 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 max_frame_duration: float

Maximum frame duration transmitted by this device.

Returns:

Maximum duration in seconds.

Return type:

max_duration (float)

property num_antennas: int

Number of antennas within this device’s topology.

Returns:

Number of antennas, greater or equal to one.

Return type:

int

property num_receive_antennas: int

Number of available receive antennas.

Shorthand to antennas' num_receive_antennas.

property num_receive_ports: int

Number of available receive antenna ports.

Short hand to antennas' num_receive_ports.

property num_transmit_antennas: int

Number of available transmit antennas.

Shorthand to antennas' num_transmit_antennas.

property num_transmit_ports: int

Number of available transmit antenna ports.

Shorthand to antennas' num_transmit_ports.

property power: float

Average power of the transmitted signal signal.

Returns:

Power in Watt.

Return type:

power (float)

Raises:

ValueError – If value is smaller than zero.

receivers: ReceiverSlot

Receivers capturing signals from this device

abstract 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.

property snr: float

Signal to noise ratio of the received signal.

Returns: Linear signal to noise ratio

transmitters: TransmitterSlot

Transmitters broadcasting signals over this device.

property wavelength: float

Central wavelength of the device’s emmissions in the RF-band.

Returns:

Wavelength in m.

Return type:

wavelength (float)

Raises:

ValueError – On wavelengths smaller or equal to zero.