diamondback.transforms package

Submodules

diamondback.transforms.ComplexTransform module

Description

A complex transform converts a three-phase real signal to a complex signal, or converts a complex signal to a three-phase real signal, in equivalent and reversible representations. A neutral condition is specified.

Singleton.

\[\gamma = \scriptsize{ \matrix{ 1 & \frac{-1}{2} & \frac{-1}{2}\cr 0 & \frac{3^{0.5}}{2} & \frac{-3^{0.5}}{2}\cr 1 & 1 & 1 } }\]
\[\alpha = \matrix{\frac{1}{3}}^{0.5}\ e^{\ -j\ \frac{\pi}{6}\ }\]

Complex - Three-Phase.

\[y_{n} = \matrix{ x^{T}_{n}\ \gamma\ }\ \scriptsize{[\ \matrix{ 1 & j & 0 }\ ]^{T}}\]
\[\overline{\scriptsize{Neutral}}\ \qquad\longrightarrow\qquad y_{n} = y_{n}\ \alpha\]

Three-Phase - Complex.

\[\overline{\scriptsize{Neutral}}\ \qquad\longrightarrow\qquad x_{n} = \frac{x_{n}}{\alpha}\]
\[y_{n} = \matrix{\ \matrix{ \gamma^{T}\gamma }^{-1}\ \gamma^{T}\ \scriptsize{[\ \matrix{ real(\ x_{n}\ ) & imag(\ x_{n}\ ) & 0 }\ ]^{T}}}^{T}\]

Example

from diamondback import ComplexExponentialFilter, ComplexTransform
import numpy

x = ComplexExponentialFilter( 0.0 ).filter( numpy.linspace( -1.0e-4, 1.0e-4, 128 ) + 0.1 )

# Transform an incident signal, forward and inverse.

y = ComplexTransform.transform( x, neutral = True )
z = ComplexTransform.transform( y, neutral = True )
License

BSD-3C. © 2018 - 2024 Larry Turner, Schneider Electric Industries SAS. All rights reserved.

Author

Larry Turner, Schneider Electric, AI Hub, 2018-01-26.

class diamondback.transforms.ComplexTransform.ComplexTransform[source]

Bases: object

Complex transform.

COEFFICIENT = array([[0.666667, -0.333333, -0.333333],        [0.000000, 0.577350, -0.577350],        [0.666667, 0.666667, 0.666667]])
GAIN = (0.5-0.2886751345948128j)
classmethod transform(x: list | ndarray, neutral: bool = True) ndarray[source]

Transforms a real three-phase or complex incident signal into a complex or three-phase reference signal.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. neutral : bool.

Returns :

y : numpy.ndarray - reference signal.

diamondback.transforms.FourierTransform module

Description

A Fourier transform converts a real or complex discrete-time incident signal to a complex discrete-frequency reference signal, or a complex discrete-frequency incident signal to a real or complex discrete-time reference signal, in equivalent and reversible representations. A forward coefficient array is specified to define a window filter.

Singleton.

\[y_{k} = \frac{1}{N}\ \sum_{n = 0}^{N-1} b_{n} x_{n} e^{\frac{\ -j\ \pi\ k \ n}{N}} = \frac{1}{N}\ fft(\ x_{n}\ )\]
\[x_{n} = \frac{N}{b_{n}}\ \sum_{k = 0}^{N-1} y_{k} e^{\frac{\ j\ \pi\ k \ n}{N}} = \frac{N}{b_{n}}\ ifft(\ y_{k}\ )\]

A Fourier transform is normalized by incident signal length and forms a contiguous sequence corresponding to a linear and increasing normalized frequency.

\[f_{k} = -1\ + \ 2\ \frac{k}{N}\]

An incident signal length is inversely proportional to a normalized frequency resolution.

N = frac{2}{R}

Example

from diamondback import ComplexExponentialFilter, FourierTransform
import numpy

x = ComplexExponentialFilter( 0.0 ).filter( numpy.linspace( 0.12, 0.23, 128 ) ) * numpy.random.rand( 1 )[ 0 ]
b = WindowFilter( 'Hann', len( x ) - 1 ).b

# Transform an incident signal, forward and inverse.

