x 1
   vector OFFSETS giving a shift in the range [-MAXSHIFT,MAXSHIFT] for
   each row of WAVEFORMS.  If OFFSETS(k) is X, linear interpolation of
   WAVEFORMS(k,:) on an abcissa shifted by X samples will minimize the
   mean squared error between WAVEFORMS(k,:) and TEMPLATE.  

   If TEMPLATE is an 1 x T x D array and WAVEFORMS is an N x T x D array,
   ALIGNWAVEFORMS finds OFFSETS that minimize the mean squared error of
   simultaneously shifting all pages of WAVEFORMS for a given row by the
   same amount