% Compute the correlation coefficient between spike trains % p1 and p2 over a window of size tau; % dt is the binsize % cc=corr_coeff(p1,p2,tau,dt) function cc=corr_coeff(p1,p2,tau,dt) % The correlation coefficient can be computed using % the covariance and variance coefficients cc=cov_coeff(p1,p2,tau,dt)/sqrt(var_coeff(p1,tau,dt)*var_coeff(p2,tau,dt));