cbadc.analog_system.filters.ChebyshevII

class cbadc.analog_system.filters.ChebyshevII(N: int, Wn: float, rs: float)[source]

Bases: AnalogSystem

A Chebyshev type II filter’s analog system

This class inherits from cbadc.analog_system.AnalogSystem and is a convenient way of creating Chebyshev type II filter’s analog system representation.

Specifically, we specify the filter by the differential equations

\(\dot{\mathbf{x}}(t) = \mathbf{A} \mathbf{x}(t) + \mathbf{B} u(t) + \mathbf{\Gamma} \mathbf{s}(t)\)

\(\mathbf{y}(t) = \mathbf{C}^\mathsf{T} \mathbf{x}(t) + \mathbf{D} u(t)\)

\(\tilde{\mathbf{s}}(t) = \tilde{\mathbf{\Gamma}}^\mathsf{T} \mathbf{x}(t)\)

where

internally \(\mathbf{A}\) \(\mathbf{B}\), \(\mathbf{C}^\mathsf{T}\), and \(\mathbf{D}\) are determined using the scipy.signal.iirfilter().

Furthermore, as this system is intended as a pure filter and therefore have no

\(\mathbf{\Gamma}\) and \(\tilde{\mathbf{\Gamma}}^\mathsf{T}\) specified.

Parameters
  • N (int) – filter order

  • Wn ((float, float)) – array containing the critical frequencies (low, high) of the filter. The frequencies are specified in rad/s.

  • rs (float) – minimum attenutation in stopband. Specified in dB.

N

state space order \(N\).

Type

int

N_tilde

number of signal observations \(\tilde{N}\).

Type

int

M

number of digital control signals \(M\).

Type

int

M_tilde

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

Type

int

L

number of input signals \(L\).

Type

int

A

system matrix \(\mathbf{A}\).

Type

array_like, shape=(N, N)

B

input matrix \(\mathbf{B}\).

Type

array_like, shape=(N, L)

CT

signal observation matrix \(\mathbf{C}^\mathsf{T}\).

Type

array_like, shape=(N_tilde, N)

D

direct matrix

Type

array_like, shape=(N_tilde, L)

Gamma

control input matrix \(\mathbf{\Gamma}\).

Type

None

Gamma_tildeT

control observation matrix \(\tilde{\mathbf{\Gamma}}^\mathsf{T}\).

Type

None

Wn

critical frequency of filter.

Type

float

rs

minimum attenuation in stop band (dB).

Type

float

See also

cbadc.analog_system.ButterWorth, cbadc.analog_system.ChebyshevI, cbadc.analog_system.Cauer

Raises

InvalidAnalogSystemError – For faulty analog system parametrization.

Methods

__init__(N, Wn, rs)

Create a Chebyshev type II filter

control_observation(t, x[, u, s])

Computes the control observation for a given state vector \(\mathbf{x}(t)\) evaluated at time \(t\).

control_signal_transfer_function_matrix(omega)

Evaluates the transfer functions between control signals and the system output.

derivative(x, t, u, s)

Compute the derivative of the analog system.

eta2(BW)

Compute the eta2 parameter of the system.

homogenius_solution()

Compute the symbolic homogenious solution

signal_observation(x)

Computes the signal observation for a given state vector \(\mathbf{x}(t)\) evaluated at time \(t\).

symbolic_differential_equations(input, dim)

Organise system matrixes into ordinary differential equations

transfer_function_matrix(omega[, symbolic, ...])

Evaluate the analog signal transfer function at the angular frequencies of the omega array.

zpk([input])

return zero-pole-gain representation of system

Attributes

pre_computable

control_observation(t: float, x: ndarray, u: ndarray = None, s: ndarray = None) ndarray

Computes the control observation for a given state vector \(\mathbf{x}(t)\) evaluated at time \(t\).

Specifically, returns

\(\tilde{\mathbf{s}}(t) = \tilde{\mathbf{\Gamma}}^\mathsf{T} \mathbf{x}(t) + \tilde{\mathbf{D}} \mathbf{u}(t)\)

Parameters
  • x (array_like, shape=(N,)) – the state vector.

  • u (array_like, shape=(L,)) – the input vector

  • s (array_like, shape=(M,)) – the control signal

Returns

the control observation.

Return type

array_like, shape=(M_tilde,)

control_signal_transfer_function_matrix(omega: ndarray) ndarray

