LALApps 10.1.0.1-eeff03c
spectrm.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Jolien Creighton
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20#ifndef INVSPEC_H
21#define INVSPEC_H
22
23/*
24 *
25 * Routine to compute the average spectrum from time series data.
26 * Routine to invert and truncate (to have compact time support) a spectrum.
27 * Routine to scale a spectrum by the magnitude of the response function.
28 *
29 */
30
31#include <lal/LALDatatypes.h>
32#include <stdio.h>
33#include <gsl/gsl_rng.h>
34#include <lal/LALStdlib.h>
35#include <lal/FrequencySeries.h>
36#include <lal/TimeSeries.h>
37#include <lal/LALSimNoise.h>
38
39/* macro for testing validity of a condition that prints an error if invalid */
40#define sanity_check( condition ) \
41 ( condition ? 0 : ( fputs( #condition " not satisfied\n", stderr ), error( "sanity check failed\n" ) ) )
42
43
44/* routine to compute an average spectrum from time series data */
47 int spectrumAlgthm,
48 REAL8 segmentDuration,
49 REAL8 strideDuration,
50 REAL4FFTPlan *fwdplan,
51 int whiteSpectrum
52 );
53
54/* Resample calculated PSD using linear interpolation */
56 REAL4FrequencySeries *origspectrum,
58 REAL8 segmentDuration
59 );
60
61/* Routine to generate a theoretical PSD */
63 REAL4 deltaT,
64 REAL8 segmentDuration,
65 UINT4 spectrumNumber,
66 REAL8 simScale
67 );
68
69
70/* routine to invert and truncate (to have compact time support) a spectrum */
72 REAL4FrequencySeries *spectrum,
73 REAL8 dataSampleRate,
74 REAL8 strideDuration,
75 REAL8 truncateDuration,
76 REAL8 lowCutoffFrequency,
77 REAL4FFTPlan *fwdplan,
78 REAL4FFTPlan *revplan
79 );
80
81
82/* routine to scale a spectrum by the magnitude of the response function */
84 REAL4FrequencySeries *spectrum,
86 REAL8 lowCutoffFrequency,
87 int inverse
88 );
89
90typedef enum
91{
97
98#endif /* INVSPEC_H */
INT4 sampleRate
Definition: blindinj.c:124
double REAL8
uint32_t UINT4
float REAL4
int calibrate_spectrum(REAL4FrequencySeries *spectrum, COMPLEX8FrequencySeries *response, REAL8 lowCutoffFrequency, int inverse)
Definition: spectrm.c:271
REAL4FrequencySeries * resample_psd(REAL4FrequencySeries *origspectrum, REAL8 sampleRate, REAL8 segmentDuration)
Definition: spectrm.c:105
REAL8FrequencySeries * generate_theoretical_psd(REAL4 deltaT, REAL8 segmentDuration, UINT4 spectrumNumber, REAL8 simScale)
Definition: spectrm.c:174
int invert_spectrum(REAL4FrequencySeries *spectrum, REAL8 dataSampleRate, REAL8 strideDuration, REAL8 truncateDuration, REAL8 lowCutoffFrequency, REAL4FFTPlan *fwdplan, REAL4FFTPlan *revplan)
REAL4FrequencySeries * compute_average_spectrum(REAL4TimeSeries *series, int spectrumAlgthm, REAL8 segmentDuration, REAL8 strideDuration, REAL4FFTPlan *fwdplan, int whiteSpectrum)
Definition: spectrm.c:44
spectrumType
Definition: spectrm.h:91
@ ALIGO_PSD
Definition: spectrm.h:94
@ ILIGO_PSD
Definition: spectrm.h:93
@ WHITE_PSD
Definition: spectrm.h:92
Definition: series.h:36