# Defining Your Own Wavelet

You can define wavelets to plug into the wavelet analysis framework by using the correct template. A wavelet wave is of the form wfam[args], where wfam is the symbol that indicates the wavelet family and args provide any necessary specification.

In order to set wfam as a wavelet family recognized by the system, the property wfam[patt]["WaveletQ"] must be set to True, where patt is a pattern that matches acceptable arguments args.

 WaveletQ set to True if the symbol is a user wavelet

Wavelet initialization property.

Both orthogonal and biorthogonal user wavelets are supported. Orthogonal wavelets are indicated by setting the property wfam[args]["OrthogonalQ"] and, correspondingly, biorthogonal wavelets are set using the property wfam[args]["BiorthogonalQ"].

 "OrthogonalQ" set to True if the wavelet is orthogonal "BiorthogonalQ" set to True if the wavelet is biorthogonal

Wavelet properties.

To compute primal lowpass filter coefficients, the property wfam[args]["PrimalLowpass",prec] must be set; here prec indicates the precision of filter coefficients. Similarly, to compute dual lowpass filter coefficients, the property "DualLowpass" must be set. Both properties "PrimalLowpass" and "DualLowpass" are expected to return a list of the form , where is the index and is the corresponding filter coefficient. If a list of the form is returned, it is assumed that index starts from 0. An error message is generated if the filter coefficients are not numeric and indices are not integers.

## Examples

### Franklin Wavelet

Define a family of Franklin wavelets.

Initialize the wavelet:
 In:= Set properties:
 In:= Franklin wavelet coefficients are given by the integral:
 In:= In:= In:= The above definition of a user wavelet can now be used to perform various wavelet operations.

Compute the filter coefficients:
 In:= In:= Out= The scaling function is computed using the recursive equation , where represents the lowpass filter coefficients.

Compute the scaling function:
 In:= Out= Perform a wavelet transform:
 In:= Out= In:= Out= ### Legendre Wavelet

Following is an example of the Legendre wavelet.

Initialize the wavelet:
 In:= Although Legendre wavelets are not orthogonal, to be able to perform a wavelet transform, you need to set it to True:
 In:= Specify the function to compute lowpass filter coefficients:
 In:= Compute the filter coefficients:
 In:= Out= In:= Out= Compute the scaling function:
 In:= Out= The wavelet function is computed using the recursive equation , where represents the highpass filter coefficients.

Compute the wavelet function:
 In:= Out= Perform a wavelet transform:
 In:= Out= In:= Out= ### Le Gall Wavelet

Generate a Le Gall wavelet.

Initialize the wavelet:
 In:= Set properties:
 In:= In:= Define "PrimalLowpass" and "DualLowpass" properties:
 In:= In:= Use the Le Gall wavelet for thresholding.

 In:= Perform a StationaryWaveletTransform using a Le Gall wavelet:
 In:= Out= In:= Out= In:= Out= 