This function implements the space-time speckle correlation [1] 
  technique. 
  Use as input data a matrix THSP  of M lines and NTIMES columns, that
  represents the intensity time evolution of M pixels in NTIMES samples.

  CORR(i,l) = corr( THSP(:,i) , THSP(:,i+l) ) 

  Correlation type 1:
  $corr(A,B)=\frac{E[AB]}{\sqrt{E[A^2]E[B^2]}}$

  Correlation type 2 (Pearson correlation):
  $corr(A,B)= \frac{E[(A-\mu_A)(B-\mu_B)]}{\sqrt{E[(A-\mu_A)^2]E[(B-\mu_B)^2]}}$

  $C(l) = \frac{1}{NTIMES/2}\sum\limits_{i=1}^{NTIMES/2} CORR(i,l)$, 

  [1] ZiJie Xu, Charles Joenathan, and Brij M. Khorana. 'Temporal and spatial 
      properties of the time-varying speckles of botanical specimens'. 
      In: Optical Engineering 34.5 (1995), pages 1487-1502. 

  After starting the main routine just type the following command at the
  prompt:
  C       = thsp2corr(THSP);
  C       = thsp2corr(THSP,2);
  [C L]   = thsp2corr(THSP);
  [C L]   = thsp2corr(THSP,2);
  
  Input:
  THSP is a integer 2D matrix that represents the time history speckle pattern (THSP). 
       This matrix can be obtained using the function THSP. It is necessary that the
       THSP matrix only has values between 0 and 255, the function does not
       verify. The function truncates values outside this  interval.
  TYPE [optional] indicates the type of correlation used. If TYPE=1 then it is used
       the correlation type 1, in other case, it is used the Pearson correlation.
       By default it is used the correlation type 1.

  Output: 
  C    is the correlation vector, with elements C(j) for all  0<=j<=NTIMES/2.
  L    is a vector with the times j of C(j). L=[0:NTIMES/2].


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

Package: bsltl