function X=fir2snd(A,u)
% fir2snd - Generate sound by applying FIR filters to a noise grain
%
% fir2snd ::
%    [[N,L]]              ~'array of M FIR filters of length N',
%    ([[M]] | seq([[M]])) ~'noise grain or sequence of noise grains'
% -> [[abs(M-N)+1,L]]       ~'columns of filtered noise'.

n=size(A,1);
l=size(A,2);
m=size(u,1);

% want to extract the valid portion of the convolution only
if m>n, seg=n:m;
else seg=m:n; end

if ~isseq(u), u=repeat(u); end

X=zeros(length(seg),l);
for k=1:l
	x=conv(A(:,k),head(u));
	X(:,k)=x(seg);
	u=next(u);
end


