Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Daubechies wavelet - scaling and wavelet function in MATLAB

  1. Apr 19, 2009 #1
    Hi everybody,

    I'm trying to reproduce daubechies basic building graph and daubechies wavelet function graph (φ(r)=0 if r≦0 or 3≦r). And i found this algorithm. I would appreciate if there is anybody could help me to understand the function defined below as function [s,w] = cascade(n,cs,cw). Especially how does the convolution takes place. Thank you in advance.

    >%Filter coefficients for daub4 (h<->scaling, g<->wavelet)
    >h = [1+sqrt(3) 3+sqrt(3) 3-sqrt(3) 1-sqrt(3)]/(4*sqrt(2));
    >g = [h(4) -h(3) h(2) -h(1)];
    >
    >%Calculate 5 iterations of the cascade algorithm
    >[s,w]=cascade(5,h,g);

    >plot(s); %Plot scaling function
    >plot(w); %Plot wavelet function

    -----------------------------------------------------------
    >function [s,w] = cascade(n,cs,cw)
    >
    > s = cs;
    > w = cw;
    > x2(1:2:length(w)*2) = w;
    > x2(2:2:end)=0;
    > x(1:2:length(s)*2) = s;
    > x(2:2:end)=0;
    >
    > for i = 1:n
    >
    > s = conv(x,cs);
    > w = conv(x2,cs);
    >
    > x2(1:2:length(w)*2) = w;
    > x2(2:2:end)=0;
    > x(1:2:length(s)*2) = s;
    > x(2:2:end)=0;
    >
    > end
    >
    >end
     
  2. jcsd
  3. May 9, 2009 #2
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Daubechies wavelet - scaling and wavelet function in MATLAB
  1. Wavelets on Matlab (Replies: 1)

  2. Matlab functions (Replies: 0)

  3. Matlab functions (Replies: 0)

  4. MATLAB function (Replies: 1)

Loading...