This function implements the Generalized Difference Technique [1]. Use as
  input data a 3D matrix created grouping NTIMES intensity matrices I(k)
  1<=k<=NTIMES

  I(k)=DATA(:,:,k)

  $GD=\sum\limits_{k=1}^{NTIMES-1} \sum\limits_{l=1}^{NTIMES-k} |I(k)-I(k+l)|$

  The function is normalized  with the number of elements in the sum.

  $Y=\frac{GD}{\binom{NTIMES}{2}}$

  Where $\binom{NTIMES}{2}$ is the binomial coefficient of NTIMES and 
  2. It is the number of combinations of NTIMES items taken 2 at a time.
  Thus Y matrix represents the expected value of absolute difference 
  $|I(k1)-I(k2)|$ for any two different k1 and k2 values.

  $Y\approx E[|I(k1)-I(k2)|]$

  Reference:
  [1] ARIZAGA, R. et al. Display of the local activity using dynamical speckle 
      patterns. Optical Engineering, Redondo Beach, v. 41, n. 2, p. 287-294, 
      June 2002.


  After starting the main routine just type the following command at the
  prompt:
  Y = gendiff(DATA);
    
  Input:
  DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES 
       intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then
       N(1,1) represents NLIN and
       N(1,2) represents NCOL and
       N(1,3) represents NTIMES.
  SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result.

  Output:
  Y    returns the Generalized Difference matrix.


  For help, bug reports and feature suggestions, please visit:
  http://nongnu.org/bsltl

Package: bsltl