1 #define CONCAT2x(a,b) a##b
2 #define CONCAT2(a,b) CONCAT2x(a,b)
6 # define DBLDATATYPE COMPLEX16
7 # ifdef SINGLE_PRECISION
8 # define DATATYPE COMPLEX8
10 # define DATATYPE COMPLEX16
13 # define DBLDATATYPE REAL8
14 # ifdef SINGLE_PRECISION
15 # define DATATYPE REAL4
17 # define DATATYPE REAL8
21 #define SERIESTYPE CONCAT2(DATATYPE,TimeSeries)
22 #define VECTORTYPE CONCAT2(DATATYPE,Vector)
23 #define FILTERTYPE CONCAT2(DBLDATATYPE,IIRFilter)
25 #define BFUNC CONCAT2(XLALButterworth,SERIESTYPE)
26 #define LFUNC CONCAT2(XLALLowPass,SERIESTYPE)
27 #define HFUNC CONCAT2(XLALHighPass,SERIESTYPE)
29 #define CFUNC CONCAT2(XLALCreate,FILTERTYPE)
30 #define DFUNC CONCAT2(XLALDestroy,FILTERTYPE)
32 #define FFUNC CONCAT2(XLALIIRFilter,VECTORTYPE)
33 #define RFUNC CONCAT2(XLALIIRFilterReverse,VECTORTYPE)
44 if ( ! params || ! series || ! series->data || ! series->data->data )
60 for(i=0,j=n-1;i<j;i++,j--){
62 REAL8 ar=wc*cos(theta);
63 REAL8 ai=wc*sin(theta);
79 zpgFilter->
gain=-wc*wc;
92 iirFilter =
CFUNC(zpgFilter);
100 if (
FFUNC(series->data,iirFilter)<0
101 ||
RFUNC(series->data,iirFilter)<0)
130 zpgFilter->
gain=-wc*I;
140 iirFilter=
CFUNC(zpgFilter);
148 if (
FFUNC(series->data,iirFilter)<0
149 ||
RFUNC(series->data,iirFilter)<0)
167 params.
nMax = filtorder;
168 params.
f1 = frequency;
169 params.
a1 = amplitude;
172 if (
BFUNC(series, ¶ms) < 0)
180 params.
nMax = filtorder;
181 params.
f2 = frequency;
182 params.
a2 = amplitude;
185 if (
BFUNC(series, ¶ms) < 0)
static int XLALParsePassBandParamStruc(PassBandParamStruc *params, INT4 *n, REAL8 *wc, REAL8 deltaT)
COMPLEX16ZPGFilter * XLALCreateCOMPLEX16ZPGFilter(INT4 numZeros, INT4 numPoles)
void XLALDestroyCOMPLEX16ZPGFilter(COMPLEX16ZPGFilter *filter)
#define LAL_PI
Archimedes's constant, pi.
double REAL8
Double precision real floating-point number (8 bytes).
int32_t INT4
Four-byte signed integer.
#define XLAL_ERROR(...)
Macro to invoke a failure from a XLAL routine returning an integer.
@ XLAL_EFAULT
Invalid pointer.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
@ XLAL_EINVAL
Invalid argument.
COMPLEX16 * data
Pointer to the data array.
See DATATYPE-ZPGFilter types for details.
This structure stores data used for constructing a low- or high-pass filter: either the order and cha...
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.