function Y = filterC(H,X)
% Y = filterC(H,X)
%  convolves H with X, preserving length of X
%  H is assumed to be an causal filter 

H = H(:);        
L_h  = length(H);
L_x  = size(X,1);
trials = size(X,2);
N    =  2^ceil(log(L_h+L_x)/log(2));
HH = fft(H,N);
HH = HH*ones(1,trials);       
XX = fft(X,N);
Y  = real(ifft(XX.*HH));
Y  = Y(1:L_x,:);  