Main Content

wpfun

Wavelet packet functions

    Description

    wpfun is a wavelet packet analysis function.

    [wpws,x] = wpfun(wname,num) returns the num+1 wavelet packets associated with the wavelet wname on dyadic intervals of length 2–7. The wavelet packets are evaluated on the grid x.

    example

    [wpws,x] = wpfun(wname,num,prec) uses dyadic intervals of length 2prec.

    Examples

    collapse all

    Specify the db2 wavelet. Obtain the wavelet packets Wn, for n=0,,7, associated with the wavelet.

    wv = "db2";
    n = 7;
    [wpws,x] = wpfun(wv,7);

    Plot the wavelet packets

    tiledlayout(2,4)
    for k=0:n
        nexttile
        plot(x,wpws(k+1,:))
        title("n = "+num2str(k))
    end

    Figure contains 8 axes objects. Axes object 1 with title n = 0 contains an object of type line. Axes object 2 with title n = 1 contains an object of type line. Axes object 3 with title n = 2 contains an object of type line. Axes object 4 with title n = 3 contains an object of type line. Axes object 5 with title n = 4 contains an object of type line. Axes object 6 with title n = 5 contains an object of type line. Axes object 7 with title n = 6 contains an object of type line. Axes object 8 with title n = 7 contains an object of type line.

    Input Arguments

    collapse all

    Wavelet, specified as a character vector or string scalar. For more information, see wfilters.

    Index, specified as a nonnegative integer. The wpfun function returns num+1 wavelet packets.

    Data Types: double

    Length of the dyadic interval, specified as a positive integer. The length of the interval is 2prec.

    Data Types: double

    Output Arguments

    collapse all

    Wavelet packets, returned as a matrix. wpws has num+1 rows. The wavelet packets are stored row-wise as [W0; W1; … ; Wnum].

    Grid points where the wavelet packets are evaluated, returned as a real-valued vector.

    More About

    collapse all

    Generating Wavelet Packets

    The computation scheme for wavelet packets generation is easy when using an orthogonal wavelet. You start with the two filters of length 2N, denoted h(n) and g(n), corresponding to the wavelet.

    Next, by induction, define the following sequence of functions (Wn(x) , n = 0,1,2,…) by

    W2n(x)=2k=0,,2N1h(k)Wn(2xk)W2n+1(x)=2k=0,,2N1g(k)Wn(2xk)

    where W0(x) = ϕ (x) is the scaling function and W1(x) = ψ(x) is the wavelet function.

    For example, for the Haar wavelet you have

    N=1,h(0)=h(1)=12

    and

    g(0)=g(1)=12

    The equations become

    W2n(x)=Wn(2x)+Wn(2x1)

    and

    W2n+1(x)=Wn(2x)Wn(2x1)

    W0(x) = ϕ(x) is the haar scaling function and W1(x) = ψ(x) is the haar wavelet, both supported in [0,1].

    Then you can obtain W2 n by adding two 1/2-scaled versions of Wn with distinct supports [0,1/2] and [1/2,1], and obtain W2n+1 by subtracting the same versions of Wn.

    Starting from more regular original wavelets, using a similar construction, you obtain smoothed versions of this system of W-functions, all with support in the interval [0, 2N-1].

    References

    [1] Coifman, R.R., and M.V. Wickerhauser. “Entropy-Based Algorithms for Best Basis Selection.” IEEE Transactions on Information Theory 38, no. 2 (March 1992): 713–18. https://doi.org/10.1109/18.119732.

    [2] Jaffard, Stéphane, Yves Meyer, and Robert D. Ryan. Wavelets: Tools for Science & Technology. Philadelphia: Society for Industrial and Applied Mathematics, 2001.

    [3] Wickerhauser, M.V. "INRIA lectures on wavelet packet algorithms." Proceedings ondelettes et paquets d'ondes, 17–21 June 1991, Rocquencourt, France, pp. 31–99.

    [4] Wickerhauser, Mladen Victor. Adapted Wavelet Analysis from Theory to Software. Wellesley, MA: A.K. Peters, 1994.

    Version History

    Introduced before R2006a

    See Also

    |