Physical Devices
- class StaticOperator(num_samples, sampling_rate)
Bases:
object
Base class for static device operators
- Parameters
num_samples (int) – Number of samples per transmission.
sampling_rate (float) – Sampling rate of transmission.
- property num_samples: int
Number of samples per transmission.
Returns: Number of samples.
- Return type
int
- property sampling_rate: float
- Return type
float
- property frame_duration: float
- Return type
float
- class SilentTransmitter(num_samples, sampling_rate)
Bases:
StaticOperator
,Transmitter
Silent transmitter mock.
- Parameters
num_samples (int) – Number of samples per transmission.
sampling_rate (float) – Sampling rate of transmission.
- 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.
- Return type
- Returns
Information generated while transmitting over this operator.
- Raises
FloatingError – If the transmitter is currently considered floating.
- class SignalTransmitter(num_samples, sampling_rate)
Bases:
StaticOperator
,Transmitter
Custom signal transmitter.
- Parameters
num_samples (int) – Number of samples per transmission.
sampling_rate (float) – Sampling rate of transmission.
- 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.
- Return type
- Returns
Information generated while transmitting over this operator.
- Raises
FloatingError – If the transmitter is currently considered floating.
- class PowerReceiver(seed=None, reference=None, *args, **kwargs)
Bases:
Receiver
Noise power receiver for the device noise floor estimation routine.
- Parameters
seed (int, optional) – Random seed used to initialize the pseudo-random number generator.
reference (Device, optional) – Reference device to which the channel shall be estimated.
*args – Operator base class initialization parameters.
**kwargs – Operator base class initialization parameters.
- property sampling_rate: float
The operator’s preferred sampling rate.
- Return type
float
- Returns
Sampling rate in Hz.
- property energy: float
- Return type
float
- receive()
Receive a signal.
Pulls the required signal model and channel state information from the underlying device.
- Return type
- Returns
Information received by this operator.
- 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, sampling_rate)
Bases:
StaticOperator
,Receiver
Custom signal receiver.
- Parameters
num_samples (int) – Number of samples per transmission.
sampling_rate (float) – Sampling rate of transmission.
- property energy: float
- Return type
float
- receive()
Receive a signal.
Pulls the required signal model and channel state information from the underlying device.
- Return type
- Returns
Information received by this operator.
- Raises
FloatingError – If the transmitter is currently considered floating.
- class PhysicalDevice(max_receive_delay=0.0, calibration_delay=0.0, *args, **kwargs)
Bases:
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
- property adaptive_sampling: bool
Allow adaptive sampling during transmission.
Returns: Enabled flag.
- Return type
bool
- property lowpass_filter: bool
Apply a digital lowpass filter to the received base-band samples.
Returns: Enabled flag.
- Return type
bool
- property lowpass_bandwidth: float
Digital lowpass filter bandwidth
- Return type
float
- Returns
Filter bandwidth in Hz. Zero if the device should determine the bandwidth automatically.
- Raises
ValueError – For negative bandwidths.
- property max_receive_delay: float
Maximum expected delay during signal reception.
The expected delay will be appended as additional samples to the expected frame length during reception.
- Return type
float
- Returns
The expected receive delay in seconds.
- Raises
ValueError – If the delay is smaller than zero.
- abstract property max_sampling_rate: float
Maximal device sampling rate.
Returns: The samplin rate in Hz.
- Return type
float
- property velocity: 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
- transmit(clear_cache=True)
Transmit over this device.
- Parameters
clear_cache (bool, optional) – Clear the cache of operator signals to be transmitted. Enabled by default.
Returns: Signal transmitted by this device.
- Return type
- receive(signal=None)
Receive over this device.
- Parameters
signal (Signal) – The samples to be processed by the device.
Returns
The samples after processing.
- Return type
- 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
- PhysicalDeviceType
Type of phyiscal device.
alias of TypeVar(‘PhysicalDeviceType’, bound=
PhysicalDevice
)