Constant Gain#

class Gain(gain=1.0, rescale_quantization=False)[source]#

Bases: Serializable, GainControlBase

Constant gain model.

Parameters:
  • gain (float, optional) – Linear signal gain to be applied before ADC quantization. Unit by default, meaning no gain adjustment.

  • rescale_quantization (bool, optional) – If enabled, the quantized signal is rescaled to the original signal range before gain adjustment. Disabled by default.

estimate_gain(input_signal)[source]#

Estimate the gain required to adjust the signal to the ADC input range.

Parameters:

input_signal (Signal) – Input signal to be adjusted.

Return type:

float

Returns: Linear gain to be applied to the input_signal’s Voltage samples.

property gain: float#

Linear gain before ADC quantization.

Quantizer operates by default between -1. and +1. Signal can be adjusted by to this range by appropriate gain setting.

Returns: Gain in Volt.

Raises:

ValueError – If gain is smaller or equal to zero.

yaml_tag: Optional[str] = 'Gain'#

YAML serialization tag.