uhd_wrapper.utils package¶
Submodules¶
uhd_wrapper.utils.config module¶
This module contains classes and functions for configuring the USRPs
- class uhd_wrapper.utils.config.RfConfig(txAnalogFilterBw: float = 0.0, rxAnalogFilterBw: float = 0.0, txSamplingRate: float = 0.0, rxSamplingRate: float = 0.0, txGain: float = 0.0, rxGain: float = 0.0, txCarrierFrequency: float = 0.0, rxCarrierFrequency: float = 0.0, noTxStreams: int = 1, noRxStreams: int = 1, txAntennaMapping: ~typing.List[int] = <factory>, rxAntennaMapping: ~typing.List[int] = <factory>)¶
Bases:
DataClassJsonMixin
Describes the RF configuration of the USRP. In particular, carrier frequency, sampling rate, TX/RX gains are contained in this structure. Moreover, the stream to antenna mapping is described in the elements txAntennaMapping and rxAntennaMapping.
- txAnalogFilterBw: float = 0.0¶
- rxAnalogFilterBw: float = 0.0¶
- txSamplingRate: float = 0.0¶
- rxSamplingRate: float = 0.0¶
- txGain: float = 0.0¶
- rxGain: float = 0.0¶
- txCarrierFrequency: float = 0.0¶
- rxCarrierFrequency: float = 0.0¶
- noTxStreams: int = 1¶
- noRxStreams: int = 1¶
- txAntennaMapping: List[int]¶
Describes the mapping from a TX stream to an according TX antenna. If not empty, contains a list which describes the stream mapping. The nth element of the list identifies the antenna index (zero-based) where the nth stream is transmitted from.
If empty, uses a default mapping (i.e. first stream is mapped to first antenna, second stream to second antenna and so on), i.e. [0, 1, 2, …, noTxStreams-1].
- rxAntennaMapping: List[int]¶
Describes the mapping from an RX antenna to the RX streams. Consider the txAntennaMapping for a description of the format.
- serialize() str ¶
- __init__(txAnalogFilterBw: float = 0.0, rxAnalogFilterBw: float = 0.0, txSamplingRate: float = 0.0, rxSamplingRate: float = 0.0, txGain: float = 0.0, rxGain: float = 0.0, txCarrierFrequency: float = 0.0, rxCarrierFrequency: float = 0.0, noTxStreams: int = 1, noRxStreams: int = 1, txAntennaMapping: ~typing.List[int] = <factory>, rxAntennaMapping: ~typing.List[int] = <factory>) None ¶
- class uhd_wrapper.utils.config.RxStreamingConfig(receiveTimeOffset: float = 0.0, numSamples: int = 0, numRepetitions: int = 1, repetitionPeriod: int = 0, antennaPort: str = '')¶
Bases:
DataClassJsonMixin
- receiveTimeOffset: float = 0.0¶
- numSamples: int = 0¶
- numRepetitions: int = 1¶
- repetitionPeriod: int = 0¶
- antennaPort: str = ''¶
- __init__(receiveTimeOffset: float = 0.0, numSamples: int = 0, numRepetitions: int = 1, repetitionPeriod: int = 0, antennaPort: str = '') None ¶
- class uhd_wrapper.utils.config.MimoSignal(signals: List[numpy.ndarray] = <factory>)¶
Bases:
object
- signals: List[ndarray]¶
Each List item corresponds to one antenna frame.
- serialize() List[Tuple[List, List]] ¶
- static deserialize(serialized: List[Tuple[List, List]]) MimoSignal ¶
- __init__(signals: ~typing.List[~numpy.ndarray] = <factory>) None ¶
- uhd_wrapper.utils.config.rxContainsClippedValue(mimoSignal: MimoSignal) bool ¶
Checks if mimoSignal contains values above 1.0 in absolute value.
- uhd_wrapper.utils.config.txContainsClippedValue(mimoSignal: MimoSignal) bool ¶
- class uhd_wrapper.utils.config.TxStreamingConfig(sendTimeOffset: float = 0.0, samples: uhd_wrapper.utils.config.MimoSignal = <factory>, numRepetitions: int = 1)¶
Bases:
object
- __init__(sendTimeOffset: float = 0.0, samples: ~uhd_wrapper.utils.config.MimoSignal = <factory>, numRepetitions: int = 1) None ¶
- sendTimeOffset: float = 0.0¶
Offset in seconds from the basetime System.execute().
- samples: MimoSignal¶
- numRepetitions: int = 1¶
Determines how often the signal should be repeated before exiting. If not equal 1, the signal length must be aligned to the word size. Otherwise an error is raised.
uhd_wrapper.utils.serialization module¶
This module contains functions required for serialization.
Since we use zerorpc for RPC, we need to serialize non-pythonic datatypes.
- uhd_wrapper.utils.serialization.SerializedComplexArray¶
Tuple containing real samples as List as first element and complex samples as List as second element.
alias of
Tuple
[List
,List
]
- uhd_wrapper.utils.serialization.serializeComplexArray(data: ndarray) Tuple[List, List] ¶
Serialize a complex array.
- Parameters:
data (np.ndarray) – Onedimensional array of complex samples.
- Raises:
ValueError – Array must be one dimensional.
- Returns:
Serialized data.
- Return type:
SerializedComplexArray
- uhd_wrapper.utils.serialization.deserializeComplexArray(data: Tuple[List, List]) ndarray ¶
Deserialize into a complex array.
- Parameters:
data (SerializedComplexArray) – Samples.
- Raises:
ValueError – Number of samples must match
- Returns:
One dimensional numpy array.
- Return type:
np.ndarray