function s = to_signed(u)
  
  %%% was in read_bb.m
  
s = u;
ineg = u > 32767;
s(ineg) = s(ineg) - 65536;
ibad = s == -32768;
s(ibad) = NaN;

