/**
\addtogroup lalinspiral_findchirp

The \ref lalinspiral_findchirp is designed to allow the user to filter
interferometer data and produce a list of candidate inspiral events. It
also contains functionality to perform simulation and testing of the
inspiral search. Conceptually the package is divided into the following
parts:

<ul>
<li> Processing the raw interferometer input data into a form that can be
used for the filtering process.</li>

<li> Processing an inspiral chirp template into a form that can be used by
the filter, generating the chirp template internally, if necessary.</li>

<li> Using the processed input data, construction of a statistic on which to
search for chirps and searching for candidate events.</li>

<li> Constructing a veto statistic to apply to candidate events to reduce the
possibility of false alarms.
</li>
</ul>

We introduce the conventions used in the package and then describe the theory
and implementation of the code. An overview of the package is as follows:
<ol>
<li> The \ref FindChirp_h and modules grouped therein provide the
core functionality of the package. This includes code to perform matched
filtering and search for chirps with a signal to noise ratio above a given
threshold.  This header also provides an interface to inject time domain
waveforms so that various Monte Carlo simulations may be run using the same
code that is used to actually search for the chirps.</li>

</ol>

\section sec_fc_conv Conventions

We follow the standards for LSC code in the LIGO technical note T010095.  All
the findchirp functions measure mass in units of \f$M_\odot\f$, time in units
of seconds and distance in units of megaparsecs.

\subsection ss_conventions Conventions for Discrete Quantities

The raw output of the interferometer is the error signal from the length
sensing and control servo, LSC-AS_Q.  Although this signal is a dimensionless
quantity, we say that it has units of "counts" and we denote it by \f$v(t)\f$.
The calibrated detector output is related in the frequency domain to the raw
detector output by the detector response function according to
\f{equation}{
\tilde{s}(f) = R(f;t) \tilde{v}(f)
\f}
where \f$\tilde{v}(f)\f$ is the forward Fourier transform of \f$v(t)\f$ given by
\f{equation}{
\tilde{v}(f)=\int_{-\infty}^\infty dt\,v(t)\, e^{- 2 \pi i f t}.
\f}
\f$R(f;t)\f$ is the (complex) response function of the detector at time \f$t\f$
and has units of strain/count.  In practice, the interferometer output is a
discretely sampled quantity with sampling interval \f$\Delta t\f$, that is \f$v_j
\equiv v(t_j)\f$ where \f$t_j = j\Delta t\f$.  The digital matched filter operates
on a single <em>data segment</em> consisting of \f$N\f$ consecutive samples of
\f$v(t_j)\f$. The length of this data segment is \f$T = N\Delta t\f$\ seconds.
Henceforth, we let \f$N\f$ be a power of \f$2\f$ and follow the convention that the
subscript \f$j\f$ refers to discretely sampled time domain quantities and the
subscript \f$k\f$ to discretely sampled frequency domain quantities.  The
frequency domain quantity \f$\tilde{v}(f_k)\f$ denotes the value of the continuous
function \f$\tilde{v}(f)\f$ at a particular frequency, labeled \f$f_k = k/(N\Delta
t)\f$. If the units of \f$v_j\f$ are counts, then \f$\tilde{v}(f_k)\f$ has units of
counts/Hz. We define the quantity \f$\tilde{v}_k\f$ by \f$\tilde{v}_k =
\tilde{v}(f_k) / \Delta t\f$, which has units of counts. If \f$k\f$ is negative,
this corresponds to negative frequencies.

\subsection ss_dft The Discrete Fourier Transform

If \f$v(t_j)\f$ is sampled at intervals of \f$\Delta t\f$, then the sampling theorem
tells us that \f$v(t_j)\f$ is bandwidth limited to the frequency range
\f$-f_\mathrm{Ny} \le f \le f_\mathrm{Ny}\f$, where
\f{equation}{
f_\mathrm{Ny} = \frac{1}{2\Delta t}
\f}
is the <em>Nyquist critical frequency</em>. Any power in \f$v(t)\f$ at frequencies
above \f$f_\mathrm{Ny}\f$ will be aliased into the range \f$-f_\mathrm{Ny} \le f
\le f_\mathrm{Ny}\f$, corrupting the signal. To prevent this, signals of
frequency higher than \f$f_\mathrm{Ny}\f$ in the interferometer output are removed
using analog low-pass filters before the signal is digitized. Therefore
\f$v(t_j)\f$ completely determines the signal \f$v(t)\f$ in the band of interest. We
may approximate the Fourier transform of this band limited signal \f$v(t_j)\f$ by
\f{equation}{
\label{eq_fftapprox}
\tilde{v}(f_k) \rightarrow \sum_{j=0}^{N-1} \Delta t\, v(t_j) e^{-2 \pi i f_k t_j}
= \Delta t \sum_{j=0}^{N-1} v_j e^{-2 \pi i j k / N},
\f}
where \f$-(N/2 + 1) \le k \le N/2\f$ and the symbol \f$\rightarrow\f$ means
equal to under discretization.  Notice that the approximation to the
Fourier transform is periodic in \f$k\f$ with period \f$N\f$ and so
\f{equation}{
\tilde{v}_{-k} = \tilde{v}_{N-k}\quad k = 1, \ldots, N - 1.
\f}
Thus we let \f$k\f$ vary from \f$0\f$ to \f$N-1\f$ where zero frequency (DC) corresponds
to \f$k=0\f$, positive frequencies \f$0 < f < f_\mathrm{Ny}\f$ to values in the range
\f$0 < k < N/2\f$ and negative frequencies \f$-f_\mathrm{Ny} < f < 0\f$ correspond
to values in the range \f$N/2 < k < N\f$. The value \f$k = N/2\f$ approximates the
value of the Fourier transform at both \f$-f_\mathrm{Ny}\f$ and \f$f_\mathrm{Ny}\f$;
both these values are equal due to the periodicity of the discrete transform
defined by
\f{equation}{
\label{eq_dftdef}
\tilde{v}_k = \sum_{j=0}^{N-1} v_j e^{-i 2 \pi j k / N}.
\f}
We may estimate the discrete inverse Fourier transform
in a similar way, using the relation
\f{equation}{
\Delta f = f_{k+1} - f_k = \frac{k+1}{N\Delta t} - \frac{k}{N\Delta t} =
\frac{1}{N\Delta t}
\f}
to obtain
\f{equation}{
v_j = \frac{1}{N} \sum_{k=0}^{N-1} \tilde{v}_k e^{2 \pi i j k / N}.
\f}
Note that the LAL inverse FFT routines omit the factor of \f$1/N\f$ as documented
in the fft package.

\subsection ss_psdconv Power Spectral Densities

The one sided power spectral density \f$S_n(|f|)\f$ of \f$n(t)\f$ to be
\f{equation}{
\left\langle\tilde{n}(f) \tilde{n}^\ast(f')\right\rangle =
\frac{1}{2}S_n(|f|)\delta(f-f')
\f}
where angle brackets denote an average over different realizations of the noise.
If \f$n(t)\f$ has units of \f$U\f$ then \f$\tilde{n}(f)\f$ has units of
\f$(\mathrm{time}) \times U\f$. The units \f$\delta(f-f')\f$ are \f$(\mathrm{time})\f$,
since
\f{equation}{
\int_{-\infty}^\infty \delta(f)\,df = 1
\f}
is a dimensionless quantity and \f$df\f$ has units \f$(\mathrm{time})^{-1}\f$.
Therefore we see that \f$S_n(|f|)\f$ has units of \f$(\mathrm{time})\times U^2\f$.
If we replace \f$\tilde{n}(f_k)\f$ with the discretely sampled quantities
\f$\tilde{n}_k = \tilde{n}(f_k)\f$, we obtain
\f{equation}{
\label{eq_ospsddisc}
\left\langle\tilde{n}_k \tilde{n}_{k'}^\ast\right\rangle =
\frac{N}{2\Delta t}{{S\left(\left|f_{k}\right|\right)}}\delta_{kk'}
\f}
where \f$\delta_{kk'}\f$ is the dimensionless Kronecker \f$\delta\f$-function,
obtained by discretization of the continuous \f$\delta\f$-function:
\f{equation}{
\delta(f-f') \rightarrow N\Delta t\delta_{kk'}
\f}
\eqref{eq_ospsddisc} defines \f${S\left(\left|f_{k}\right|\right)}\f$ in terms of the discrete
frequency domain quantities.

*/
