Diff of /frames/frame.m [931198] .. [3ddab0] Maximize Restore

  Switch to side-by-side view

--- a/frames/frame.m
+++ b/frames/frame.m
@@ -371,11 +371,54 @@
     
   case {'fwt'}
     F.J=varargin{2};
-    F.g=fwtinit(varargin{1});
+    F.g=fwtinit(fwtinit(varargin{1}));
+    F.red= 1/(F.g.a(1)^(F.J)) + sum(1./(F.g.a(1).^(0:F.J-1))*sum(1./F.g.a(2:end)));
     F.frana=@(insig) fwt(insig,F.g,F.J);
-    F.frsyn=@(insig) ifwt(insig,F.g,F.J,size(insig,1));
+    F.frsyn=@(insig) ifwt(insig,F.g,F.J,size(insig,1)/F.red);
     F.length=@(Ls) fwtlength(Ls,F.g,F.J);
-    
+  case {'wfbt'}
+    F.g=wfbtinit(varargin{1});
+    F.coef2native = @(coef,s) wavpack2cell(coef,wfbtclength(s,F.g));
+    F.native2coef = @(coef) wavcell2pack(coef);
+    F.red = sum(1./treeSub(F.g));
+    F.frana=@(insig) F.native2coef(wfbt(insig,F.g));
+    F.frsyn=@(insig) iwfbt(F.coef2native(insig,size(insig,1)/F.red),F.g,size(insig,1)/F.red);
+    F.length=@(Ls) wfbtlength(Ls,F.g);
+  case {'wpfbt'}
+    F.g=wfbtinit(varargin{1});
+    F.coef2native = @(coef,s) wavpack2cell(coef,...
+                    s./cell2mat(cellfun(@(aEl) aEl(:),...
+                    reshape(nodeSub(nodesBForder(F.g),F.g),[],1),'UniformOutput',0)));
+    F.native2coef = @(coef) wavcell2pack(coef);
+    F.red = sum(cellfun(@(aEl) sum(1./aEl),nodeSub(nodesBForder(F.g),F.g)));
+    F.frana=@(insig) F.native2coef(wpfbt(insig,F.g));
+    F.frsyn=@(insig) iwpfbt(F.coef2native(insig,size(insig,1)/F.red),F.g,size(insig,1)/F.red);
+    F.length=@(Ls) wfbtlength(Ls,F.g);
+  case {'ufwt'}
+    F.J=varargin{2};
+    F.g=fwtinit(fwtinit(varargin{1}));
+    F.coef2native = @(coef,s) reshape(coef,[s(1)/(F.J*(numel(F.g.a)-1)+1),F.J*(numel(F.g.a)-1)+1,s(2)]);
+    F.native2coef = @(coef) reshape(coef,[size(coef,1)*size(coef,2),size(coef,3)]);
+    F.frana=@(insig) F.native2coef(ufwt(insig,F.g,F.J));
+    F.frsyn=@(insig) iufwt(F.coef2native(insig,size(insig)),F.g,F.J);
+    F.length=@(Ls) Ls;
+    F.red=(F.J*(numel(F.g.a)-1)+1);
+  case {'uwfbt'}
+    F.g=wfbtinit(varargin{1});
+    F.red = noOfOutputs(F.g);
+    F.coef2native = @(coef,s) reshape(coef,[s(1)/F.red,F.red,s(2)]);
+    F.native2coef = @(coef) reshape(coef,[size(coef,1)*size(coef,2),size(coef,3)]);
+    F.frana=@(insig) F.native2coef(uwfbt(insig,F.g));
+    F.frsyn=@(insig) iuwfbt(F.coef2native(insig,size(insig)),F.g);
+    F.length=@(Ls) Ls;
+  case {'uwpfbt'}
+    F.g=wfbtinit(varargin{1});
+    F.red = sum(cellfun(@(fEl) numel(fEl.filts),F.g.nodes));
+    F.coef2native = @(coef,s) reshape(coef,[s(1)/F.red,F.red,s(2)]);
+    F.native2coef = @(coef) reshape(coef,[size(coef,1)*size(coef,2),size(coef,3)]);
+    F.frana=@(insig) F.native2coef(uwpfbt(insig,F.g));
+    F.frsyn=@(insig) iuwpfbt(F.coef2native(insig,size(insig)),F.g);
+    F.length=@(Ls) Ls;
   otherwise
     error('%s: Unknows frame type: %s',upper(mfilename),ftype);