Audio Device Binding

Hermes hardware bindings to audio devices offer the option to benchmark complex-valued communication waveforms over affordable consumer-grade audio hardware. The effective available bandwidth is limited to half of the audio devices sampling rate, which is typically either \(44.1~\mathrm{kHz}\) or \(48~\mathrm{kHz}\).

class AudioDeviceAntennas(device)

Bases: AntennaArrayBase

Antenna array information for audio devices.

property num_antennas: int

Number of antenna elements within this array.

Returns

Number of antenna elements.

Return type

int

class AudioDevice(playback_device, record_device, playback_channels=None, record_channels=None, sampling_rate=48000, **kwargs)

Bases: PhysicalDevice, Serializable

HermesPy binding to an arbitrary audio device. Let’s rock!

Parameters
  • playback_device (int) – Device over which audio streams are to be transmitted.

  • record_device (int) – Device over which audio streams are to be received.

  • playback_channels (Union[np.ndarray, Iterable], optional) – List of audio channels for signal transmission. By default, the first channel is selected.

  • record_channels (Union[np.ndarray, Iterable], optional) – List of audio channels for signal reception. By default, the first channel is selected.

  • sampling_rate (float, optional) – Configured sampling rate. 48 kHz by default.

yaml_tag: Optional[str] = 'AudioDevice'

YAML serialization tag.

property_blacklist: Set[str] = {'orientation', 'position', 'random_mother', 'topology', 'velocity', 'wavelength'}

Set of properties to be ignored during serialization.

property playback_device: int

Device over which audio streams are to be transmitted.

Returns: Device identifier.

Raises

ValueError – For negative identifiers.

Return type

int

property record_device: int

Device over which audio streams are to be received.

Returns: Device identifier.

Raises

ValueError – For negative identifiers.

Return type

int

property playback_channels: List[int]

Audio channels for signal transmission.

Returns: List of audio channel indices.

Raises

ValueError – On arguments not representing vectors.

Return type

List[int]

property record_channels: List[int]

Audio channels for signal reception.

Returns: List of audio channel indices.

Raises

ValueError – On arguments not representing vectors.

Return type

List[int]

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 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 max_sampling_rate: float

Maximal device sampling rate.

Returns: The samplin rate in Hz.

Return type

float

trigger()

Trigger the device.

Return type

None