Compute an optimal wavelet basis for vector data:
The best basis is stored in the resulting
DiscreteWaveletData object:
Show the coefficient array corresponding to each index in the basis:
Wavelet packet transforms give a
DiscreteWaveletData object that includes a default basis:
The basis includes all coefficients at the highest level of refinement:
WaveletBestBasis gives a new
DiscreteWaveletData object with a different, optimal basis:
Compute best basis for packet transforms with any number of levels of refinement:
Compute wavelet basis, minimizing log-energy for an image:
Compare default basis with best basis in a hierarchical grid layout of coefficient images:
Compute best basis with custom cost function:
Choose basis with fewest coefficients lying between -1 and 1:
Count values lying between -1 and 1 in default basis:
Best basis:
WaveletBestBasis gives the optimal basis among all possible wavelet bases:
Recursively enumerate all possible wavelet bases for

levels of refinement:
Show the 5 possible wavelet bases for 2 levels of refinement:
The number of possible bases grows extremely quickly as a function of refinement level:
Cost value of optimal basis:
Distribution of cost values of a random sample of 1000 bases:
Apply cost functions to coefficients with fixed total energy:
Plot cost as a function of first component energy

for

:

:

:

:
In general, each cost function can lead to a different best basis:
Plot distribution of energy among best basis coefficient values for each cost function:
Different cost functions often lead to similar best bases:
Define a custom cost function that favors coefficients that are nearer to integers:
Best basis for list data using custom cost function:
The computed cost value for the

coefficient is the custom cost value of the original data:
Cost value of the best basis coefficients:
The best basis coefficients are clustered around integers:
Reproduce the built-in cost functions as custom ones:

:

:

:

: