USRP Device

Inheritance diagram of hermespy.hardware_loop.uhd.usrp.UsrpDevice, hermespy.hardware_loop.uhd.usrp.UsrpAntennas
class UsrpDevice(ip, port=5555, carrier_frequency=700000000.0, sampling_rate=None, oversampling_factor=2, tx_gain=0.0, rx_gain=0.0, scale_transmission=True, num_prepended_zeros=200, num_appended_zeros=200, selected_transmit_ports=None, selected_receive_ports=None, **kwargs)[source]

Bases: PhysicalDevice[PhysicalDeviceState], Serializable

Bindung to a USRP device via the UHD library.

Parameters:
  • ip (str) – The IP address of the USRP device.

  • port (int) – The port of the USRP device.

  • carrier_frequency (float) – Carrier frequency of the USRP device. \(700~\mathrm{MHz}\) by default.

  • sampling_rate (float | None) – Sampling rate of the USRP device. If not provided, the sampling rate is determined from the configured operators.

  • oversampling_factor (int) – Oversampling factor with respect to the signal bandwidth. \(2\) by default.

  • tx_gain (float) – The transmission gain of the USRP device. Zero by default.

  • rx_gain (float) – The reception gain of the USRP device. Zero by default.

  • scale_transmission (bool) – If True, the transmission signal is scaled to the maximum floating point value of the USRP device. This ensures a proper digital to analog conversion.

  • num_prepended_zeros (int) – The number of zeros prepended to the transmission signal. \(200\) by default.

  • num_appended_zeros (int) – The number of zeros appended to the transmission signal. \(200\) by default.

  • selected_transmit_ports (Sequence[int] | None) – Indices of the selected transmit antenna ports. If not specified, i.e. None, only the first antenna port is selected.

  • selected_receive_ports (Sequence[int] | None) – Indices of the selected receive antenna ports. If not specified, i.e. None, only the first antenna port is selected.

  • kwargs – Additional arguments passed to the PhysicalDevice parent class.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

UsrpDevice

Returns:

The deserialized object.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

state()[source]

Query the immutable physical state of the device.

Returns: The physical device state.

Return type:

PhysicalDeviceState

trigger()[source]

Trigger the device.

Return type:

None

property antennas: UsrpAntennas[source]

Antenna array model of the USRP device.

Allows for the further configuration of the device’s antenna array awareness.

property carrier_frequency: float[source]

Central frequency of the device’s emissions in the RF-band.

Denoted by \(f_c\) with unit \(\left[ f_c \right] = \mathrm{Hz} = \tfrac{1}{\mathrm{s}}\) in the literature.

Raises:

ValueError – On negative carrier frequencies.

property ip: str[source]

Internet protocol address of the remote host.

Returns:

IP adress.

property max_sampling_rate: float[source]

Maximal device sampling rate.

Returns: The samplin rate in Hz.

property num_appended_zeros: int[source]

Number of zero padding samples appended to the transmitted signal.

Returns: Number of appended samples.

Raises:

ValueError – For negative values.

property num_prepeneded_zeros: int[source]

Number of zero padding samples prepended to the transmitted signal.

Returns: Number of prepended samples.

Raises:

ValueError – For negative values.

property num_receive_rf_ports: int[source]

Number of receive ports controlled on the USRP device.

property num_transmit_rf_ports: int[source]

Number of transmit ports controlled on the USRP device.

property oversampling_factor: int[source]

Oversampling factor with respect to the signal bandwidth.

Raises:

ValueError – For values smaller than one.

property port: int[source]

Internet protocol port of the remote host.

Returns:

Port.

property rx_gain: float[source]

Gain of the receiving front-end in dB.

property sampling_rate: float[source]

Sampling rate at which the device’s analog-to-digital converters operate in Hz.

Raises:

ValueError – If the sampling rate is not greater than zero.

property scale_transmission: bool[source]

Indicates whether the transmission is scaled to the full DAC range.

Returns: Boolean enabled flag.

property selected_receive_ports: Sequence[int][source]

Indices of the selected receive ports.

property selected_transmit_ports: Sequence[int][source]

Indices of the selected transmit ports.

property tx_gain: float[source]

Gain of the transmitting front-end in dB.

class UsrpAntennas(device, pose=None)[source]

Bases: AntennaArray[Antenna]

Antenna and port configuration of a USRP device.

UsrpAntennas’ port configuration is linked to the attached :class`UsrpDevice` and cannot be changed manually.

Parameters:
  • device (UsrpDevice) – USRP device this antenna array models.

  • pose (Transformation | None) – Pose of the antenna array with respect to the device.

property antennas: list[Antenna][source]

All individual antenna elements within this array.

property device: UsrpDevice[source]

USRP device the antenna array is attached to.

property num_receive_antennas: int[source]

Number of receiving antenna elements within this array.

property num_transmit_antennas: int[source]

Number of transmitting antenna elements within this array.

property receive_antennas: list[Antenna][source]

Receiving antennas within this array.

property transmit_antennas: list[Antenna][source]

Transmitting antennas within this array.