23#include <lal/LALStdlib.h>
24#include <lal/AVFactories.h>
25#include <lal/TimeFreqFFT.h>
26#include <lal/RealFFT.h>
27#include <lal/Window.h>
28#include <lal/Random.h>
30#define TESTSTATUS( s ) \
31 if ( (s)->statusCode ) { REPORTSTATUS( s ); exit( 1 ); } else \
36 const UINT4 n = 65536;
82 for ( i = 1; i < fseries.
data->
length - 1; ++i )
85 fprintf( stdout,
"median:\t%e\terror:\t%f%%\n", ave, fabs( ave - 2.0 ) / 0.02 );
91 for ( i = 1; i < fseries.
data->
length - 1; ++i )
94 fprintf( stdout,
"mean:\t%e\terror:\t%f%%\n", ave, fabs( ave - 2.0 ) / 0.02 );
void LALCheckMemoryLeaks(void)
double REAL8
Double precision real floating-point number (8 bytes).
uint32_t UINT4
Four-byte unsigned integer.
RandomParams * XLALCreateRandomParams(INT4 seed)
void XLALDestroyRandomParams(RandomParams *params)
int XLALNormalDeviates(REAL4Vector *deviates, RandomParams *params)
REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan(UINT4 size, int measurelvl)
Returns a new REAL4FFTPlan for a forward transform.
void XLALDestroyREAL4FFTPlan(REAL4FFTPlan *plan)
Destroys a REAL4FFTPlan.
int XLALREAL4AverageSpectrumMedian(REAL4FrequencySeries *spectrum, const REAL4TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL4Window *window, const REAL4FFTPlan *plan)
Median Method: use median average rather than mean.
int XLALREAL4AverageSpectrumWelch(REAL4FrequencySeries *spectrum, const REAL4TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL4Window *window, const REAL4FFTPlan *plan)
Use Welch's method to compute the average power spectrum of a time series.
void LALDestroyVector(LALStatus *, REAL4Vector **)
void LALCreateVector(LALStatus *, REAL4Vector **, UINT4)
void XLALDestroyREAL4Window(REAL4Window *window)
REAL4Window * XLALCreateWelchREAL4Window(UINT4 length)
LAL status structure, see The LALStatus structure for more details.
See DATATYPE-FrequencySeries types for documentation.
Time series of REAL4 data, see DATATYPE-TimeSeries types for more details.
REAL4Sequence * data
The sequence of sampled data.
REAL8 deltaT
The time step between samples of the time series in seconds.
REAL4 * data
Pointer to the data array.
UINT4 length
Number of elements in array.
Structure for storing REAL4 window function data, providing storage for a sequence of samples as well...
This structure contains the parameters necessary for generating the current sequence of random number...