cbadc.digital_control.DigitalControl

class cbadc.digital_control.DigitalControl(T: float, M: int, t0: float = 0.0)

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
  • T (float) – clock period at which the digital control updates.

  • M (int) – number of controls.

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

T

clock period \(T\) of digital control system.

Type

float

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

Examples

>>> from cbadc.digital_control import DigitalControl
>>> T = 1e-6
>>> M = 4
>>> dc = DigitalControl(T, M)
>>> print(dc)
The Digital Control is parameterized as:
T = 1e-06,
M = 4, and next update at
t = 1e-06

Methods

__init__(T, M[, t0])

control_contribution(t, s_tilde)

Evaluates the control contribution at time t given a control observation s_tilde.

control_signal()

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

impulse_response(m, t)

The impulse response of the corresponding DAC waveform

control_contribution(t: float, s_tilde: numpy.ndarray) numpy.ndarray

Evaluates the control contribution at time t given a control observation s_tilde.

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

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

Examples

>>> from cbadc.digital_control import DigitalControl
>>> import numpy as np
>>> T = 1e-6
>>> M = 4
>>> dc = DigitalControl(T, M)
>>> res = dc.control_contribution(T + 1e-100, np.array([0.1, -0.2, 0.3, -99]))
>>> print(np.array(res))
[ 1. -1.  1. -1.]
Returns

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

Return type

array_like, shape=(M,)

control_signal() numpy.ndarray

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

Examples

>>> from cbadc.digital_control import DigitalControl
>>> import numpy as np
>>> T = 1e-6
>>> M = 4
>>> dc = DigitalControl(T, M)
>>> _ = dc.control_contribution(T, np.array([-0.1, -0.2, 0.3, 99]))
>>> res = dc.control_signal()
>>> print(np.array(res))
[0 0 1 1]
Returns

current control state.

Return type

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

impulse_response(m: int, t: float)

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

Examples using cbadc.digital_control.DigitalControl