MATLAB Daubechies wavelet - scaling and wavelet function in MATLAB

Click For Summary
The discussion focuses on reproducing the Daubechies wavelet and scaling function graphs in MATLAB using a specific algorithm. The user seeks clarification on the function defined as [s,w] = cascade(n,cs,cw), particularly regarding the convolution process involved. The provided filter coefficients for the Daubechies wavelet (daub4) are outlined, and the user shares their approach to calculating iterations of the cascade algorithm. The conversation highlights the importance of understanding convolution in the context of wavelet transformations. The MathWorks documentation is suggested as a potential resource for further assistance.
sugaku
Messages
16
Reaction score
0
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
 
Physics news on Phys.org

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
2
Views
2K