LALBurst 2.0.7.1-eeff03c
EPSearch.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007 Kipp Cannon and Flanagan, E
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12 * Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19
20#ifndef _EPSEARCH_H_
21#define _EPSEARCH_H_
22
23
24#include <lal/FrequencySeries.h>
25#include <lal/LIGOLwXML.h>
26#include <lal/LIGOMetadataTables.h>
27#include <lal/Sequence.h>
28#include <lal/TimeSeries.h>
29#include <lal/Window.h>
30
31
32#ifdef __cplusplus /* C++ protection. */
33extern "C" {
34#endif
35
36/**
37 * \defgroup EPSearch_h Header EPSearch.h
38 * \ingroup lalburst_burstsearch
39 *
40 * \brief A set of functions to implement the excess power search
41 * technique which was suggested in Ref.\ \cite fh1998 and later
42 * independently invented in Ref.\ \cite acdhp1999 . The implementation
43 * here is described in detail in Ref.\ \cite ABCF2001 .
44 *
45 * This package provides a suite for functions for computing time-frequency
46 * representations of data using stacked Fourier transforms.
47 *
48 * The first few functions simply combine functionality from the packages
49 * \c fft and \c Window in a convenient way. They are designed to
50 * streamline the task of setting up structures to prepare for taking many
51 * discrete Fourier transforms (DFTs), including windows and plans for
52 * FFTW.
53 *
54 * A general description of the time-frequency (TF) transform provided by
55 * TFTransform is as follows. Suppose one starts with some data \f$h_j\f$,
56 * \f$0 \le j < n\f$ in the time domain, with sampling time \f$\Delta t\f$,
57 * so that the data point \f$h_j\f$ corresponds to a time \f$t_j =
58 * t_\textrm{start} + j \Delta t\f$. Taking the standard DFT yields
59 * complex data
60 * \f{equation}{
61 * \label{standarddft}
62 * {\tilde h}_\gamma = \sum_{j=0}^{n-1} \, e^{-2 \pi i j \gamma / n} \, h_j
63 * \f}
64 * in the Fourier domain, for \f$0 \le \gamma \le [n/2]+1\f$. Here the
65 * data point \f${\tilde h}_\gamma\f$ corresponds to a frequency
66 * \f$f_\gamma = \gamma \Delta f\f$, where \f$\Delta f= 1/(n \Delta t)\f$
67 * is the frequency resolution.
68 *
69 * Now suppose that we can factorize the number \f$n\f$ of data points as
70 * \f{equation}{
71 * n = 2 N_T N_F.
72 * \f}
73 * Then, by a time-frequency plane we shall mean a set of \f$N_T N_F\f$
74 * complex numbers \f$H_{I\Gamma}\f$ with \f$0 \le I < N_T\f$ and \f$0 \le
75 * \Gamma < N_F\f$, obtained by an invertible linear transformation from
76 * the original data, such that the data point \f$H_{I\Gamma}\f$
77 * corresponds approximately to a time \f$t_I = t_\textrm{start} + I
78 * {\overline{\Delta t}}\f$ and to a frequency \f$f_\Gamma = \Gamma
79 * {\overline{\Delta f}}\f$. Here \f$N_F\f$ is the number of frequency
80 * bins in the TF plane, and \f$N_T\f$ is the number of time bins. The
81 * time resolution \f${\overline {\Delta t}}\f$ and frequency resolution
82 * \f${\overline {\Delta f}}\f$ are related by \f${\overline {\Delta t}} \
83 * {\overline {\Delta f}} =1\f$, and are given by \f${\overline {\Delta t}}
84 * = 2 N_F \Delta t\f$ and \f${\overline {\Delta f}} = N_T \Delta f\f$.
85 * Note that there are many other time-frequency representations of data
86 * that are not of this type; see \cite ab1999 .
87 *
88 * There are many possible choices of linear transformations from the data
89 * \f$h_j\f$ to data \f$H_{J\Gamma}\f$ satisfying the above properties.
90 * Here we have implemented two simple choices. The first choice consists
91 * of dividing the time-domain data \f$h_j\f$ into \f$N_T\f$ equal-sized
92 * chunks, each of length \f$n/N_T\f$, and then taking the forward DFT of
93 * each chunk. Then, \f$H_{J\Gamma}\f$ is just the \f$\Gamma\f$th element
94 * of the \f$J\f$th chunk. In terms of formulae this corresponds to
95 * \f{equation}{
96 * \label{verticalTFP}
97 * H_{J\Sigma} = \sum_{k=0}^{2 N_F-1} \, \exp \left[ 2 \pi i k \Sigma / (2
98 * N_F) \right] \, h_{2 N_F J + k},
99 * \f}
100 * for \f$0 \le J < N_T\f$ and \f$0 \le \Sigma < N_F\f$. We call this
101 * first type of TF plane a vertical TF plane, since it corresponds to a
102 * series of vertical lines if the time axis is horizontal and the
103 * frequency axis vertical.
104 *
105 * The second type of TF plane is obtained by first taking a DFT of all the
106 * time domain data to obtain frequency domain data, then dividing the
107 * frequency domain data into \f$N_F\f$ equal-sized chunks, then taking the
108 * inverse DFT of each chunk. We call the resulting TF plane a horizontal
109 * TF plane. In terms of formulae the TF plane elements are
110 * \f{equation}{
111 * \label{horizontalTFP}
112 * H_{J\Sigma} =
113 * \sum_{\gamma=0}^{N_T-1} \, \exp \left[ -2 \pi i J \gamma / N_T \right] \,
114 * {\tilde h}_{N_T \Sigma + \gamma},
115 * \f}
116 * for \f$0 \le J < N_T\f$ and \f$0 \le \Sigma < N_F\f$, where \f${\tilde h}_\gamma\f$ is given by
117 * \eqref{standarddft}.
118 */
119 /** @{ */
120
121
123 const COMPLEX16FrequencySeries *filter1,
124 const COMPLEX16FrequencySeries *filter2,
125 const REAL8Sequence *correlation,
126 const REAL8FrequencySeries *psd
127);
128
129
131 double channel_flow,
132 double channel_width,
133 const REAL8FrequencySeries *psd,
134 const REAL8Sequence *correlation
135);
136
137
139 int target_length,
140 int segment_length,
141 int segment_shift
142);
143
144
145#ifdef SWIG /* SWIG interface directives */
146SWIGLAL(INOUT_SCALARS(int*, psd_length));
147#endif
149 int window_length,
150 int max_tile_length,
151 double fractional_tile_stride,
152 int *psd_length,
153 int *psd_shift,
154 int *window_shift,
155 int *window_pad,
156 int *tiling_length
157);
158
159
161 LIGOLwXMLStream *diagnostics,
162 const REAL8TimeSeries *tseries,
163 REAL8Window *window,
164 double flow,
165 double bandwidth,
166 double confidence_threshold,
167 /* t.f. plane tiling parameters */
168 double fractional_stride,
169 double maxTileBandwidth,
170 double maxTileDuration
171);
172
173 /** @} */
174
175#ifdef __cplusplus
176}
177#endif /* C++ protection. */
178
179#endif /* _EPSEARCH_H_ */
int XLALOverlappedSegmentsCommensurate(int target_length, int segment_length, int segment_shift)
Round target_length down so that an integer number of intervals of length segment_length,...
Definition: EPSearch.c:191
int XLALEPGetTimingParameters(int window_length, int max_tile_length, double fractional_tile_stride, int *psd_length, int *psd_shift, int *window_shift, int *window_pad, int *tiling_length)
Compute and return the timing parameters for an excess power analysis.
Definition: EPSearch.c:234
SnglBurst * XLALEPSearch(LIGOLwXMLStream *diagnostics, const REAL8TimeSeries *tseries, REAL8Window *window, double flow, double bandwidth, double confidence_threshold, double fractional_stride, double maxTileBandwidth, double maxTileDuration)
Generate a linked list of burst events from a time series.
Definition: EPSearch.c:969
COMPLEX16FrequencySeries * XLALCreateExcessPowerFilter(double channel_flow, double channel_width, const REAL8FrequencySeries *psd, const REAL8Sequence *correlation)
Generate the frequency domain channel filter function.
Definition: EPFilters.c:150
double XLALExcessPowerFilterInnerProduct(const COMPLEX16FrequencySeries *filter1, const COMPLEX16FrequencySeries *filter2, const REAL8Sequence *correlation, const REAL8FrequencySeries *psd)
Compute the magnitude of the inner product of two arbitrary channel filters.
Definition: EPFilters.c:73