LAL  7.5.0.1-bede9b2
BandPassTimeSeries.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007 Jolien Creighton, Teviet 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 _BANDPASSTIMESERIES_H
21 #define _BANDPASSTIMESERIES_H
22 
23 #include <lal/LALStdlib.h>
24 #include <lal/IIRFilter.h>
25 #include <lal/ZPGFilter.h>
26 
27 #if defined(__cplusplus)
28 extern "C" {
29 #elif 0
30 } /* so that editors will match preceding brace */
31 #endif
32 
33 /**
34  * \defgroup BandPassTimeSeries_h Header BandPassTimeSeries.h
35  * \ingroup lal_tdfilter
36  * \author Creighton, T. D.
37  *
38  * \brief Provides routines to low- or high-pass filter a time series.
39  *
40  * ### Synopsis ###
41  *
42  * \code
43  * #include <lal/BandPassTimeSeries.h>
44  * \endcode
45  *
46  * The \ref BandPassTimeSeries_h provides routines an actual implementation
47  * of these utilities to the specific task of high- or low-pass filtering
48  * of a data stream. These routines also serve as an example for the more
49  * general task of designing time-domain filters with any desired frequency
50  * response.
51  *
52  * This header covers routines that apply a time-domain low- or
53  * high-pass filter to a data series of type <tt><datatype>TimeSeries</tt>.
54  * Further documentation is given in the individual routines' modules.
55  *
56  */
57 /** @{ */
58 
59 /** \name Error Codes */
60 /** @{ */
61 #define BANDPASSTIMESERIESH_ENUL 1 /**< Unexpected null pointer in arguments */
62 #define BANDPASSTIMESERIESH_EBAD 2 /**< Bad filter parameters */
63 /** @} */
64 
65 /** \cond DONT_DOXYGEN */
66 #define BANDPASSTIMESERIESH_MSGENUL "Unexpected null pointer in arguments"
67 #define BANDPASSTIMESERIESH_MSGEBAD "Bad filter parameters"
68 /** \endcond */
69 
70 /**
71  * This structure stores data used for constructing a low- or high-pass
72  * filter: either the order and characteristic frequency of the filter,
73  * or the frequencies and desired attenuations at the ends of some
74  * transition band. In the latter case, a nonzero filter order parameter
75  * \c n indicates a maximum allowed order
76  */
77 typedef struct tagPassBandParamStruc{
78  CHAR *name; /**< A user-assigned name */
79  INT4 nMax; /**< The maximum desired filter order (actual order may be less if specified attenuations do not require a high order) */
80  REAL8 f1; /**< The reference frequencies of the transition band */
81  REAL8 f2; /**< The reference frequencies of the transition band */
82  REAL8 a1; /**< The minimal desired attenuation factors at the reference frequencies */
83  REAL8 a2; /**< The minimal desired attenuation factors at the reference frequencies */
85 
86 /** @} */
87 
88 /* Function prototypes. */
94  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
96  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
98  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
100  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
102  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
104  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
106  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
108  REAL8 frequency, REAL8 amplitude, INT4 filtorder );
109 
110 
111 
112 void
114  REAL4TimeSeries *series,
115  PassBandParamStruc *params );
116 
117 void
119  REAL8TimeSeries *series,
120  PassBandParamStruc *params );
121 
122 void
124  REAL4TimeSeries *series,
125  PassBandParamStruc *params );
126 
127 /* Chebyshev filters should also be added, but I'm too busy to write
128  the routines now. */
129 
130 #if 0
131 { /* so that editors will match succeeding brace */
132 #elif defined(__cplusplus)
133 }
134 #endif
135 
136 #endif /* _BANDPASSTIMESERIES_H */
int XLALLowPassREAL8TimeSeries(REAL8TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALHighPassCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALHighPassREAL4TimeSeries(REAL4TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALLowPassREAL4TimeSeries(REAL4TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALButterworthCOMPLEX8TimeSeries(COMPLEX8TimeSeries *series, PassBandParamStruc *params)
int XLALLowPassCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALLowPassCOMPLEX8TimeSeries(COMPLEX8TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALButterworthREAL8TimeSeries(REAL8TimeSeries *series, PassBandParamStruc *params)
int XLALHighPassCOMPLEX8TimeSeries(COMPLEX8TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALHighPassREAL8TimeSeries(REAL8TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
int XLALButterworthREAL4TimeSeries(REAL4TimeSeries *series, PassBandParamStruc *params)
int XLALButterworthCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series, PassBandParamStruc *params)
void LALButterworthREAL8TimeSeries(LALStatus *status, REAL8TimeSeries *series, PassBandParamStruc *params)
Deprecated.
void LALDButterworthREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *series, PassBandParamStruc *params)
Deprecated.
void LALButterworthREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *series, PassBandParamStruc *params)
Deprecated.
double REAL8
Double precision real floating-point number (8 bytes).
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
int32_t INT4
Four-byte signed integer.
Time series of COMPLEX16 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:600
Time series of COMPLEX8 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:590
LAL status structure, see The LALStatus structure for more details.
Definition: LALDatatypes.h:947
This structure stores data used for constructing a low- or high-pass filter: either the order and cha...
CHAR * name
A user-assigned name.
REAL8 a1
The minimal desired attenuation factors at the reference frequencies.
REAL8 a2
The minimal desired attenuation factors at the reference frequencies.
REAL8 f1
The reference frequencies of the transition band.
INT4 nMax
The maximum desired filter order (actual order may be less if specified attenuations do not require a...
REAL8 f2
The reference frequencies of the transition band.
Time series of REAL4 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:570
Time series of REAL8 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:580