y, f = FourierTransform.transform( x, b = b, inverse = False )
z = FourierTransform.transform( y, b = b, inverse = True )[ 0 ]
License

BSD-3C. © 2018 - 2024 Larry Turner, Schneider Electric Industries SAS. All rights reserved.

Author

Larry Turner, Schneider Electric, AI Hub, 2018-04-12.

class diamondback.transforms.FourierTransform.FourierTransform[source]

Bases: object

Fourier transform.

static transform(x: list | ndarray, b: list | ndarray, inverse: bool = False) Tuple[ndarray, ndarray][source]

Transforms a real or complex discrete-time incident signal to a complex discrete-frequency reference signal, or performs an inverse transform. Indices definition depends upon an inverse condition. Forward transform indices define normalized frequency. Inverse transform indices define an integral sequence.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. b : Union[ list, numpy.ndarray ] - forward coefficient. inverse : bool.

Returns :

y : numpy.ndarray - reference signal. f : numpy.ndarray - frequency normalized to Nyquist in [ -1.0, 1.0 ).

diamondback.transforms.PsdTransform module

Description

A Power Spectral Density (PSD) transform converts a real or complex discrete-time incident signal to a real discrete-frequency reference signal, which estimates an aggregate power spectrum of the incident signal relative to frequency. A forward coefficient array is specified to define a window filter.

Singleton.

A PSD transform is constructed by estimating a mean power from a collection of Fourier transforms of an incident signal, over a sliding window defined by a forward coefficient array which defines a window filter. An index specifies a sample interval, or a non-overlapping stride, between successive operations.

\[v_{i,k} = \frac{1}{N}\ \sum_{n = 0}^{N-1} b_{n} x_{n+i\ I} e^{ \frac{\ -j\ \pi\ k \ n}{N} }\]
\[y_{k} = \frac{1}{C}\ \sum_{i = 0}^{C-1} v_{i,k} v^{*}_{i,k}\]

A spectrogram may be electively defined such that the collection of Fourier transforms is preserved to construct a time frequency representation of the power spectrum.

A PSD transform is normalized by incident signal length and forms a contiguous sequence corresponding to a linear and increasing normalized frequency.

\[f_{k} = \ 2\ \frac{k}{N}\]

An incident signal length is inversely proportional to a normalized frequency resolution.

\[N = \frac{2}{R}\]

Example

from diamondback import ComplexExponentialFilter, PsdTransform
import numpy

x = ComplexExponentialFilter( 0.0 ).filter( numpy.linspace( 0.12, 0.23, 1024 ) ) * numpy.random.rand( 1 )[ 0 ]
b = WindowFilter( 'Hann', 128 - 1 ).b

# Transform an incident signal.

