Daubechies wavelet - scaling and wavelet function in MATLAB

  • MATLAB
  • Thread starter sugaku
  • Start date
  • #1
17
0

Main Question or Discussion Point

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
 

Answers and Replies

Related Threads for: Daubechies wavelet - scaling and wavelet function in MATLAB

  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
1
Views
8K
  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
1
Views
2K
Replies
3
Views
23K
Replies
2
Views
535
Replies
4
Views
807
Replies
0
Views
3K
Top