cbadc.digital_control.multi_level_digital_control.MultiLevelDigitalControl

class cbadc.digital_control.multi_level_digital_control.MultiLevelDigitalControl(clock: Clock, M: int, number_of_levels: List[int], impulse_response: List[_ImpulseResponse] = None, offsets: List[float] = [])[source]

Bases: DigitalControl

Multi-level digital control system.

Parameters
  • clock (cbadc.analog_signal.clock.Clock) – the clock to which the digital control synchronizes its updates.

  • M (int) – number of controls.

  • number_of_levels ([int]) – number of levels for each of the M quantizers.

  • t0 (float, optional) – determines initial time, defaults to 0.

  • impulse_response (cbadc.analog_signal.AnalogSignal, optional) – the digital control’s impulse response.

  • offsets ([float], optional) – a M sized list with offsets for each control, defaults to all 0.

clock

the digital control system clock.

Type

cbadc.analog_signal.clock.Clock

M

number of controls \(M\).

Type

int

M_tilde

number of control observations \(\tilde{M}\).

Type

int

Note

For this digital control system \(M=\tilde{M}\). Also, the number of levels should equal M_tilde.

Methods

__init__(clock, M, number_of_levels[, ...])

control_contribution(t)

Evaluates the control contribution at time t.

control_signal()

Returns the current control state, i.e, \(\mathbf{s}[k]\).

control_update(t, s_tilde)

Updates the control at time t if valid.

impulse_response(m, t)

The impulse response of the corresponding DAC waveform

quantize(m_tilde, s_tilde_m)

Quantizes the state vector.

reset([t0])

Reset the digital control clock

control_contribution(t: float) ndarray

Evaluates the control contribution at time t.

Parameters

t (float) – time at which the digital control i evaluated.

Returns

the control signal \(\mathbf{s}(t)\)

Return type

array_like, shape=(M,)

control_signal() ndarray

Returns the current control state, i.e, \(\mathbf{s}[k]\).

Examples

>>> from cbadc.digital_control import DigitalControl
>>> from cbadc.analog_signal import Clock
>>> import numpy as np
>>> T = 1e-6
>>> M = 4
>>> dc = DigitalControl(Clock(T), M)
>>> _ = dc.control_contribution(T)
>>> dc.control_signal()
array([0., 0., 0., 0.])
Returns

current control state.

Return type

array_like, shape=(M,), dtype=numpy.int8

control_update(t: float, s_tilde: ndarray)[source]

Updates the control at time t if valid.

Parameters
  • t (float) – time at which the digital control i evaluated.

  • s_tilde (array_like, shape=(M_tilde,)) – state vector evaluated at time t

impulse_response(m: int, t: float) ndarray

The impulse response of the corresponding DAC waveform

Parameters
  • m (int) – determines which \(m\in\{0,\dots,M-1\}\) control dimension which is triggered.

  • t (float) – evaluate the impulse response at time t.

Returns

the dac waveform of the digital control system.

Return type

array_like, shape=(M,)

quantize(m_tilde: int, s_tilde_m: array)[source]

Quantizes the state vector.

Parameters
  • m_tilde (int) – index of the control.

  • s_tilde_m (array_like, shape=(M_tilde,)) – state vector evaluated at time t

Returns

quantized state vector.

Return type

int

reset(t0: float = 0.0)

Reset the digital control clock

Parameters

t0 (float, optional) – time to set next update at, defaults to 0.