y, f = PsdTransform.transform( x, b = b, index = len( b ) // 2 )
License

BSD-3C. © 2018 - 2024 Larry Turner, Schneider Electric Industries SAS. All rights reserved.

Author

Larry Turner, Schneider Electric, AI Hub, 2018-04-13.

class diamondback.transforms.PsdTransform.PsdTransform[source]

Bases: object

PSD transform.

static transform(x: list | ndarray, b: list | ndarray, index: int, spectrogram: bool = False) Tuple[ndarray, ndarray][source]

Transforms a real or complex discrete-time incident signal to a real discrete-frequency reference signal.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. b : Union[ list, numpy.ndarray ] - forward coefficient. index : int. spectrogram : bool.

Returns :

y : numpy.ndarray - reference signal. f : numpy.ndarray - frequency normalized to Nyquist in [ 0.0, 1.0 ).

diamondback.transforms.WaveletTransform module

Description

A wavelet transform realizes a temporal spatial frequency transformation in the form of analysis and synthesis filters with a complementary frequency response, combined with downsampling and upsampling operations to facilitate frequency-dependent decomposition and reconstruction, consuming an incident signal and producing a reference signal.

Analysis decomposes an incident signal into segments with specified operation count, applying complementary low pass and high pass analysis filters to an incident signal, downsampling and discarding alternate samples, and concatenating the paths to produce a reference signal. Analysis is repeated on the low pass portion of a reference signal for each segment, with decomposition into regions of varying temporal resolution, and a specific spatial frequency range. An incident signal has one or two dimensions, and a length in each dimension which is unity or an integral multiple of 2**count.

\[y_{i,0:\frac{C}{2}-1} = \matrix{\downarrow(\ filter_{b_{A,L}}(\ x_{i,0:C-1}\ ),\ 2\ ) & y_{i,\frac{C}{2}:C-1} = \downarrow(\ filter_{b_{A,H}}(\ x_{i,0:C-1}\ ),\ 2\ ) & i \in \scriptsize{[\ 0,\ R\ )}}\]
\[y_{0:\frac{R}{2}-1,j} = \matrix{\downarrow(\ filter_{b_{A,L}}(\ x_{0:R-1,j}\ ),\ 2\ ) & y_{\frac{R}{2}:R-1,j} = \downarrow(\ filter_{b_{A,H}}(\ x_{0:R-1,j}\ ),\ 2\ ) & j \in \scriptsize{[\ 0,\ C\ )}}\]

Synthesis reconstructs an incident signal from a specified operation count, scaling and upsampling alternate samples, applying complementary low pass and high pass synthesis filters to a reference signal, and adding the constituents to produce an incident signal. Synthesis is repeated on the low pass portion of a reference signal for each segment, with reconstruction from regions of varying temporal resolution, and a specific spatial frequency range. A reference signal has one or two dimensions, and a length in each dimension which is unity or an integral multiple of 2**count.

\[x_{0:R-1,j} = \matrix{filter_{b_{S,L}}(\ 2\ \uparrow(\ y_{0:\frac{R}{2}-1,j},\ 2\ )\ ) ) + filter_{b_{S,H}}(\ 2\ \uparrow(\ y_{\frac{R}{2}:R-1,j},\ 2\ ) )\ ) & j \in \scriptsize{[\ 0,\ C\ )}}\]
\[x_{i,0:C-1} = \matrix{filter_{b_{S,L}}(\ 2\ \uparrow(\ y_{i,0:\frac{C}{2}-1},\ 2\ )\ ) + filter_{b_{S,H}}(\ 2\ \uparrow(\ y_{i,\frac{C}{2}:C-1},\ 2\ )\ ) & i \in \scriptsize{[\ 0,\ R\ )}}\]

Analysis filters and synthesis filters of a specified order are defined to satisfy specified constraints. A style and order are specified.

Style is in ( ‘Coiflet’, ‘Daubechies’, ‘Haar’, ‘Symmlet’ ).

  • ‘Coiflet’ is asymmetric, very high quality, with order in [ 5 : 29 : 6 ].
  • ‘Daubechies’ is asymmetric, high quality, with order in [ 3 : 19 : 2 ].
  • ‘Haar’ is symmetric, perfect reconstruction, with order in [ 1 ].
  • ‘Symmlet’ is nearly symmetric, high quality, with order in [ 7 : 19 : 2 ].

Example

from diamondback import WaveletTransform
import numpy

# Create an instance.

obj = WaveletTransform( style = 'Haar', order = 1 )

# Transform an incident signal, forward and inverse.

count = 3
x = numpy.random.rand( 2**( count + 3 ), 2**( count + 3 ) )
y = obj.transform( x, count, False )
z = obj.transform( y, count, True )
License

BSD-3C. © 2018 - 2024 Larry Turner, Schneider Electric Industries SAS. All rights reserved.

Author

Larry Turner, Schneider Electric, AI Hub, 2018-02-06.

class diamondback.transforms.WaveletTransform.WaveletTransform(style: str, order: int)[source]

Bases: object

Wavelet transform.

Initialize.

Arguments :

style : str - in ( ‘Coiflet’, ‘Daubechies’, ‘Haar’, ‘Symmlet’ ). order : int.

