Source code for the computation of the benchmark metric: Circular Variance
float circular_variance_tuning_curve(r,theta,n,theta_max) float *r; // response amplitude [n] float *theta; // angle 0..theta_max (deg) [n] int n; // number of data points float theta_max; // e.g., 360.0 for dir, 180.0 for ori { int i; float tot,x,y,cv,tm2pi; tm2pi = 2.0 * M_PI / theta_max; tot = x = y = 0.0; for(i=0;i<n;i++){ tot += amp[i]; x += amp[i] * cos(tm2pi * theta[i]); y += amp[i] * sin(tm2pi * theta[i]); } cv = 1.0 - sqrt(x*x + y*y) / tot; return cv; }