src/Level1/Exponential.cc
/* The analog derivative exponential function in GAMMA is

                          d  [  i(W+iR)t]        i(W+iR)t
   [1]            E'(t) = -- [ e        ] = -it*e
                          dW
  
   where the derivative is taken with respect to the frequency W.  Both the
   oscillation frequency W and the decay rate R will typically have units 1/sec
   This derivative exponential is a Fourier transform pair with a complex
   derivative Lorentzian. Whereas the derivative of the normal exponential will
   produce a Lorentzian centered at frequency W with a half-height linewidth
   of 2*R, the differential exponential's transform will produce a differential
   Lorentzian that crosses the axis at W and whose peak-to-peak linewidth is
   given by 2*R/sqrt(3).  Note that unless R is non-negative the derivative
   exponential will blow up at large t.

   Since we can't output anything but a discrete representation of this function
   we must know the number of points and the total time the differential 
   exponential lasts for proper scaling.  For point k, k=[0,npts), we have
 
                          i(W+iR)t
   [2]        E' = -it * e        k  where      t = k*(time/npts-1) = k*tinc
               k      k                          k

   Alternatively, we could input our W and R values in 1/pt.  The equation then
   is
                                         i*(w+iR)k
   [3]                        E = -ik * e         
                               k      
  
   The problem with this form is that we have to suffer in relating it to 
   the Lorenzian produced from its Fourier transform.  The transform likes 
   things in radians as well and we'll need conversion factors if we wish to
   use [3] with respect to it's Lorentzian (Fourier Transform Pair).  So, if
   users need a quick picture of a decaying differential exponential use the
   simple function that deals in points.  For most purposes, you'll be better
   off using the overloaded form in which you explicitly state input units.  */
The analog derivative exponential function in GAMMA is
d  [  i(W+iR)t]        i(W+iR)t
[1]            E'(t) = -- [ e        ] = -it*e
dW



Since we can't output anything but a discrete representation of this function
we must know the number of points and the total time the differential
exponential lasts for proper scaling.  For point k, k=[0,npts), we have



Alternatively, we could input our W and R values in 1/pt.  The equation then
is
i*(w+iR)k
[3]                        E = -ik * e
k

The problem with this form is that we have to suffer in relating it to
the Lorenzian produced from its Fourier transform.  The transform likes
things in radians as well and we'll need conversion factors if we wish to
use [3] with respect to it's Lorentzian (Fourier Transform Pair).  So, if
users need a quick picture of a decaying differential exponential use the
simple function that deals in points.  For most purposes, you'll be better
off using the overloaded form in which you explicitly state input units.
The analog derivative exponential function in GAMMA is d [ i ( W + iR ) t ] i ( W + iR ) t [ 1 ] E ' ( t ) = -- [ e ] = - it * e dW Since we can ' t output anything but a discrete representation of this function we must know the number of points and the total time the differential exponential lasts for proper scaling . For point k k = [ 0 npts ) we have Alternatively we could input our W and R values in 1 / pt . The equation then is i * ( w + iR ) k [ 3 ] E = - ik * e k The problem with this form is that we have to suffer in relating it to the Lorenzian produced from its Fourier transform . The transform likes things in radians as well and we ' ll need conversion factors if we wish to use [ 3 ] with respect to it ' s Lorentzian ( Fourier Transform Pair ) . So if users need a quick picture of a decaying differential exponential use the simple function that deals in points . For most purposes you ' ll be better off using the overloaded form in which you explicitly state input units .
row_vector DExponential(int npts, double W, double R)
  {
  row_vector data(npts);                        
  complex expon(-R,W);				
  complex efact = exp(expon);			
  complex evalue = complex1; 			
  data.put(complex0, 0);			
  for(int i=1; i<npts; i++)			
    {
    evalue *= efact;				
    data.put(complex(0,-double(i))*evalue, i);	
    }
  return data;
  }
row_vector DExponential ( int npts , double W , double R ) { row_vector data ( npts ) ; complex expon ( - R , W ) ; complex efact = exp ( expon ) ; complex evalue = complex1 ; data . put ( complex0 , 0 ) ; for ( int i = 1 ; i < npts ; i ++ ) { evalue *= efact ; data . put ( complex ( 0 , - double ( i ) ) * evalue , i ) ; } return data ; }
The analog derivative exponential function in GAMMA is
d  [  i(W+iR)t]        i(W+iR)t
[1]            E'(t) = -- [ e        ] = -it*e
dW
The analog derivative exponential function in GAMMA is d [ i ( W + iR ) t ] i ( W + iR ) t [ 1 ] E ' ( t ) = -- [ e ] = - it * e dW
// Input        npts    : Block size in pts //              W       : Exponential frequency (1/pt) //              R	: Decay rate (1/pt) // Output       data    : Derivative exponential with oscillation //			  frequency W and decay rate R // Note			: We have no relationship between time and //			  point increment, so all input in pt & 1/pt //			  i.e. implements [3] above // Data block for return // Exponent term i(w+iR) // Exponential increment // Start with value of 0 // Initial point is 1 // Loop through points // Increment in complex plane // Store this value