function y = b2y(b) % converts 0-1 boolean to +/- 1 y = 2*b - 1; return