torchsig.transforms.functional.quantize

torchsig.transforms.functional.quantize(data: ndarray, num_bits: int, ref_level_adjustment_db: float = 0.0) ndarray[source]

Quantize input to number of levels specified.

Default implementation is ceiling.

Parameters:
  • data (np.ndarray) – IQ data.

  • num_bits (int) – Number of bits to simulate

  • ref_level_adjustment_db (float) – Changes the relative scaling of the input. For example, ref_level_adjustment_db = 3.0, the average power is now 3 dB above full scale and into saturation. For ref_level_adjustment_db = -3.0, the average power is now 3 dB below full scale and simulates a loss of dynamic range. Default is 0.

Raises:

ValueError – Invalid round type.

Returns:

Quantized IQ data.

Return type:

np.ndarray