Gain Control Base¶
- class GainControlBase(rescale_quantization=False)[source]¶
Bases:
ABC
Base class for all ADC gain control models.
- Parameters:
rescale_quantization (bool, optional) – If enabled, the quantized signal is rescaled to the original signal range before gain adjustment. Disabled by default.
- adjust_signal(input_signal, gain)[source]¶
Adjust the signal to the ADC input range.
- Parameters:
- Return type:
Returns: The adjusted signal.
- abstract estimate_gain(input_signal)[source]¶
Estimate the gain required to adjust the signal to the ADC input range.
Returns: Linear gain to be applied to the input_signal’s Voltage samples.
- scale_quantized_signal(quantized_signal, gain)[source]¶
Scale the quantized signal back to the original signal range before gain adjustment.
Only applied if
rescale_quantization
is enabled.- Parameters:
- Return type:
Returns: The scaled qzanitized signal.