/*****************************************************************************/
/******************** EPSIM: Error Propagation SIMulator *********************/
/*****************************************************************************/
This program takes time values from an input file, generates a set of
sinusoidal waves of amplitudes, frequencies and phases given in a parameter
file, using the time values from the input file. Then random Gaussian noise
is added to the dataset. A least squares algorithm computes the parameters
amplitude, frequency and phase of the noisy dataset. Wrapping a loop around
this procedure allows to analyze a vast number of noisy datasets. The output
is an expectation and rms for the three parameters of the trigonometric fit.
The parameter file shall contain the frequencies, amplitudes and phases (in
this order) of all sinusoidal waves.
For convenience, a set of noise levels may be given. They are stored in a noise
file.
The phase angle has to be given in units of period, i.e. it attains values
between 0 and 1.
The formula to generate the sinusoidal waves is
f(t) = amplitude * sin [2 * pi * (frequency * time + phase)].
The output file is updated after each cycle of the loop, so that the user may
savely stop the computation by hitting Ctrl+C at any time.
The maximum number of processes is the maximum number of noise datasets to be
generated and analyzed by the program. If this maximum number is set zero, an
infinite loop is processed, waiting for the user to stop the program manually,
i.e. by pressing Ctrl+C.
An additional parameter is the Gaussian quality. The program uses the random
number generator to produce Gaussian random numbers by means of the central
limit theorem. The number of iterations is the argument.
For the computation of the least-squares fit, a step width for each parameter
has to be specified. It is a measure for the tolerance of the computations.
Since EPSIM is supposed to maintain the quality of approximations for a variety
of amplitudes and noise levels within a single run, these parameters are scaled
to signal and noise according to the following relations:
freq_spacing = freq_spacing_param * noise / (last_time - first_time) / amp
amp_spacing = amp_spacing_param * noise
phase_spacing = phase_spacing_param * noise / amp
In these relations, "noise" denotes the current value from the noise file,
"(last_time - first_time)" is the total time interval, and "amp" is the
amplitude of the component under consideration, as specified in the parameters
file. Please be sure that your time values are sorted in ascending order,
otherwise the evaluation of the frequency grid will not work properly!
Finally, the user may set the -L parameter. It causes the program to create a
file epsim.log where detailed information is stored during the process. This
makes the code slower.
The user is free to pass all arguments via command line. The command line
syntax is
./epsim [-I ] [-L] [-N ]
[-O