cl-wavelets ยป Best-basis PWT

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*
Default value for an argument to make-threshold-cost.
make-threshold-cost(&optional (threshold *threshold*))
Make a cost function which depends on the number of items whose magnitude is greater than 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))
Inverse the PWT. The 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*))
This function is a non-destructive version of pwt!.
pwt-inverse(array basis-key &key (wavelet haar) (boundary-style mirror))
This is a non-destructive version of pwt-inverse!.
basis-key=>bit-vector(basis-key)
Transform a basis key returned from pwt or pwt! to a bit vector form.
bit-vector=>basis-key(vector)
Transform a bit vector to a basis key.