Diff of /filterbank/filterbanktight.m [80bb6b] .. [34f3ea] Maximize Restore

  Switch to side-by-side view

--- a/filterbank/filterbanktight.m
+++ b/filterbank/filterbanktight.m
@@ -27,19 +27,30 @@
   L=ceil(longestfilter/lcm_a)*lcm_a;
 end;
 
+[g,info]=filterbankwin(g,a,L,'normal');
+M=info.M;
+
 if all(a==a(1))
   % Uniform filterbank, use polyphase representation
+  if isempty(L)
+      error('%s: You need to specify L.',upper(mfilename));
+  end;
+
   a=a(1);
-  
-  G=zeros(L,M,assert_classname(g{1}));
-  for ii=1:M
-    G(:,ii)=fft(fir2long(g{ii},L));
+
+  % G1 is done this way just so that we can determine the data type.
+  G1=comp_transferfunction(g{1},L);
+  thisclass=assert_classname(G1);
+  G=zeros(L,M,thisclass);
+  G(:,1)=G1;
+  for ii=2:M
+    G(:,ii)=comp_transferfunction(g{ii},L);
   end;
   
   N=L/a;
   
-  H=zeros(a,M,assert_classname(g{1}));
-  gt=zeros(N,M,assert_classname(g{1}));
+  H=zeros(a,M,thisclass);
+  gt=zeros(N,M,thisclass);
   
   for w=0:N-1
     idx = mod(w-(0:a-1)*N,L)+1;
@@ -59,7 +70,7 @@
   
   gtout=cell(1,M);
   for m=1:M
-    gtout{m}=cast(gt(:,m),assert_classname(g{1}));
+    gtout{m}=cast(gt(:,m),thisclass);
   end;
   
 else