B = {'Coiflet': {5: array([-0.072699, 0.337885, 0.852557, 0.384854, -0.072729, -0.015655]), 11: array([0.016387, -0.041465, -0.067373, 0.386110, 0.812724, 0.417005,        -0.076489, -0.059434, 0.023680, 0.005611, -0.001823, -0.000721]), 17: array([-0.003794, 0.007783, 0.023453, -0.065772, -0.061123, 0.405177,        0.793777, 0.428483, -0.071800, -0.082302, 0.034555, 0.015881,        -0.009008, -0.002575, 0.001118, 0.000466, -0.000071, -0.000035]), 23: array([0.000892, -0.001629, -0.007346, 0.016069, 0.026682, -0.081267,        -0.056077, 0.415308, 0.782239, 0.434386, -0.066627, -0.096220,        0.039334, 0.025082, -0.015212, -0.005658, 0.003751, 0.001267,        -0.000589, -0.000260, 0.000062, 0.000031, -0.000003, -0.000002]), 29: array([-0.000212, 0.000359, 0.002178, -0.004159, -0.010131, 0.023408,        0.028168, -0.091920, -0.052043, 0.421566, 0.774290, 0.437992,        -0.062036, -0.105574, 0.041289, 0.032684, -0.019762, -0.009164,        0.006764, 0.002433, -0.001663, -0.000638, 0.000302, 0.000141,        -0.000041, -0.000021, 0.000004, 0.000002, -0.000000, -0.000000])}, 'Daubechies': {3: array([0.482963, 0.836516, 0.224144, -0.129410]), 5: array([0.332671, 0.806892, 0.459878, -0.135011, -0.085441, 0.035226]), 7: array([0.230378, 0.714847, 0.630881, -0.027984, -0.187035, 0.030841,        0.032883, -0.010597]), 9: array([0.160102, 0.603829, 0.724309, 0.138428, -0.242295, -0.032245,        0.077571, -0.006241, -0.012581, 0.003336]), 11: array([0.111541, 0.494624, 0.751134, 0.315250, -0.226265, -0.129767,        0.097502, 0.027523, -0.031582, 0.000554, 0.004777, -0.001073]), 13: array([0.077852, 0.396539, 0.729132, 0.469782, -0.143906, -0.224036,        0.071309, 0.080613, -0.038030, -0.016575, 0.012551, 0.000430,        -0.001802, 0.000354]), 15: array([0.054416, 0.312872, 0.675631, 0.585355, -0.015829, -0.284016,        0.000472, 0.128747, -0.017369, -0.044088, 0.013981, 0.008746,        -0.004870, -0.000392, 0.000675, -0.000117]), 17: array([0.038078, 0.243835, 0.604823, 0.657288, 0.133197, -0.293274,        -0.096841, 0.148541, 0.030726, -0.067633, 0.000251, 0.022362,        -0.004723, -0.004282, 0.001848, 0.000230, -0.000252, 0.000039]), 19: array([0.026670, 0.188177, 0.527201, 0.688459, 0.281172, -0.249846,        -0.195946, 0.127369, 0.093057, -0.071394, -0.029458, 0.033213,        0.003607, -0.010733, 0.001395, 0.001992, -0.000686, -0.000116,        0.000094, -0.000013])}, 'Haar': {1: array([1.000000, 1.000000])}, 'Symmlet': {7: array([-0.075766, -0.029636, 0.497619, 0.803739, 0.297858, -0.099220,        -0.012604, 0.032223]), 9: array([0.019539, -0.021102, -0.175328, 0.016602, 0.633979, 0.723408,        0.199398, -0.039134, 0.029519, 0.027333]), 11: array([0.015404, 0.003491, -0.117990, -0.048312, 0.491056, 0.787641,        0.337929, -0.072638, -0.021060, 0.044725, 0.001768, -0.007801]), 13: array([0.002682, -0.001047, -0.012636, 0.030516, 0.067893, -0.049553,        0.017441, 0.536102, 0.767764, 0.288630, -0.140047, -0.107808,        0.004010, 0.010268]), 15: array([0.001890, -0.000303, -0.014952, 0.003809, 0.049137, -0.027219,        -0.051946, 0.364442, 0.777186, 0.481360, -0.061273, -0.143294,        0.007607, 0.031695, -0.000542, -0.003382]), 17: array([0.001401, 0.000620, -0.013272, -0.011528, 0.030225, 0.000583,        -0.054569, 0.238761, 0.717897, 0.617338, 0.035272, -0.191551,        -0.018234, 0.062078, 0.008859, -0.010264, -0.000473, 0.001069]), 19: array([0.000770, 0.000096, -0.008641, -0.001465, 0.045927, 0.011610,        -0.159494, -0.070881, 0.471691, 0.769510, 0.383827, -0.035537,        -0.031990, 0.049995, 0.005765, -0.020355, -0.000804, 0.004593,        0.000057, -0.000459])}}
STYLE = ('Coiflet', 'Daubechies', 'Haar', 'Symmlet')
property b
transform(x: list | ndarray, count: int, inverse: bool = False) ndarray[source]

