This is the class and function reference of pyrwt. Please refer to the tutorial for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.
Computes the discrete wavelet transform y for a 1D or 2D input signal x using the scaling filter h0 and wavelet filter h1.
Parameters : | x : array-like, shape = [n] or [m, n]
h0 : array-like, shape = [n]
h1 : array-like, shape = [n]
L : integer, optional (default=None)
|
---|---|
Returns : | y : array-like, shape = [n] or [m, n]
L : integer
|
See also
idwt, rdwt, irdwt
Examples
2D Example:
>>> from scipy.misc import lena
>>> from rwt import dwt, idwt
>>> from rwt.utilities import makeSignal
>>> from rwt.wavelets import daubcqf
>>> img = lena()
>>> h0, h1 = daubcqf(4, 'min')
>>> L = 1
>>> y, L = dwt(img, h0, h1, L)
Computes the inverse discrete wavelet transform x for a 1D or 2D input signal y using the scaling filter h0 and wavelet filter h1.
Parameters : | y : array-like, shape = [n] or [m, n]
h0 : array-like, shape = [n]
h1 : array-like, shape = [n]
L : integer, optional (default=None)
|
---|---|
Returns : | x : array-like, shape = [n] or [m, n]
L : integer
|
See also
dwt, rdwt, irdwt
Examples
1D Example:
>>> from rwt import dwt, idwt
>>> from rwt.utilities import makeSignal
>>> from rwt.wavelets import daubcqf
>>> xin = makeSignal('LinChirp', 8)
>>> h0, h1 = daubcqf(4, 'min')
>>> L = 1
>>> y, L = dwt(xin, h0, h1, L)
>>> print y
[0.1912, 0.8821, 1.4257, 0.3101, -0.0339, 0.1001, 0.2201, 0.0000]
>>> x, L = idwt(y, h, L)
>>> print x
[0.0491, 0.1951, 0.4276, 0.7071, 0.9415, 0.9808, 0.6716, 0.0000]
Computes the redundant discrete wavelet transform y for a 1D or 2D input signal. (Redundant means here that the sub-sampling after each stage is omitted.) yl contains the lowpass and yh the highpass components. In the case of a 2D signal, the ordering in yh is [lh hl hh lh hl ... ] (first letter refers to row, second to column filtering).
Parameters : | x : array-like, shape = [n] or [m, n]
h0 : array-like, shape = [n]
h1 : array-like, shape = [n]
L : integer, optional (default=None)
|
---|---|
Returns : | yl : array-like, shape = [n] or [m, n]
yh : array-like, shape = [n] or [m, n]
L : integer
|
Warning
min(x.shape)/2**L should be greater than len(h)
See also
dwt, idwt, irdwt
Computes the inverse redundant discrete wavelet transform x for a 1D or 2D input signal. (Redundant means here that the sub-sampling after each stage of the forward transform has been omitted.) yl contains the lowpass and yl the highpass components as computed, e.g., by mrdwt. In the case of a 2D signal, the ordering in yh is [lh hl hh lh hl ... ] (first letter refers to row, second to column filtering).
Parameters : | yl : array-like, shape = [n] or [m, n]
yh : array-like, shape = [n] or [m, n]
h0 : array-like, shape = [n]
h1 : array-like, shape = [n]
L : integer
|
---|---|
Returns : | x : array-like, shape = [n] or [m, n]
L : integer
|
Warning
min(yl.shape)/2**L should be greater than len(h)
See also
dwt, idwt, rdwt
Computes the discrete wavelet transform over signal x along a specified axis using the scaling filter h0, and wavelet filter h1.
Parameters : | x : array-like, shape = Arbitrary dimension
h0 : array-like, shape = [n]
h1 : array-like, shape = [n]
axis : integer, optional (default=0)
L : integer, optional (default=None)
|
---|---|
Returns : | y : array-like, shape = Same dimension of x.
L : integer
|
See also
idwt, rdwt, irdwt, idwtaxis
Computes the inverse discrete wavelet transform over signal x along a specified axis using the scaling filter h0, and wavelet filter h1.
Parameters : | y : array-like, shape = Arbitrary dimension
h0 : array-like, shape = [n]
h1 : array-like, shape = [n]
axis : integer, optional (default=0)
L : integer, optional (default=None)
|
---|---|
Returns : | x : array-like, shape = Same dimension of x.
L : integer
|
See also
idwt, rdwt, irdwt, dwtaxis
Hard thresholds the input signal y with the threshold value thld.
Parameters : | y : array-like, shape = Arbitrary dimension
thld : float
|
---|---|
Returns : | x : array-like, shape = Same dimension of y
|
See also
Examples
>>> from rwt.utilities import makeSignal, hardThreshold
>>> y = makeSignal('WernerSorrows', 8)
>>> print hardThreshold(y, thld=1)
[1.5545, 5.3175, 0, 1.6956, -1.2678, 0, 1.7332, 0]
Soft thresholds the input signal y with the threshold value thld.
Parameters : | y : array-like, shape = Arbitrary dimension
thld : float
|
---|---|
Returns : | x : array-like, shape = Same dimension as y
|
See also
Examples
>>> from rwt.utilities import makeSignal, hardThreshold
>>> y = makeSignal('Doppler', 8)
>>> print softThreshold(y, thld=0.2)
[0, 0, 0, -0.0703, 0, 0.2001, 0.0483, 0]
Creates artificial test signal identical to the standard test signals proposed and used by D. Donoho and I. Johnstone in WaveLab (- a matlab toolbox developed by Donoho et al. the statistics department at Stanford University).
Parameters : | signal_name : string, optional (default=’AllSig’)
N : integer, optional (default=512)
|
---|---|
Returns : | x : array/list of arrays, shape = [N] |
References
WaveLab can be accessed at www_url: http://playfair.stanford.edu/~wavelab/ Also see various articles by D.L. Donoho et al. at web_url: http://playfair.stanford.edu/