www.pudn.com > convolutive.rar > demix.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function y = demix(Wt,x)
% this is very slow, better would be something
% like overlap-save, see Haykin or Oppenheim/Schaefer
% it is assumed that size(Wt) = [ds dx T]
% size(x) = [?? ds]
[ds dx T] = size(Wt);
[rx cx] = size(x);
% check for consistency
if ds ~= cx
error('Wt and x must fit together')
end
% allocate memory for y
y = zeros(rx,ds);
% do the convolution using matlab's built-in filter
for ii = 1:ds
for jj = 1:dx
y(:,ii) = y(:,ii) + filter(Wt(ii,jj,:),1,x(:,jj));
end
end