FILTERBANK - Wrapper around filter to multiple filters

Program code:

function out=filterbank(b,a,insig,hopsize)

%   AUTHOR : Peter L. Soendergaard

% ------ Checking of input parameters ---------

error(nargchk(3,4,nargin));

if nargin==3
  hopsize=1;
end;

nchannels=size(b,1);

L=size(insig,1);
W=size(insig,2);

outlen=ceil(L/hopsize);

out=zeros(outlen,nchannels,W);

for ii=1:nchannels
  res = filter(b(ii,:),a(ii,:),insig);
  res = res(1:hopsize:L,:);
  out(:,ii,:) = reshape(res,outlen,1,W);
end;