# doc-cache created by Octave 4.2.0
# name: cache
# type: cell
# rows: 3
# columns: 7
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
datapack_conv


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1100

  This function implements a convolution for each pixel of datapack. 

  It convolves each pixel of signal with the function H of M elements, 
  so that if 
  H    = [h0 h1 h2 ... h(M-1)]
  then its Z transform is:
  M2=floor(M/2);
  $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ...  h(M-1) Z^{+M2-(M-1)}$ 

  Thus H represents an impulse response with sample zero in h(M2).

  After starting the main routine just type the following command at the
  prompt:
  DATAOUT = datapack_conv(DATA,H)
  
  Input:
  DATA   is a 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.
  H      is a vector, where H represents a non-causal FIR filters centered in h(M2).

  
  Output:
  DATAOUT  is obtained from the output of H FIR filter, in non-causal form, 
           where its input is each pixel of datapack. 
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69

  This function implements a convolution for each pixel of datapack.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
firfilterbank


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2664

  This function implements a filter bank for each pixel of a datapack. 

  This function uses two FIR filters (H0 and H1) of order (M-1) in non-causal 
  form, so that if 
  H    = [h0 h1 h2 ... h(M-1)]
  then its Z transform is:
  M2=floor(M/2);
  $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ...  h(M-1) Z^{+M2-(M-1)}$ 

  The function implements some modes
  
  MODE0: This mode uses two FIR filters (H0 and H1), thus it can accept {H0} or 
         {H0 , H1} as input parameter. If only the H0 filter is delivered as  
         input parameter, then the H1 filter is calculated as
         the complement filter of H0. $H1[Z]= 1-H0[Z]$. 
         
  MODE2: This mode uses two FIR filters (H0 and H1), and it only can accept {H0} 
         as input parameter; H1 filter is calculated as the quadrature mirror 
         filter of H0. $H1[Z]= H0[-Z]$. At end the, there will be a 
         down-sampler by 2.
         This mode is commonly used with H0 as low pass FIR filter with cut-off 
         in pi/2 (for a 2*pi normalized frequency range). In order to have a perfect reconstruction
         it is necessary that $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B.


  After starting the main routine just type the following command at the
  prompt:
  [DATA0 DATA1] = firfilterbank(DATA,FILTER,MODE);
  [DATA0 DATA1] = firfilterbank(DATA,H0,'MODE2');
  [DATA0 DATA1] = firfilterbank(DATA,H0,'MODE0');
  [DATA0 DATA1] = firfilterbank(DATA,[H0;H1],'MODE0');
  
  Input:
  DATA   is a 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.
  FILTER is a matrix (with 2 lines) or a vector, where FILTER=H0 or FILTER=[H0;H1].
         H0 and H1 represent two FIR filters.
         FILTER=H0 is used in the mode 'MODE2', by other side FILTER=H0 or FILTER=[H0;H1] 
         can be used in the mode 'MODE0'.
  MODE   is the type of analysis selected of a filter bank. It can be 'MODE0' or 
         'MODE2'.
  
  Output:
  DATA0  is obtained from the output of H0 FIR filter, in non-causal form, 
         with input each pixel of datapack. If the mode used have a 
         down-sampler after filtering, then DATA0 is the output of down-sampler.
  DATA1  is obtained after the output of H1 FIR filter, in non-causal form, 
         with input each pixel of datapack. If the mode used have a 
         down-sampler after filtering, then DATA1 is the output of down-sampler.
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71

  This function implements a filter bank for each pixel of a datapack.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
