The best-basis PWT (stands for "packet wavelet transform") is a form of a
discrete wavelet transform which picks a best representation of a signal from
some set of possible representations. By the word "best" I mean such a
representation for which the value of a special function, called the cost
function, is minimal. Currently, only one family of cost functions is
supported, which is a family of threshold cost functions. The threshold
cost functions have a parameter tr
and for every element x
in an array
its value is (if (< (abs x) tr) 0 1)
. The value of this functions for an
array is the sum of its values for every element of that array. So, PWT gives
such a representation of the input signal that the number of elements whose
magnitude is less than a threshold is as big as possible.
Like DWT, PWT produces an array with transformed signal, but also a key value used as hint to inverse functions to properly inverse the transform.
*threshold*
make-threshold-cost
.make-threshold-cost
(&optional (threshold *threshold*))
threshold
.pwt!
(array &key (wavelet haar) (boundary-style mirror) (cost *cost-func*))
Perform a best-basis PWT transform of an array
. Unlike DWT
which has a fixed basis of scaled and translated mother wavelet
functions and a scaling function, this transform picks the best basis,
minimizing the cost
function over possible results. The meaning of
wavelet
and boundary-style
arguments is the same as for DWT.
See the documentation for dwt!
for information.
Two values are returned: the first is a transformed array and the
second is a basis key object which must be passed to pwt-inverse!
or pwt-inverse
to invert the transform.
This function modifies its first argument.
pwt-inverse!
(array basis-key &key (wavelet haar) (boundary-style mirror))
array
and basis-key
must match the
values returned by pwt!
or pwt
. wavelet
and
boundary-style
must also match their counterparts used for the
forward transform.pwt
(array &key (wavelet haar) (boundary-style mirror) (cost *cost-func*))
pwt!
.pwt-inverse
(array basis-key &key (wavelet haar) (boundary-style mirror))
pwt-inverse!
.basis-key=>bit-vector
(basis-key)
pwt
or pwt!
to a bit
vector form.bit-vector=>basis-key
(vector)