%bebas_examP
load Y
%yy=bloch(200,:);
%load BSUV
Par=8;%input('spline order; ?')
Dep=6;%input('depth of decomp; ?')
[t ,ly]=size(yy);
x=1:ly/2;
fq=abs(fft(yy));
 %[wvtran wctran fwvtran,entro,ener]=spl13_WP_anal(yy,Par,Dep);
 [wvtran, wctran, entro,ener]=spl_WP_analP(yy,Par,Dep);
  dd=Dep+1;
 figure;
 subplot(dd,1,1)
 plot(x,fq(x),'LineWidth',2);ylabel('\fontsize{16}DFT')

 axis([1,ly/2,0,5])
 for kk=Dep:-1:1
 a=ener{kk+1};
 subplot(dd,1,dd-kk+1)
 bar(a)
  axis([1,2^kk,0,.3])
 ylabel(['\fontsize{14}Lev' int2str(kk)])
 end
 

 
[ListBB]=WP_BB_Listree1D_P(entro) 
m=min(ListBB(:,1));
M=max(ListBB(:,1));
Mm=M-m+1;
nn=1;
  figure;
 subplot(Mm+1,1,nn)
 plot(x,fq(x),'LineWidth',3);ylabel('\fontsize{20}DFT')
 axis([1,ly/2,0,5])
 for kk=m:M
     nn=nn+1;
 a=ener{kk+1};
 [te,he]=size(a);
 b=zeros(size(a));
 f=find(ListBB(:,1)==kk);
 ff=ListBB(f,2)+1;
 b(ff)=a(ff);
 subplot(Mm+1,1,nn)
 bar(0:he-1,b)
  axis([0,2^kk-1,0,.3])
 ylabel(['\fontsize{20}Lev' int2str(kk)])
 end
 % Copyright (c) 2013. Valery A. Zheludev