firsynthesisbank


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2466

  This function makes a step to synthesis filter bank for each pixel
  of datapacks DATA0 and DATA1. It uses up-samplers in your inputs and
  after FIR filters (G0 and G1) of order (M-1) in non-causal form. If
  H0    = [h0 h1 h2 ... h(M-1)]
  then your Z transform is:
  M2=floor(M/2);
  $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ...  h(M-1) Z^{+M2-(M-1)}$ 

  The function accepts the filter H0 as input parameter, so that the filters 
  G0 and G1  are calculated as $G0[Z]=H0[Z]$ and $G1[Z]= -H0[-Z]$. 
  H0 should be a low pass FIR filter with cut-off in pi/2 
  (for a 2*pi normalized frequency range) and, DATA0 and DATA1 the outputs of
  an step of a filter bank, as in the function firfilterbank() in MODE='MODE2'.
  In order to get a perfect reconstruction it is necessary that 
  $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B.

  
  After starting the main routine just type the following command at the
  prompt:
  DATA=firsynthesisbank(DATA0,DATA1,H0);
  
  Input:
  DATA0  is a speckle data pack. Where DATA0 is a 3D matrix created grouping NTIMES 
         intensity matrices with NLIN lines and NCOL columns. When N=size(DATA0), then
         N(1,1) represents NLIN and
         N(1,2) represents NCOL and
         N(1,3) represents NTIMES.
         DATA0 is obtained after the down-sampler of output of H0 FIR filter in 
         a step of a filter bank with low-pass filter H0.
         DATA0 and DATA1 should have the same size.
  DATA1  is a speckle data pack. Where DATA1 is a 3D matrix created grouping NTIMES 
         intensity matrices with NLIN lines and NCOL columns. When N=size(DATA1), then
         N(1,1) represents NLIN and
         N(1,2) represents NCOL and
         N(1,3) represents NTIMES.
         DATA1 is obtained after the down-sampler of output of H1 FIR filter in 
         a step of a filter bank with low-pass filter H0.
         DATA1 and DATA0 should have the same size.
  H0     is a vector with the parameters of a FIR filter. H0 should be a low 
         pass filter with cut-off in pi/2 (for a 2*pi normalized frequency range).
         In order to ger a perfect reconstruction it is necessary that 
         $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B.
  
  Output:
  DATA   is a synthesis of speckle datapacks DATA0 and DATA1. The number of images
         inside DATA is twice of the number of images of DATA0 and DATA1.
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80

  This function makes a step to synthesis filter bank for each pixel
  of datap



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
firsynthesispath


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2065

  This function makes a synthesis of a path in a filter bank, for each pixel
  of datapack DATA. 

  It uses in cascade of reconstruction blocks Bi with i=1 to i=L=length(SEQ). 
  Each reconstruction block Bi is formed by:
  1) up-sampler by 2
  2) gain of 2
  3) Gj FIR FILTER, so that j=SEQ(L+1-i)

  The function accepts the filter H0 as input parameter, so that the filters 
  G0 and G1  are calculated as $G0[Z]=H0[Z]$ and $G1[Z]= -H0[-Z]$.
  If
  H0    = [h0 h1 h2 ... h(M-1)]
  then your Z transform is:
  M2=floor(M/2);
  $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ...  h(M-1) Z^{+M2-(M-1)}$ 
 
  H0 should be a low pass FIR filter with cut-off in pi/2 
  (for a 2*pi normalized frequency range).
  In order to get a perfect reconstruction it is necessary that 
  $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^C$ for any A and C.

  
  After starting the main routine just type the following command at the
  prompt:
  DATAOUT=firsynthesispath(DATA,H0,SEQ);
  
  Input:
  DATA   is a speckle data pack. Where DATA is a 3D matrix created grouping NTIMES 
         intensity matrices with NLIN lines and NCOL columns. When N=size(DATA0), then
         N(1,1) represents NLIN and
         N(1,2) represents NCOL and
         N(1,3) represents NTIMES.
         DATA is obtained after the down-sampler of output of H0 FIR filter in 
         a step of a filter bank with low-pass filter H0.
  H0     is a vector with the parameters of a FIR filter. H0 should be a low 
         pass filter with cut-off in pi/2 (for a 2*pi normalized frequency range).
         In order to get a perfect reconstruction is necessary that 
         $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B.
  SEQ    is a vector with binary values. These values indicates the path
         in the decomposition scheme used to get the datapack DATA.
  
  Output:
  DATAOUT is a synthesis of the speckle datapack DATA. The number of images
          inside DATAOUT is 2^{L=length(SEQ)} times of the number of images of DATA.
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80

  This function makes a synthesis of a path in a filter bank, for each pixel
  



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
freqmod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 924
 This function returns the modulus of frequency response of function H.
 Frequently H will be a FIR filter.

  If  H    = [h0 h1 h2 ... h(M-1)] then your Z transform is:
  M2=floor(M/2);
  $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ...  h(M-1) Z^{+M2-(M-1)}$ 
  and the function return $AH=|H[Z=e^{jW}]|$ for W from 0 to pi.


  After starting the main routine just type the following command at the
  prompt:
  AH=freqmod(H,N)
  [AH FREQN]=freqmod(H,N);
  
  Input:
  H     is a vector with the parameters of H function. 
  N     is the number of analysis points in the frequency response.
  Output:
  AH     is the modulus of frequency response of function H. 
         $AH=|H[Z=e^{jW}]|$ for W from 0 to pi.
  FREQN  [OPTIONAL] is the normalized frequency of points in AH, thus for the 
         point AH(id) we have W=FREQN(id)*pi.
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
 This function returns the modulus of frequency response of function H.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
