function Yhat=hrf_conv(p,X);

% X should be of length 15, 0:2:28
% p = [peak, onset]; in sec

spmhrf = spm_hrf(2,[6 16 1 1 6 0 28]);
hrf_conv=conv(spmhrf,[1 1]);

peak =p(1);
%onset=p(2);

hrf_conv = peak * hrf_conv;

%if onset > 0
%   int_onset = abs(round(onset));
%	hrf_conv = [zeros(int_onset,1);hrf_conv(1:end-int_onset)];
%end

Yhat=hrf_conv(X/2+1);
