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

                                         i*(w+iR)t
   [1]                           E(t) = e
  
   where w is the oscillation frequency and R is the decay rate, both in 1/sec.
   This exponential is a Fourier transform pair with a complex Lorentzian that
   is centered at freqency w and has a half-height linewidth of 2*R.  Note that
   unless R is non-negative the 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 exponential lasts
   for proper scaling.  For point k, k=[0,npts), we have 

                      i*(w+iR)t
   [2]           E = e         k     where      t = k*(time/npts-1) = k*tinc
                  k                              k

   Alternatively, we could input our w and R values in 1/pt.  The equation then
   is
                                   i*(w+iR)k
   [3]                        E = 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 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 your input units.           */
The analog exponential function in GAMMA is
i*(w+iR)t
[1]                           E(t) = e



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 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 = 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 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 your input units.
The analog exponential function in GAMMA is i * ( w + iR ) t [ 1 ] E ( t ) = e 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 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 = 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 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 your input units .
row_vector Exponential(int npts, double W, double R)
  {
  row_vector data(npts);                        
  complex expon(-R,W);				
  complex efact = exp(expon);			
  complex evalue = complex1; 			
  data.put(evalue, 0);				
  for(int i=1; i<npts; i++)			
    {
    evalue *= efact;				
    data.put(evalue, i);			
    }
  return data;
  }
row_vector Exponential ( int npts , double W , double R ) { row_vector data ( npts ) ; complex expon ( - R , W ) ; complex efact = exp ( expon ) ; complex evalue = complex1 ; data . put ( evalue , 0 ) ; for ( int i = 1 ; i < npts ; i ++ ) { evalue *= efact ; data . put ( evalue , i ) ; } return data ; }
The analog exponential function in GAMMA is
i*(w+iR)t
[1]                           E(t) = e
The analog exponential function in GAMMA is i * ( w + iR ) t [ 1 ] E ( t ) = e
// Input        npts    : Block size in pts //              W       : Exponential frequency (1/pt) //              R	: Decay rate (1/pt) // Output       data    : 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 1 // Initial point is 1 // Loop through points // Increment in complex plane // Store this value