Function:

`void simulate_noise(int n, float delta_t, double *power,
double *whiten_out, float *out, int *pseed)`

This function simulates the generation of noise intrinsic to a detector.
The output is a (not necessarily continuous-in-time)
whitened data stream representing the detector output when
only detector noise is present.

The arguments of `simulate_noise()` are:

`n:`Input. The number of data points corresponding to an observation time , where is the sampling period of the detector, defined below. should equal an integer power of 2.`delta_t:`Input. The sampling period (in sec) of the detector.`power:`Input.`power[0..n/2-1]`is an array of double precision variables containing the values of the noise power spectrum of the detector. These variables have units of (or seconds).`power[i]`contains the value of evaluated at the discrete frequency , where .`whiten_out:`Input.`whiten_out[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 detector. These variables have units (or ), which are inverse to the units of the square root of the noise power spectrum .`whiten_out[2*i]`and`whiten_out[2*i+1]`contain, respectively, the values of the real and imaginary parts of evaluated at the discrete frequency , where .`out:`Output.`out[0..n-1]`is an array of floating point variables containing the values of the whitened data stream representing the output of the detector when only detector noise is present. is the convolution of detector whitening filter with the noise intrinsic to the detector. The variables`out[]`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 .`out[i]`contains the value of evaluated at the discrete time , where .`pseed:`Input. A pointer to a seed value, which is used by the random number generator routine.

`simulate_noise()` simulates the generation of noise intrinsic
to a detector in the following series of steps:

- (i)
- It first constructs random variables
in the frequency domain that have zero mean
and satisfy:

(11.9.228)

(11.9.229) *Numerical Recipes in C*random number generator routine`gasdev()`. - (ii)
`simulate_noise()`then whitens the data in the frequency domain by multiplying by the frequency components of the whitening filter of the detector:

(11.9.230) - (iii)
- The final step consists of Fourier transforming the frequency components into the time domain to obtain the whitened data stream . Here with .

- Authors: Bruce Allen, ballen@dirac.phys.uwm.edu, and Joseph Romano, romano@csd.uwm.edu
- Comments:
In the context of stochastic background simulations, it would be
more efficient to simulate the noise at
*two*detectors simultaneously. Since the time-series data are real, the two Fourier transforms that would need to be performed in step (iii) could be done simultaneously. However, for modularity of design, and to simulate noise for ``single-detector'' gravity-wave searches, we decided to write the above routine instead.