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

  Switch to side-by-side view

--- a/filterbank/filterbankrealtight.m
+++ b/filterbank/filterbankrealtight.m
@@ -20,27 +20,37 @@
   error('%s: Too few input parameters.',upper(mfilename));
 end;
 
-[a,M,longestfilter,lcm_a]=assert_filterbankinput(g,a);
-
 definput.keyvals.L=[];
 [flags,kv,L]=ltfatarghelper({'L'},definput,varargin);
 
-if isempty(L)
-  L=ceil(longestfilter/lcm_a)*lcm_a;
+[g,info]=filterbankwin(g,a,L,'normal');
+M=info.M;
+
+if (~isempty(L)) && (L~=filterbanklength(L,a))
+    error(['%s: Specified length L is incompatible with the length of ' ...
+           'the time shifts.'],upper(mfilename));
 end;
 
 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;
 
-  gt=zeros(N,M,assert_classname(g{1}));
+  gt=zeros(N,M,thisclass);
   
   for w=0:N-1
     idx_a = mod(w-(0:a-1)*N,L)+1;
@@ -61,7 +71,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