. 

   OFFSETS = ALIGNWAVEFORMS(TEMPLATE,WAVEFORMS) uses MAXSHIFT = 1.

   [OFFSETS,ALIGNED] = ALIGNWAVEFORMS(TEMPLATE,WAVEFORMS,...) also
   returns an N x (T-2*MAXSHIFT) x D matrix ALIGNED in which the rows of
   WAVEFORMS have been shifted using linear interpolation by the amounts
   given in OFFSETS.  Note that ALIGNED has 2*MAXSHIFT fewer columns than
   WAVEFORMS since the interpolation operation invalidates edge samples.

   The algorithm used in ALIGNWAVEFORMS actually shifts the TEMPLATE
   wavefor