Function: ptpfundual
PTPFUNDUAL Sampled, periodized dual TP function of finite type
  Usage: gd=ptpfundual(w,a,M,L)
         gd=ptpfundual({w,width},a,M,L)
         gd=ptpfundual(...,inc)
         [gd,nlen]=ptpfundual(...)

  Input parameters:
        w      : Vector of reciprocals w_j=1/delta_j in Fourier representation of g*
        width  : Integer stretching factor for the essential support
        a      : Length of time shift.
        M      : Number of channels.
        L      : Window length.
        inc    : Extension parameter

  Output parameters:
        gd    : The periodized totally positive function dual window.
        nlen  : Number of non-zero elements in gd.

  PTPFUNDUAL(w,a,M,L) computes samples of a dual window of totally
  positive function of finite type >=2 with weights w. Please see
  PTPFUN for definition of totally positive functions.
  The lattice parameters a,M must satisfy M > a to ensure the
  system is a frame.

  PTPFUNDUAL({w,width},a,M,L) works as above but in addition the width*
  parameter determines the integer stretching factor of the original TP
  function. For explanation see help of PTPFUN.

  PTPFUNDUAL(...,inc) or PTPFUNDUAL(...,'inc',inc) works as above, 
  but integer inc denotes number of additional columns to compute window
  function gd. 'inc'-many are added at each side. It should be smaller 
  than 100 to have comfortable execution-time. The higher the number the 
  closer gd is to the canonical dual window.
  The default value is 10.

  [gd,nlen]=PTPFUNDUAL(...) as gd might have a compact support,
  nlen contains a number of non-zero elements in gd. This is the case
  when gd is symmetric. If gd is not symmetric, nlen is extended
  to twice the length of the longer tail.

  If nlen = L, gd has a 'full' support meaning it is a periodization
  of a dual TP function.

  If nlen < L, additional zeros can be removed by calling
  gd=middlepad(gd,nlen).

  Examples:
  ---------

  The following example compares dual windows computed using 2 different
  approaches.:

    w = [-3,-1,1,3];a = 25; M = 31; inc = 10;
    L = 1e6; L = dgtlength(L,a,M);
    width = M;

    % Create the window
    g = ptpfun(L,w,width);

    % Compute a dual window using pebfundual
    tic
    [gd,nlen] = ptpfundual({w,width},a,M,L,inc);
    ttpfundual=toc;

    % We know that gd has only nlen nonzero samples, lets shrink it.
    gd = middlepad(gd,nlen);

    % Compute the canonical window using gabdual
    tic
    gdLTFAT = gabdual(g,a,M,L);
    tgabdual=toc;

    fprintf('PTPFUNDUAL elapsed time %f sn',ttpfundual);
    fprintf('GABDUAL elapsed time    %f sn',tgabdual);

    % Test on random signal
    f = randn(L,1);

    fr = idgt(dgt(f,g,a,M),gd,a,numel(f));
    fprintf('Reconstruction error PTPFUNDUAL: %en',norm(f-fr)/norm(f));

    fr = idgt(dgt(f,g,a,M),gdLTFAT,a,numel(f));  
    fprintf('Reconstruction error GABDUAL:    %en',norm(f-fr)/norm(f));


  References:
    K. Groechenig and J. Stoeckler. Gabor frames and totally positive
    functions. Duke Math. J., 162(6):1003--1031, 2013.
    
    S. Bannert, K. Groechenig, and J. Stoeckler. Discretized Gabor frames of
    totally positive functions. Information Theory, IEEE Transactions on,
    60(1):159--169, 2014.
    
    T. Kloos and J. Stockler. Full length article: Zak transforms and gabor
    frames of totally positive functions and exponential b-splines. J.
    Approx. Theory, 184:209--237, Aug. 2014. [1]http ]
    
    T. Kloos. Gabor frames total-positiver funktionen endlicher ordnung.
    Master's thesis, University of Dortmund, Dortmund, Germany, 2012.
    
    References
    
    1. http://dx.doi.org/10.1016/j.jat.2014.05.010
    

Url: http://ltfat.github.io/doc/fourier/ptpfundual.html

See also: dgt, idgt, ptpfun.

Package: ltfat