cbadc.digital_control.digital_control.DigitalControl

class cbadc.digital_control.digital_control.DigitalControl(clock: Clock, M: int, impulse_response: List[_ImpulseResponse] = None, t_delay: float = 0.0, offsets: ndarray = None)[source]

Bases: object

Represents a digital control system.

This is the simplest digital control where \(M=\tilde{M}\) and each control signal is updated independently. Furthermore, the DAC waveform is a constant signal as \(\mathbf{s}(t)=\mathbf{s}[k]\) for \(t\in[k T, (k+1)T)\).

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

  • M (int) – number of controls.

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

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

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}\).

See also

cbadc.simulator.Simulator

Examples

>>> from cbadc.digital_control import DigitalControl
>>> from cbadc.analog_signal import Clock
>>> T = 1e-6
>>> clock = Clock(T)
>>> M = 4
>>> dc = DigitalControl(clock, M)

Methods

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

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

reset([t0])

Reset the digital control clock

control_contribution(t: float) ndarray[source]

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[source]

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. For t > clock.T the control is updated.

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

impulse_response(m: int, t: float) ndarray[source]

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,)

reset(t0: float = 0.0)[source]

Reset the digital control clock

Parameters

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