Transforms an incident signal and produces a reference signal, performing analysis or synthesis operations. Incident and reference signals have two dimensions. Dimension lengths must be unity or an integral multiple of 2**count.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. count : int. inverse : bool.

Returns :

y : numpy.ndarray - reference signal.

diamondback.transforms.ZTransform module

Description

A z transform converts a continuous s-domain differential equation to a discrete z-domain difference equation as a function of a recursive coefficient array and a forward coefficient array of a specified order. A normalized frequency and bilinear condition are specified.

Singleton.

\[y_{n} = \sum_{i = 1}^{N} a_{i} y_{n-i} + \sum_{i = 0}^{N} b_{i} x_{n-i} = \sum_{i = 1}^{N} (\ a_{i} b_{0} + b_{i}\ ) s_{i,n} + b_{0} x_{n}\qquad a_{0} = 0\]

A frequency response is expressed as a function of a recursive coefficient array and a forward coefficient array, in s-domain and z-domain.

\[H_{s,n} = \frac{\sum_{i = 0}^{N} v_{i} s^{N-i}}{{\sum_{i = 0}^{N} u_{i} s^{N-i}}}\]
\[H_{z,n} = \frac{\sum_{i = 0}^{N} b_{i} z^{-i}}{{1 - \sum_{i = 1}^{N} a_{i} z^{-i}}}\]

Example

from diamondback import ZTransform
import math
import numpy

frequency, order, ripple = 0.1, 2, 0.125
u = numpy.array( [ numpy.exp( 1j * math.pi * x / ( 2.0 * order ) ) for x in range( 1, 2 * order, 2 ) ] )
v = math.asinh( 1.0 / ( ( 10.0 ** ( 0.1 * ripple ) - 1.0 ) ** 0.5 ) ) / order
a = ( numpy.poly( ( -math.sinh( v ) * u.imag + 1j * math.cosh( v ) * u.real ) * 2.0 * math.pi ) ).real
a /= a[ -1 ]

# Transform z-domain coefficients with s-domain coefficients, frequency, and bilinear.

a, b = ZTransform.transform( a = a, b = [ 1.0 ], frequency = frequency, bilinear = True )

# Define zeros and normalize gain.

b = numpy.poly( -numpy.ones( order ) )
b = b * ( 1.0 - sum( a ) ) / sum( b )
License

BSD-3C. © 2018 - 2024 Larry Turner, Schneider Electric Industries SAS. All rights reserved.

Author

Larry Turner, Schneider Electric, AI Hub, 2018-01-26.

class diamondback.transforms.ZTransform.ZTransform[source]

Bases: object

Z transform realizes continuous s-domain to discrete z-domain transformation, through application of bilinear or impulse invariant methods.

static transform(u: list | ndarray, v: list | ndarray, frequency: float, bilinear: bool = True) Tuple[ndarray, ndarray][source]

Transforms continuous s-domain coefficient arrays and produces discrete z-domain coefficient arrays.

Arguments :

u : Union[ list, numpy.ndarray ] - recursive coefficient, s-domain. v : Union[ list, numpy.ndarray ] - forward coefficient, s-domain. frequency : float - frequency in ( 0.0, inf ). bilinear : bool.

Returns :

a : numpy.ndarray - recursive coefficient, z-domain. b : numpy.ndarray - forward coefficient, z-domain.

Module contents

Description

Initialize.

License

BSD-3C. © 2018 - 2024 Larry Turner, Schneider Electric Industries SAS. All rights reserved.

Author

Larry Turner, Schneider Electric, AI Hub, 2018-03-22.

