Function:

`void analyze(int average, float *in1, float *in2, int n, float delta_t,
float f_low, float f_high, double *gamma12, double *whiten1,
double *whiten2, int real_time_noise1, int real_time_noise2,
double *power1, double *power2, double *signal, double *variance)`

This high-level function performs the optimal data processing for the
detection of an isotropic and unpolarized stochastic background of
gravitational radiation having a constant frequency spectrum:
for
.
It calculates the cross-correlation signal value and theoretical
variance , taking as input the continuous-in-time whitened
data streams and produced by two detectors.

The arguments of `analyze()` are:

`average:`Input. An integer variable that should be set equal to 1 if the values of the real-time cross-correlation and/or noise power spectra corresponding to two overlapped data sets are to be averaged.`in1:`Input.`in1[0..n-1]`is an array of floating point variables containing the values of the continuous-in-time whitened data stream produced by the first detector. is the convolution of detector whitening filter with the data stream , where is the gravitational strain and is the noise intrinsic to the detector. These variables have units of rHz (or ), which follows from the definition of as a strain and as the ``inverse'' of the square root of the noise power spectrum .`in1[i]`contains the value of evaluated at the discrete time , where .`in2:`Input.`in2[0..n-1]`is an array of floating point variables containing the values of the continuous-in-time whitened data stream produced by the second detector, in exactly the same format as the previous argument.`n:`Input. The number of data points corresponding to an observation time , where is the sampling period of the detectors, defined below. should equal an integer power of 2.`delta_t:`Input. The sampling period (in sec) of the detectors.`f_low:`Input. The frequency (in Hz) below which the spectrum of the stochastic background is assumed to be zero. should lie in the range , where is the Nyquist critical frequency. (The Nyquist critical frequency is defined by , where is the sampling period of the detectors.) should also be less than or equal to .`f_high:`Input. The frequency (in Hz) above which the spectrum of the stochastic background is assumed to be zero. should lie in the range . It should also be greater than or equal to .`gamma12:`Input.`gamma12[0..n/2-1]`is an array of double precision variables containing the values of the overlap reduction function for the two detector sites. These variables are dimensionless.`gamma12[i]`contains the value of evaluated at the discrete frequency , where .`whiten1:`Input.`whiten1[0..n-1]`is an array of double precision variables containing the values of the real and imaginary parts of the spectrum of the whitening filter of the first detector. These variables have units (or ), which are inverse to the units of the square root of the noise power spectrum .`whiten1[2*i]`and`whiten1[2*i+1]`contain, respectively, the values of the real and imaginary parts of evaluated at the discrete frequency , where .`whiten2:`Input.`whiten2[0..n-1]`is an array of double precision variables containing the values of the real and imaginary parts of the spectrum of the whitening filter of the second detector, in exactly the same format as the previous argument.`real_time_noise1:`Input. An integer variable that should be set equal to 1 if the real-time noise power spectrum of the first detector should be calculated and used when performing the data analysis.`real_time_noise2:`Input. An integer variable that should be set equal to 1 if the real-time noise power spectrum for the second detector should be calculated and used when performing the data analysis.`power1:`Input/Output.`power1[0..n/2-1]`is an array of double precision variables containing the values of the noise power spectrum of the first detector. These variables have units of (or seconds).`power1[i]`contains the value of evaluated at the discrete frequency , where . If , the values of`power1[0..n/2-1]`are changed to

(11.23.266) `power1[0..n/2-1]`are unchanged.`power2:`Input/Output.`power2[0..n/2-1]`is an array of double precision variables containing the values of the noise power spectrum of the second detector, in exactly the same format as the previous argument.`signal:`Output. A pointer to a double precision variable containing the value of the cross-correlation signal

where is the real-time cross-correlation spectrum and is the spectrum of the optimal filter function. has units of seconds.`variance:`Output. A pointer to a double precision variable containing the value of the theoretical variance of the cross-correlation signal . has units of sec.

`analyze()` is very simple function, consisting primarily of
calls to other more basic functions.
If `real_time_noise1` or
,
`analyze()` calls `extract_noise()` to obtain the desired
real-time noise power spectra.
It then calls `extract_signal()` and `optimal_filter()`
to obtain the values of
and , which
are needed to calculate the cross-correlation signal , according
to Eq. ().
Finally, `analyze()` calls `calculate_var()` to obtain the
theoretical variance associated with .

Note: One should call `analyze()` with
,
when one suspects that the current input data `in1[]` and `in2[]`
are *not* continuous with the data from the previous call to
`analyze()`.
This is because a discontinuity between the ``old'' and ``new'' data
sets has a tendency to introduce spurious large frequency components
into the real-time cross-correlation and/or noise power spectra, which
should not be present.
(See the discussion at the end of Secs.
and for more details.)

- Authors: Bruce Allen, ballen@dirac.phys.uwm.edu, and Joseph Romano, romano@csd.uwm.edu
- Comments: None.