qmfmaker


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 837

  This function returns a vector with the parameters of a FIR filter with cut-off 
  in pi/2 (for a 2*pi normalized frequency range). The function tries to fulfill 
  $D[Z] = H^2[Z]-H^2[-Z] = A Z^B$ for any A and B.

  After starting the main routine just type the following command at the
  prompt:
  H=qmfmaker(ORDER);
  
  Input:
  ORDER  is the order of H=[h0 h1 ... h(ORDER)] FIR filter that try fulfill 
         $D[Z] = H^2[Z]-H^2[-Z] = A Z^B$ for any A and B.
         The number of elements of FIR filter must be even 
         and consequently the ORDER should be odd.
  Output:
  H     is a vector with the parameters of a FIR filter. H is a low pass 
         filter with cut-off in pi/2 (for a 2*pi normalized frequency range).
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80

  This function returns a vector with the parameters of a FIR filter with cut-o



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
qmfmirror


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1139
  This function returns the vector H1, the quadrature mirror filter 
  of H0. If  H0 = [h0 h1 h2 ... h(M-1)] then your Z transform is:
  M2=floor(M/2);
  $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ...  h(M-1) Z^{+M2-(M-1)}$ 
  and
  $H1[Z]=H0[-Z]$

  Additionally, the function returns $|D[Z=e^{i*W}]|$, where $D[Z] = H0^2[Z]-H0^2[-Z]$
  for W from 0 to pi.
 

  After starting the main routine just type the following command at the
  prompt:
  H1=qmfmirror(H0);
  [H1 AD]=qmfmirror(H0);
  [H1 AD]=qmfmirror(H0,N);
  [H1 AD FREQN]=qmfmirror(H0);
  [H1 AD FREQN]=qmfmirror(H0,N);
  
  Input:
  H0     is a vector with the parameters of a FIR filter.
  N      [Optional] is the number of analyzed points in AD.
  Output:
  H1     is the quadrature mirror filter of H0. H0[Z]=H1[-Z]
  AD     [Optional] is a modulus of $D[Z=e^{i*W}]$, where $D[Z] = H0^2[Z]-H0^2[-Z]$.
         The number of analyzed points in AD is equal to N.
  FREQN  [Optional] is the normalized frequency of points in AD, thus for the 
         point AD(id) we have W=FREQN(id)*pi.
  

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
  This function returns the vector H1, the quadrature mirror filter 
  of H0.