class diamondback.transforms.ComplexTransform[source]

Bases: object

Complex transform.

COEFFICIENT = array([[0.666667, -0.333333, -0.333333],        [0.000000, 0.577350, -0.577350],        [0.666667, 0.666667, 0.666667]])
GAIN = (0.5-0.2886751345948128j)
classmethod transform(x: list | ndarray, neutral: bool = True) ndarray[source]

Transforms a real three-phase or complex incident signal into a complex or three-phase reference signal.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. neutral : bool.

Returns :

y : numpy.ndarray - reference signal.

class diamondback.transforms.FourierTransform[source]

Bases: object

Fourier transform.

static transform(x: list | ndarray, b: list | ndarray, inverse: bool = False) Tuple[ndarray, ndarray][source]

Transforms a real or complex discrete-time incident signal to a complex discrete-frequency reference signal, or performs an inverse transform. Indices definition depends upon an inverse condition. Forward transform indices define normalized frequency. Inverse transform indices define an integral sequence.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. b : Union[ list, numpy.ndarray ] - forward coefficient. inverse : bool.

Returns :

y : numpy.ndarray - reference signal. f : numpy.ndarray - frequency normalized to Nyquist in [ -1.0, 1.0 ).

class diamondback.transforms.PsdTransform[source]

Bases: object

PSD transform.

static transform(x: list | ndarray, b: list | ndarray, index: int, spectrogram: bool = False) Tuple[ndarray, ndarray][source]

Transforms a real or complex discrete-time incident signal to a real discrete-frequency reference signal.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. b : Union[ list, numpy.ndarray ] - forward coefficient. index : int. spectrogram : bool.

Returns :

y : numpy.ndarray - reference signal. f : numpy.ndarray - frequency normalized to Nyquist in [ 0.0, 1.0 ).

class diamondback.transforms.WaveletTransform(style: str, order: int)[source]

Bases: object

Wavelet transform.

Initialize.

Arguments :

style : str - in ( ‘Coiflet’, ‘Daubechies’, ‘Haar’, ‘Symmlet’ ). order : int.

