function c=conv(b,a)
%CONV  convolution.

[ib bjunk] = size(b);
[ia ajunk] = size(a);

if(ib==1)
   if(ia~=1)
     a=a';
   end
end
if(ia==1)
   if(ib~=1)
     a=a';
   end
end


if(ib==1),ib=bjunk;end
if(ia==1),ia=ajunk;end


if(ia>ib)
	error(' the second array is the smaller one ')
end

if(ia<ib)
	a(ia:ib)=ia:ib;
	a(ia:ib)=a(ia:ib)*0.;
end
	

% Convolution by fft

c = real( ifft( fft(a).*fft(b) ) );