Evaluates the transfer functions between control signals and the system output.

Specifically, evaluates

\(\bar{\mathbf{G}}(\omega) = \mathbf{C}^\mathsf{T} \left(\mathbf{A} - i \omega \mathbf{I}_N\right)^{-1} \mathbf{\Gamma} \in \mathbb{R}^{\tilde{N} \times M}\)

for each angular frequency in omega where \(\mathbf{I}_N\) represents a square identity matrix of the same dimensions as \(\mathbf{A}\) and \(i=\sqrt{-1}\).

Parameters

omega (array_like, shape=(K,)) – an array_like object containing the angular frequencies for evaluation.

Returns

the signal transfer function evaluated at K different angular frequencies.

Return type

array_like, shape=(N_tilde, M, K)

derivative(x: ndarray, t: float, u: ndarray, s: ndarray) ndarray

Compute the derivative of the analog system.

Specifically, produces the state derivative

\(\dot{\mathbf{x}}(t) = \mathbf{A} \mathbf{x}(t) + \mathbf{B} \mathbf{u}(t) + \mathbf{\Gamma} \mathbf{s}(t)\)

as a function of the state vector \(\mathbf{x}(t)\), the given time \(t\), the input signal value \(\mathbf{u}(t)\), and the control contribution value \(\mathbf{s}(t)\).

Parameters
  • x (array_like, shape=(N,)) – the state vector evaluated at time t.

  • t (float) – the time t.

  • u (array_like, shape=(L,)) – the input signal vector evaluated at time t.

  • s (array_like, shape=(M,)) – the control contribution evaluated at time t.

Returns

the derivative \(\dot{\mathbf{x}}(t)\).

Return type

array_like, shape=(N,)

eta2(BW)

Compute the eta2 parameter of the system.

Parameters

BW (float) – bandwidth of the system

Returns

eta2 parameter of the system at bandwidth BW

Return type

float

homogenius_solution()

Compute the symbolic homogenious solution

This is done by analytically computing the matrix exponential

\(\exp(\mathbf{A} t)\)

Returns

the resulting matrix expression.

Return type

sympy.Matrix

signal_observation(x: ndarray) ndarray

Computes the signal observation for a given state vector \(\mathbf{x}(t)\) evaluated at time \(t\).

Specifically, returns

\(\mathbf{y}(t)=\mathbf{C}^\mathsf{T} \mathbf{x}(t)\)

Parameters

x (array_like, shape=(N,)) – the state vector.

Returns

the signal observation.

Return type

array_like, shape=(N_tilde,)

symbolic_differential_equations(input: Function, dim: int, input_signal=True)

Organise system matrixes into ordinary differential equations

Parameters
  • input (sympy.Matrix) – the input function

  • dim (int) – the dimension of the input

  • input_signal (bool) – determine if it is a input signal or digital control that is to be computed, defaults to True (input signal not control).

Returns

  • [:py:class:`sympy:Eq] – the resulting symbolic system equations

  • [sympy:Function] – the functions for which the equations relate.

transfer_function_matrix(omega: ndarray, symbolic: bool = False, general=False) ndarray

Evaluate the analog signal transfer function at the angular frequencies of the omega array.

Specifically, evaluates

\(\mathbf{G}(\omega) = \mathbf{C}^\mathsf{T} \left(\mathbf{A} - i \omega \mathbf{I}_N\right)^{-1} \mathbf{B} + \mathbf{D}\)

for each angular frequency in omega where \(\mathbf{I}_N\) represents a square identity matrix of the same dimensions as \(\mathbf{A}\) and \(i=\sqrt{-1}\).

Parameters
  • omega (array_like, shape=(K,)) – an array_like object containing the angular frequencies for evaluation.

  • symbolic (bool, optional) – solve using symbolic methods, defaults to True.

  • general (bool, optional) – to return general transfer function or not, defaults to False.

Returns

the signal transfer function evaluated at K different angular frequencies.

Return type

array_like, shape=(N_tilde, L, K)

zpk(input=0)

return zero-pole-gain representation of system

Parameters
  • input – determine for which input (in case of L > 1) to compute zpk, defaults to 0.

  • int – determine for which input (in case of L > 1) to compute zpk, defaults to 0.

  • optional – determine for which input (in case of L > 1) to compute zpk, defaults to 0.

Returns

z,p,k the zeros, poles and gain of the system

Return type

array_like, shape=(?, ?, 1)