B = {'Coiflet': {5: array([-0.072699, 0.337885, 0.852557, 0.384854, -0.072729, -0.015655]), 11: array([0.016387, -0.041465, -0.067373, 0.386110, 0.812724, 0.417005,        -0.076489, -0.059434, 0.023680, 0.005611, -0.001823, -0.000721]), 17: array([-0.003794, 0.007783, 0.023453, -0.065772, -0.061123, 0.405177,        0.793777, 0.428483, -0.071800, -0.082302, 0.034555, 0.015881,        -0.009008, -0.002575, 0.001118, 0.000466, -0.000071, -0.000035]), 23: array([0.000892, -0.001629, -0.007346, 0.016069, 0.026682, -0.081267,        -0.056077, 0.415308, 0.782239, 0.434386, -0.066627, -0.096220,        0.039334, 0.025082, -0.015212, -0.005658, 0.003751, 0.001267,        -0.000589, -0.000260, 0.000062, 0.000031, -0.000003, -0.000002]), 29: array([-0.000212, 0.000359, 0.002178, -0.004159, -0.010131, 0.023408,        0.028168, -0.091920, -0.052043, 0.421566, 0.774290, 0.437992,        -0.062036, -0.105574, 0.041289, 0.032684, -0.019762, -0.009164,        0.006764, 0.002433, -0.001663, -0.000638, 0.000302, 0.000141,        -0.000041, -0.000021, 0.000004, 0.000002, -0.000000, -0.000000])}, 'Daubechies': {3: array([0.482963, 0.836516, 0.224144, -0.129410]), 5: array([0.332671, 0.806892, 0.459878, -0.135011, -0.085441, 0.035226]), 7: array([0.230378, 0.714847, 0.630881, -0.027984, -0.187035, 0.030841,        0.032883, -0.010597]), 9: array([0.160102, 0.603829, 0.724309, 0.138428, -0.242295, -0.032245,        0.077571, -0.006241, -0.012581, 0.003336]), 11: array([0.111541, 0.494624, 0.751134, 0.315250, -0.226265, -0.129767,        0.097502, 0.027523, -0.031582, 0.000554, 0.004777, -0.001073]), 13: array([0.077852, 0.396539, 0.729132, 0.469782, -0.143906, -0.224036,        0.071309, 0.080613, -0.038030, -0.016575, 0.012551, 0.000430,        -0.001802, 0.000354]), 15: array([0.054416, 0.312872, 0.675631, 0.585355, -0.015829, -0.284016,        0.000472, 0.128747, -0.017369, -0.044088, 0.013981, 0.008746,        -0.004870, -0.000392, 0.000675, -0.000117]), 17: array([0.038078, 0.243835, 0.604823, 0.657288, 0.133197, -0.293274,        -0.096841, 0.148541, 0.030726, -0.067633, 0.000251, 0.022362,        -0.004723, -0.004282, 0.001848, 0.000230, -0.000252, 0.000039]), 19: array([0.026670, 0.188177, 0.527201, 0.688459, 0.281172, -0.249846,        -0.195946, 0.127369, 0.093057, -0.071394, -0.029458, 0.033213,        0.003607, -0.010733, 0.001395, 0.001992, -0.000686, -0.000116,        0.000094, -0.000013])}, 'Haar': {1: array([1.000000, 1.000000])}, 'Symmlet': {7: array([-0.075766, -0.029636, 0.497619, 0.803739, 0.297858, -0.099220,        -0.012604, 0.032223]), 9: array([0.019539, -0.021102, -0.175328, 0.016602, 0.633979, 0.723408,        0.199398, -0.039134, 0.029519, 0.027333]), 11: array([0.015404, 0.003491, -0.117990, -0.048312, 0.491056, 0.787641,        0.337929, -0.072638, -0.021060, 0.044725, 0.001768, -0.007801]), 13: array([0.002682, -0.001047, -0.012636, 0.030516, 0.067893, -0.049553,        0.017441, 0.536102, 0.767764, 0.288630, -0.140047, -0.107808,        0.004010, 0.010268]), 15: array([0.001890, -0.000303, -0.014952, 0.003809, 0.049137, -0.027219,        -0.051946, 0.364442, 0.777186, 0.481360, -0.061273, -0.143294,        0.007607, 0.031695, -0.000542, -0.003382]), 17: array([0.001401, 0.000620, -0.013272, -0.011528, 0.030225, 0.000583,        -0.054569, 0.238761, 0.717897, 0.617338, 0.035272, -0.191551,        -0.018234, 0.062078, 0.008859, -0.010264, -0.000473, 0.001069]), 19: array([0.000770, 0.000096, -0.008641, -0.001465, 0.045927, 0.011610,        -0.159494, -0.070881, 0.471691, 0.769510, 0.383827, -0.035537,        -0.031990, 0.049995, 0.005765, -0.020355, -0.000804, 0.004593,        0.000057, -0.000459])}}
STYLE = ('Coiflet', 'Daubechies', 'Haar', 'Symmlet')
property b
transform(x: list | ndarray, count: int, inverse: bool = False) ndarray[source]

Transforms an incident signal and produces a reference signal, performing analysis or synthesis operations. Incident and reference signals have two dimensions. Dimension lengths must be unity or an integral multiple of 2**count.

Arguments :

x : Union[ list, numpy.ndarray ] - incident signal. count : int. inverse : bool.

Returns :

y : numpy.ndarray - reference signal.

class diamondback.transforms.ZTransform[source]

Bases: object

Z transform realizes continuous s-domain to discrete z-domain transformation, through application of bilinear or impulse invariant methods.

static transform(u: list | ndarray, v: list | ndarray, frequency: float, bilinear: bool = True) Tuple[ndarray, ndarray][source]

Transforms continuous s-domain coefficient arrays and produces discrete z-domain coefficient arrays.

Arguments :

u : Union[ list, numpy.ndarray ] - recursive coefficient, s-domain. v : Union[ list, numpy.ndarray ] - forward coefficient, s-domain. frequency : float - frequency in ( 0.0, inf ). bilinear : bool.

Returns :

a : numpy.ndarray - recursive coefficient, z-domain. b : numpy.ndarray - forward coefficient, z-domain.