TFTransform.h

Go to the documentation of this file.
00001 /*
00002  * $Id: TFTransform.h,v 1.76 2008/09/04 02:46:38 kipp Exp $
00003  *
00004  * Copyright (C) 2007  Kipp Cannon and Flanagan, E
00005  *
00006  * This program is free software; you can redistribute it and/or modify it
00007  * under the terms of the GNU General Public License as published by the
00008  * Free Software Foundation; either version 2 of the License, or (at your
00009  * option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
00014  * Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License along
00017  * with this program; if not, write to the Free Software Foundation, Inc.,
00018  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 
00022 #ifndef _TFTRANSFORM_H
00023 #define _TFTRANSFORM_H
00024 
00025 
00026 #include <gsl/gsl_matrix.h>
00027 
00028 
00029 #include <lal/LALDatatypes.h>
00030 #include <lal/Window.h>
00031 #include <lal/RealFFT.h>
00032 #include <lal/LIGOMetadataTables.h>
00033 #include <lal/Sequence.h>
00034 
00035 
00036 #ifdef  __cplusplus             /* C++ protection. */
00037 extern "C" {
00038 #endif
00039 
00040 
00041 #include <lal/LALRCSID.h>
00042 NRCSID(TFTRANSFORMH, "$Id: TFTransform.h,v 1.76 2008/09/04 02:46:38 kipp Exp $");
00043 
00044 
00045 /*
00046  * An excess power filter bank
00047  */
00048 
00049 
00050 typedef struct tagLALExcessPowerFilterBank {
00051         int n_filters;
00052         struct ExcessPowerFilter {
00053                 COMPLEX16FrequencySeries *fseries;
00054                 /* root mean square of the unwhitened time series
00055                  * corresponding to this filter */
00056                 REAL8 unwhitened_rms;
00057         } *basis_filters;
00058         /* twice the inner product of filters for neighbouring channels;
00059          * twice_channel_overlap[0] is twice the inner product of the
00060          * filters for channels 0 and 1, and so on (for n channels, there
00061          * are n - 1 channel_overlaps) */
00062         REAL8Sequence *twice_channel_overlap;
00063         /* the mean square cross terms for wide channels (indices same as
00064          * for twice_channel_overlap) */
00065         REAL8Sequence *unwhitened_cross;
00066 } LALExcessPowerFilterBank;
00067 
00068 
00069 LALExcessPowerFilterBank *XLALCreateExcessPowerFilterBank(
00070         double filter_deltaF,
00071         double flow,
00072         double channel_bandwidth,
00073         int n_channels,
00074         const REAL8FrequencySeries *psd,
00075         const REAL8Sequence *two_point_spectral_correlation
00076 );
00077 
00078 
00079 void XLALDestroyExcessPowerFilterBank(
00080         LALExcessPowerFilterBank *bank
00081 );
00082 
00083 
00084 /*
00085  * A time-frequency plane
00086  */
00087 
00088 
00089 typedef struct tagREAL8TimeFrequencyPlane {
00090         /* name of data from which this was computed */
00091         CHAR name[LALNameLength];
00092         /* epoch of data from which this was computed */
00093         LIGOTimeGPS epoch;
00094         /* time resolution of the plane */
00095         REAL8 deltaT;
00096         /* input frequency series' resolution */
00097         REAL8 fseries_deltaF;
00098         /* TF plane's frequency resolution (channel spacing) */
00099         REAL8 deltaF;
00100         /* low frequency boundary of TF plane */
00101         REAL8 flow;
00102         /* channel data.  each channel is placed into its own column.
00103          * channel_data[i * channels + j] corresponds to time
00104          *
00105          * epoch + i * deltaT
00106          *
00107          * and the frequency band
00108          *
00109          * [flow + j * deltaF, flow + (j + 1) * deltaF)
00110          */
00111         gsl_matrix *channel_data;
00112         /* re-usable holding area for the data for a single channel */
00113         REAL8Sequence *channel_buffer;
00114         REAL8Sequence *unwhitened_channel_buffer;
00115         /* time-frequency plane's tiling information */
00116         struct TFTiling {
00117                 unsigned max_length;
00118                 unsigned min_channels;
00119                 unsigned max_channels;
00120                 unsigned tiling_start;
00121                 unsigned tiling_end;
00122                 unsigned inv_fractional_stride;
00123                 double dof_per_pixel;
00124         } tiles;
00125         /* time-domain window applied to input time series for tapering
00126          * edges to 0 */
00127         REAL8Window *window;
00128         /* by how many samples a window's start should be shifted from the
00129          * start of the window preceding it */
00130         INT4 window_shift;
00131         /* two-point spectral correlation of the whitened frequency series,
00132          * computed from the time-domain window function */
00133         REAL8Sequence *two_point_spectral_correlation;
00134 } REAL8TimeFrequencyPlane;
00135 
00136 
00137 REAL8TimeFrequencyPlane *XLALCreateTFPlane(
00138         UINT4 tseries_length,
00139         REAL8 tseries_deltaT,
00140         REAL8 flow,
00141         REAL8 bandwidth,
00142         REAL8 tiling_fractional_stride,
00143         REAL8 tiling_max_bandwidth,
00144         REAL8 tiling_max_duration
00145 );
00146 
00147 
00148 void XLALDestroyTFPlane(
00149         REAL8TimeFrequencyPlane *plane
00150 );
00151 
00152 
00153 int XLALFreqSeriesToTFPlane(
00154         REAL8TimeFrequencyPlane *tfplane,
00155         const LALExcessPowerFilterBank *filter_bank,
00156         const COMPLEX16FrequencySeries *fseries,
00157         const REAL8FFTPlan *reverseplan
00158 );
00159 
00160 
00161 SnglBurst *XLALComputeExcessPower(
00162         const REAL8TimeFrequencyPlane *plane,
00163         const LALExcessPowerFilterBank *filter_bank,
00164         SnglBurst *head,
00165         double confidence_threshold
00166 );
00167 
00168 
00169 INT4 XLALOverlappedSegmentsCommensurate(
00170         INT4 target_length,
00171         INT4 segment_length,
00172         INT4 segment_shift
00173 );
00174 
00175 
00176 INT4 XLALEPGetTimingParameters(
00177         INT4 window_length,
00178         INT4 max_tile_length,
00179         REAL8 fractional_tile_stride,
00180         INT4 *psd_length,
00181         INT4 *psd_shift,
00182         INT4 *window_shift,
00183         INT4 *window_pad,
00184         INT4 *tiling_length
00185 );
00186 
00187 
00188 #ifdef  __cplusplus
00189 }
00190 #endif                          /* C++ protection. */
00191 #endif

Generated on Sun Sep 7 03:07:25 2008 for LAL by  doxygen 1.5.2