Physical Devices

class SilentTransmitter(num_samples)

Bases: hermespy.core.device.Transmitter

Silent transmitter mock.

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

  • *args – Operator base class initialization parameters.

  • **kwargs – Operator base class initialization parameters.

property sampling_rate: float

Rate which this operator continuous signals into discrete samples.

Returns

Sampling rate in Hz.

Return type

rate (float)

transmit(duration=0.0)

Transmit a signal.

Registers the signal samples to be transmitted by the underlying device.

Parameters

duration (float, optional) – Duration of the transmitted signal. If not specified, the duration will be inferred by the transmitter.

Returns

Tuple of transmitted signal as well as additional information.

Return type

Tuple[Signal, Any, …]

Raises

FloatingError – If the transmitter is currently considered floating.

property frame_duration: float

Duration of a single sample frame.

Returns

Frame duration in seconds.

Return type

duration (float)

class PowerReceiver(seed=None, *args, **kwargs)

Bases: hermespy.core.device.Receiver

Noise receiver mock.

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

  • *args – Operator base class initialization parameters.

  • **kwargs – Operator base class initialization parameters.

property sampling_rate: float

Rate which this operator continuous signals into discrete samples.

Returns

Sampling rate in Hz.

Return type

rate (float)

property energy: float

Average energy of the received signal.

Returns

Energy.

Return type

float

receive()

Receive a signal.

Pulls the required signal model and channel state information from the underlying device.

Returns

Tuple of received signal as well as additional information.

Return type

Tuple[Signal, Any, …]

Raises

FloatingError – If the transmitter is currently considered floating.

property frame_duration: float

Duration of a single sample frame.

Returns

Frame duration in seconds.

Return type

duration (float)

class SignalTransmitter(num_samples)

Bases: hermespy.core.device.Transmitter

Silent transmitter mock.

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

  • *args – Operator base class initialization parameters.

  • **kwargs – Operator base class initialization parameters.

property sampling_rate: float

Rate which this operator continuous signals into discrete samples.

Returns

Sampling rate in Hz.

Return type

rate (float)

transmit(signal)

Transmit a signal.

Registers the signal samples to be transmitted by the underlying device.

Parameters

duration (float, optional) – Duration of the transmitted signal. If not specified, the duration will be inferred by the transmitter.

Returns

Tuple of transmitted signal as well as additional information.

Return type

Tuple[Signal, Any, …]

Raises

FloatingError – If the transmitter is currently considered floating.

property frame_duration: float

Duration of a single sample frame.

Returns

Frame duration in seconds.

Return type

duration (float)

class SignalReceiver(num_samples)

Bases: hermespy.core.device.Receiver

Noise receiver mock.

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

  • *args – Operator base class initialization parameters.

  • **kwargs – Operator base class initialization parameters.

property sampling_rate: float

Rate which this operator continuous signals into discrete samples.

Returns

Sampling rate in Hz.

Return type

rate (float)

property energy: float

Average energy of the received signal.

Returns

Energy.

Return type

float

receive()

Receive a signal.

Pulls the required signal model and channel state information from the underlying device.

Returns

Tuple of received signal as well as additional information.

Return type

Tuple[Signal, Any, …]

Raises

FloatingError – If the transmitter is currently considered floating.

property frame_duration: float

Duration of a single sample frame.

Returns

Frame duration in seconds.

Return type

duration (float)

class PhysicalDevice(*args, **kwargs)

Bases: hermespy.core.device.Device

Base representing any device controlling real hardware.

Parameters
  • *args – Device base class initialization parameters.

  • **kwargs – Device base class initialization parameters.

property calibration_delay: float

Delay compensation of the device calibration.

Returns

Delay compensation in seconds.

Return type

float

abstract trigger()

Trigger the device.

Return type

None

transmit(clear_cache=False)

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

Signal

receive(signal)

Receive a new signal at this physical device.

Parameters

signal (Signal) – Signal model to be received.

Return type

None

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.

estimate_noise_power(num_samples=1000)

Estimate the power of the noise floor within the hardware.

Receives num_samples without any transmissions and estimates the power over them. Note that any interference in this case will be interpreted as noise.

Parameters

num_samples (int, optional) – Number of received samples. 1000 by default.

Returns

Estimated noise power at each respective receive channel, i.e. the variance of the unbiased received samples.

Return type

np.ndarray

calibrate(max_delay, calibration_file, num_iterations=10, wait=0.0)

Calibrate the hardware.

Currently the calibration will only compensate possible time-delays. Ideally, the transmit and receive channels of the device should be connected by a patch cable. WARNING: An attenuator element may be required! Be careful!!!!

Parameters
  • max_delay (float) – The maximum expected delay which the calibration should compensate for in seconds.

  • calibration_file (str) – Location of the calibration dump within the filesystem.

  • num_iterations (int, optional) – Number of calibration iterations. Default is 10.

  • wait (float, optional) – Idle time between iteration transmissions in seconds.

Returns

A figure of information regarding the calibration.

Return type

plt.Figure

load_calibration(calibration_file)

Recall a dumped calibration from the filesystem.

Parameters

calibration_file (str) – Location of the calibration dump.

Return type

None