23 #include <gsl/gsl_sf_gamma.h>
24 #include <lal/FrequencySeries.h>
25 #include <lal/LALAtomicDatatypes.h>
26 #include <lal/LALConstants.h>
27 #include <lal/AVFactories.h>
28 #include <lal/Sequence.h>
29 #include <lal/TimeFreqFFT.h>
30 #include <lal/Units.h>
31 #include <lal/Window.h>
50 const REAL4FFTPlan *plan
58 if ( ! periodogram || ! tseries || ! plan )
60 if ( ! periodogram->
data || ! tseries->
data )
62 if ( tseries->
deltaT <= 0.0 )
99 for ( k = 0; k < periodogram->
data->
length; ++k )
100 periodogram->
data->
data[k] *= normfac;
104 periodogram->
f0 = tseries->
f0;
126 const REAL8FFTPlan *plan
134 if ( ! periodogram || ! tseries || ! plan )
136 if ( ! periodogram->
data || ! tseries->
data )
138 if ( tseries->
deltaT <= 0.0 )
160 work = tseries->
data;
175 for ( k = 0; k < periodogram->
data->
length; ++k )
176 periodogram->
data->
data[k] *= normfac;
180 periodogram->
f0 = tseries->
f0;
209 const REAL4FFTPlan *plan
219 if ( ! spectrum || ! tseries || ! plan )
221 if ( ! spectrum->
data || ! tseries->
data )
223 if ( tseries->
deltaT <= 0.0 )
227 sequence = *tseries->
data;
228 tseriescopy = *tseries;
229 tseriescopy.
data = &sequence;
232 numseg = 1 + (tseries->
data->
length - seglen)/stride;
236 if ( (numseg - 1)*stride + seglen != tseries->
data->
length )
250 for ( seg = 0; seg < numseg; seg++, tseriescopy.
data->
data += stride )
260 for ( k = 0; k < spectrum->
data->
length; ++k )
266 spectrum->
f0 = work->
f0;
271 for ( k = 0; k < spectrum->
data->
length; ++k )
295 const REAL8FFTPlan *plan
305 if ( ! spectrum || ! tseries || ! plan )
307 if ( ! spectrum->
data || ! tseries->
data )
309 if ( tseries->
deltaT <= 0.0 )
313 sequence = *tseries->
data;
314 tseriescopy = *tseries;
315 tseriescopy.
data = &sequence;
318 numseg = 1 + (tseries->
data->
length - seglen)/stride;
322 if ( (numseg - 1)*stride + seglen != tseries->
data->
length )
336 for ( seg = 0; seg < numseg; seg++, tseriescopy.
data->
data += stride )
346 for ( k = 0; k < spectrum->
data->
length; ++k )
352 spectrum->
f0 = work->
f0;
357 for ( k = 0; k < spectrum->
data->
length; ++k )
380 const UINT4 nmax = 1000;
382 UINT4 n = (nn - 1)/2;
388 for ( i = 1; i <= n; ++i )
391 ans += 1.0/(2*i + 1);
402 for ( i = 0; i < n; ++i )
413 for ( i = 0; i < n; ++i )
426 return (x1 > x2) - (x1 < x2);
432 return (x1 > x2) - (x1 < x2);
450 const REAL4FFTPlan *plan
462 if ( ! spectrum || ! tseries || ! plan )
464 if ( ! spectrum->
data || ! tseries->
data )
466 if ( tseries->
deltaT <= 0.0 )
470 numseg = 1 + (reclen - seglen)/stride;
474 if ( (numseg - 1)*stride + seglen != reclen )
483 for ( seg = 0; seg < numseg; ++seg )
486 if ( ! work[seg].data )
493 for ( seg = 0; seg < numseg; ++seg )
499 savevec = *tseries->
data;
503 tseries->
data->
data += seg * stride;
509 *tseries->
data = savevec;
531 normfac = 1.0 / biasfac;
534 for ( k = 0; k < spectrum->
data->
length; ++k )
537 for ( seg = 0; seg < numseg; ++seg )
538 bin[seg] = work[seg].data->
data[k];
543 spectrum->
data->
data[k] = bin[numseg/2];
545 spectrum->
data->
data[k] = 0.5*(bin[numseg/2-1] + bin[numseg/2]);
553 spectrum->
f0 = work->
f0;
578 const REAL8FFTPlan *plan
590 if ( ! spectrum || ! tseries || ! plan )
592 if ( ! spectrum->
data || ! tseries->
data )
594 if ( tseries->
deltaT <= 0.0 )
598 numseg = 1 + (reclen - seglen)/stride;
602 if ( (numseg - 1)*stride + seglen != reclen )
611 for ( seg = 0; seg < numseg; ++seg )
614 if ( ! work[seg].data )
621 for ( seg = 0; seg < numseg; ++seg )
627 savevec = *tseries->
data;
631 tseries->
data->
data += seg * stride;
637 *tseries->
data = savevec;
659 normfac = 1.0 / biasfac;
662 for ( k = 0; k < spectrum->
data->
length; ++k )
665 for ( seg = 0; seg < numseg; ++seg )
666 bin[seg] = work[seg].data->
data[k];
671 spectrum->
data->
data[k] = bin[numseg/2];
673 spectrum->
data->
data[k] = 0.5*(bin[numseg/2-1] + bin[numseg/2]);
681 spectrum->
f0 = work->
f0;
705 for ( i = 0; i < n; ++i )
721 for ( i = 0; i < n; ++i )
747 const REAL4FFTPlan *plan
761 if ( ! spectrum || ! tseries || ! plan )
763 if ( ! spectrum->
data || ! tseries->
data )
765 if ( tseries->
deltaT <= 0.0 )
769 numseg = 1 + (reclen - seglen)/stride;
773 if ( (numseg - 1)*stride + seglen != reclen )
780 halfnumseg = numseg/2;
781 if ( numseg%2 || stride < seglen/2 )
785 even =
XLALCalloc( halfnumseg,
sizeof( *even ) );
788 odd =
XLALCalloc( halfnumseg,
sizeof( *odd ) );
791 for ( seg = 0; seg < halfnumseg; ++seg )
795 if ( ! even[seg].data || ! odd[seg].data )
802 for ( seg = 0; seg < halfnumseg; ++seg )
808 savevec = *tseries->
data;
812 tseries->
data->
data += 2 * seg * stride;
820 *tseries->
data = savevec;
834 *tseries->
data = savevec;
840 *tseries->
data = savevec;
844 bin =
XLALMalloc( halfnumseg *
sizeof( *bin ) );
856 normfac = 1.0 / ( 2.0 * biasfac );
859 for ( k = 0; k < spectrum->
data->
length; ++k )
865 for ( seg = 0; seg < halfnumseg; ++seg )
866 bin[seg] = even[seg].data->
data[k];
870 if ( halfnumseg % 2 )
871 evenmedian = bin[halfnumseg/2];
873 evenmedian = 0.5*(bin[halfnumseg/2-1] + bin[halfnumseg/2]);
876 for ( seg = 0; seg < halfnumseg; ++seg )
877 bin[seg] = odd[seg].data->
data[k];
881 if ( halfnumseg % 2 )
882 oddmedian = bin[halfnumseg/2];
884 oddmedian = 0.5*(bin[halfnumseg/2-1] + bin[halfnumseg/2]);
887 spectrum->
data->
data[k] = normfac * (evenmedian + oddmedian);
892 spectrum->
f0 = even->
f0;
916 const REAL8FFTPlan *plan
930 if ( ! spectrum || ! tseries || ! plan )
932 if ( ! spectrum->
data || ! tseries->
data )
934 if ( tseries->
deltaT <= 0.0 )
938 numseg = 1 + (reclen - seglen)/stride;
942 if ( (numseg - 1)*stride + seglen != reclen )
949 halfnumseg = numseg/2;
950 if ( numseg%2 || stride < seglen/2 )
954 even =
XLALCalloc( halfnumseg,
sizeof( *even ) );
957 odd =
XLALCalloc( halfnumseg,
sizeof( *odd ) );
960 for ( seg = 0; seg < halfnumseg; ++seg )
964 if ( ! even[seg].data || ! odd[seg].data )
971 for ( seg = 0; seg < halfnumseg; ++seg )
977 savevec = *tseries->
data;
981 tseries->
data->
data += 2 * seg * stride;
989 *tseries->
data = savevec;
1003 *tseries->
data = savevec;
1009 *tseries->
data = savevec;
1013 bin =
XLALMalloc( halfnumseg *
sizeof( *bin ) );
1025 normfac = 1.0 / ( 2.0 * biasfac );
1028 for ( k = 0; k < spectrum->
data->
length; ++k )
1034 for ( seg = 0; seg < halfnumseg; ++seg )
1035 bin[seg] = even[seg].data->
data[k];
1039 if ( halfnumseg % 2 )
1040 evenmedian = bin[halfnumseg/2];
1042 evenmedian = 0.5*(bin[halfnumseg/2-1] + bin[halfnumseg/2]);
1045 for ( seg = 0; seg < halfnumseg; ++seg )
1046 bin[seg] = odd[seg].data->
data[k];
1050 if ( halfnumseg % 2 )
1051 oddmedian = bin[halfnumseg/2];
1053 oddmedian = 0.5*(bin[halfnumseg/2-1] + bin[halfnumseg/2]);
1056 spectrum->
data->
data[k] = normfac * (evenmedian + oddmedian);
1061 spectrum->
f0 = even->
f0;
1078 REAL4FFTPlan *fwdplan,
1079 REAL4FFTPlan *revplan
1087 if ( ! spectrum->
data )
1089 if ( spectrum->
deltaF <= 0.0 )
1093 if ( ! seglen || spectrum->
data->
length != seglen/2 + 1 )
1095 if ( trunclen && ! revplan )
1098 cut = lowfreq / spectrum->
deltaF;
1112 memset( vtilde->
data, 0, cut *
sizeof( *vtilde->
data ) );
1115 for ( k = cut; k < vtilde->
length - 1; ++k )
1118 vtilde->
data[k] = 1.0 / sqrt( spectrum->
data->
data[k] );
1120 vtilde->
data[k] = 0.0;
1130 memset( vector->
data + trunclen/2, 0,
1131 (vector->
length - trunclen) *
sizeof( *vector->
data ) );
1144 normfac = 0.5 / ( ((
REAL4)seglen) * ((
REAL4)seglen) );
1145 for ( k = cut; k < spectrum->
data->
length - 1; ++k )
1146 spectrum->
data->
data[k] *= normfac;
1158 for ( k = cut; k < spectrum->
data->
length - 1; ++k )
1182 REAL8FFTPlan *fwdplan,
1183 REAL8FFTPlan *revplan
1191 if ( ! spectrum->
data )
1193 if ( spectrum->
deltaF <= 0.0 )
1197 if ( ! seglen || spectrum->
data->
length != seglen/2 + 1 )
1199 if ( trunclen && ! revplan )
1202 cut = lowfreq / spectrum->
deltaF;
1216 memset( vtilde->
data, 0, cut *
sizeof( *vtilde->
data ) );
1219 for ( k = cut; k < vtilde->
length - 1; ++k )
1222 vtilde->
data[k] = 1.0 / sqrt( spectrum->
data->
data[k] );
1224 vtilde->
data[k] = 0.0;
1234 memset( vector->
data + trunclen/2, 0,
1235 (vector->
length - trunclen) *
sizeof( *vector->
data ) );
1248 normfac = 0.5 / ( ((
REAL8)seglen) * ((
REAL8)seglen) );
1249 for ( k = cut; k < spectrum->
data->
length - 1; ++k )
1250 spectrum->
data->
data[k] *= normfac;
1262 for ( k = cut; k < spectrum->
data->
length - 1; ++k )
1313 double norm = 2 * psd->
deltaF;
1319 (fseries->
f0 < psd->
f0))
1331 for(i = 0; i < fseries->
data->
length; i++, j++)
1334 fdata[i] *= sqrt(norm / pdata[j]);
1343 if(fseries->
f0 == 0)
1366 double norm = 2 * psd->
deltaF;
1372 (fseries->
f0 < psd->
f0))
1384 for(i = 0; i < fseries->
data->
length; i++, j++)
1387 fdata[i] *= sqrt(norm / pdata[j]);
1396 if(fseries->
f0 == 0)
1425 return log(
XLALMedianBias(nn)) - nn * (gsl_sf_lngamma(1.0 / nn) - log(nn));
1475 if(average_samples < 1 || median_samples < 1 || !(median_samples & 1))
1479 history =
XLALCalloc(median_samples,
sizeof(*history));
1480 if(!
new || !history)
1487 new->average_samples = average_samples;
1488 new->median_samples = median_samples;
1490 new->history = history;
1491 new->mean_square = NULL;
1505 for(i = 0; i <
r->median_samples; i++)
1509 r->history[i] = NULL;
1513 r->mean_square = NULL;
1538 if(average_samples < 1)
1540 r->average_samples = average_samples;
1549 return r->average_samples;
1560 return r->n_samples;
1574 if(median_samples < 1 || !(median_samples & 1))
1579 for(i = median_samples; i <
r->median_samples; i++)
1582 r->history[i] = NULL;
1586 history =
XLALRealloc(
r->history, median_samples *
sizeof(*history));
1589 r->history = history;
1596 for(i =
r->median_samples; i < median_samples; i++)
1604 r->median_samples = median_samples;
1614 return r->median_samples;
1634 double *bin_history;
1635 unsigned history_length;
1652 for(i = 0; i <
r->median_samples; i++)
1661 r->history[i] = NULL;
1664 r->mean_square = NULL;
1672 XLALUnitSquare(&
r->mean_square->sampleUnits, &
r->mean_square->sampleUnits);
1674 r->mean_square->data->data[i] = log(
r->history[0]->data[i] =
cabs2(sample->
data->
data[i]));
1686 if((sample->
f0 !=
r->mean_square->f0) || (sample->
deltaF !=
r->mean_square->deltaF) || (sample->
data->
length !=
r->mean_square->data->length))
1700 memmove(
r->history + 1,
r->history, (
r->median_samples - 1) *
sizeof(*
r->history));
1701 r->history[0] = oldest;
1711 if(
r->n_samples <
r->average_samples)
1715 r->n_samples =
r->average_samples;
1719 history_length =
r->n_samples <
r->median_samples ?
r->n_samples :
r->median_samples;
1720 bin_history =
XLALMalloc(history_length *
sizeof(*bin_history));
1731 for(i = 0; i <
r->mean_square->data->length; i++)
1734 double log_bin_median;
1738 for(j = 0; j < history_length; j++)
1739 bin_history[j] =
r->history[j]->data[i];
1743 qsort(bin_history, history_length,
sizeof(*bin_history),
compare_REAL8);
1744 log_bin_median = log(bin_history[history_length / 2]);
1758 if(isinf(log_bin_median) && log_bin_median < 0)
1759 r->mean_square->data->data[i] =
r->mean_square->data->data[i] + log((
r->n_samples - 1.0) /
r->n_samples);
1761 r->mean_square->data->data[i] = (
r->mean_square->data->data[i] * (
r->n_samples - 1) + log_bin_median - median_bias) /
r->n_samples;
1778 double lal_normalization_constant = 2 *
r->mean_square->deltaF;
1812 pdata[i] = exp(pdata[i] +
LAL_GAMMA) * lal_normalization_constant;
1834 double lal_normalization_constant = 2 * psd->
deltaF;
1850 for(i = 0; i <
r->median_samples; i++)
1861 r->history[i] = NULL;
1864 r->mean_square = NULL;
1870 else if((psd->
f0 !=
r->mean_square->f0) || (psd->
deltaF !=
r->mean_square->deltaF) || (psd->
data->
length !=
r->mean_square->data->length))
1883 for(i = 0; i <
r->mean_square->data->length; i++)
1884 r->mean_square->data->data[i] /= lal_normalization_constant;
1887 for(i = 0; i < r->median_samples; i++)
1888 memcpy(
r->history[i]->data,
r->mean_square->data->data,
r->mean_square->data->length *
sizeof(*
r->mean_square->data->data));
1891 for(i = 0; i <
r->mean_square->data->length; i++)
1892 r->mean_square->data->data[i] = log(
r->mean_square->data->data[i]) -
LAL_GAMMA;
1895 r->n_samples = weight <=
r->average_samples ? weight :
r->average_samples;
1932 const REAL8FFTPlan *plan
1950 if(!wsquared || !tilde_wsquared)
1961 for(i = 0; i < wsquared->
length; i++)
1991 for(i = 0; i < correlation->
length; i++)
1992 correlation->
data[i] = creal(tilde_wsquared->
data[i]);
static COMPLEX16 cabs2(COMPLEX16 z)
static int compare_REAL8(const void *p1, const void *p2)
static void median_cleanup_REAL8(REAL8FrequencySeries *work, UINT4 n)
static void median_cleanup_REAL4(REAL4FrequencySeries *work, UINT4 n)
static int compare_REAL4(const void *p1, const void *p2)
static void median_mean_cleanup_REAL4(REAL4FrequencySeries *even, REAL4FrequencySeries *odd, UINT4 n)
static void median_mean_cleanup_REAL8(REAL8FrequencySeries *even, REAL8FrequencySeries *odd, UINT4 n)
int XLALREAL4PowerSpectrum(REAL4Vector *spec, const REAL4Vector *data, const REAL4FFTPlan *plan)
int XLALPrintError(const char *fmt,...)
REAL8FrequencySeries * XLALCreateREAL8FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL4FrequencySeries(REAL4FrequencySeries *series)
REAL4FrequencySeries * XLALCutREAL4FrequencySeries(const REAL4FrequencySeries *series, size_t first, size_t length)
REAL8FrequencySeries * XLALCutREAL8FrequencySeries(const REAL8FrequencySeries *series, size_t first, size_t length)
void XLALDestroyREAL8FrequencySeries(REAL8FrequencySeries *series)
#define LAL_LN2
natural log of 2, ln(2)
#define LAL_GAMMA
Euler-Mascheroni constant, gamma.
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
double REAL8
Double precision real floating-point number (8 bytes).
uint32_t UINT4
Four-byte unsigned integer.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
float REAL4
Single precision real floating-point number (4 bytes).
#define XLALRealloc(p, n)
int XLALREAL8ForwardFFT(COMPLEX16Vector *output, const REAL8Vector *input, const REAL8FFTPlan *plan)
Performs a forward FFT of REAL8 data.
int XLALREAL8ReverseFFT(REAL8Vector *output, const COMPLEX16Vector *input, const REAL8FFTPlan *plan)
Performs a reverse FFT of REAL8 data.
int XLALREAL8PowerSpectrum(REAL8Vector *spec, const REAL8Vector *data, const REAL8FFTPlan *plan)
Computes the power spectrum of REAL8 data.
int XLALREAL4ReverseFFT(REAL4Vector *output, const COMPLEX8Vector *input, const REAL4FFTPlan *plan)
Performs a reverse FFT of REAL4 data.
REAL4Sequence * XLALCutREAL4Sequence(REAL4Sequence *sequence, size_t first, size_t length)
REAL8Sequence * XLALCutREAL8Sequence(REAL8Sequence *sequence, size_t first, size_t length)
REAL8Sequence * XLALCopyREAL8Sequence(REAL8Sequence *sequence)
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
void XLALDestroyREAL4Sequence(REAL4Sequence *sequence)
void XLALDestroyCOMPLEX16Sequence(COMPLEX16Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
COMPLEX16Sequence * XLALCreateCOMPLEX16Sequence(size_t length)
unsigned XLALPSDRegressorGetAverageSamples(const LALPSDRegressor *r)
Return the average_samples of a LALPSDRegressor object.
void XLALPSDRegressorReset(LALPSDRegressor *r)
Reset a LALPSDRegressor object to the newly-allocated state.
LALPSDRegressor * XLALPSDRegressorNew(unsigned average_samples, unsigned median_samples)
Allocate and initialize a LALPSDRegressor object.
REAL8 XLALMedianBias(UINT4 nn)
compute the median bias * See arXiv: gr-qc/0509116 appendix B for details
int XLALREAL4ModifiedPeriodogram(REAL4FrequencySeries *periodogram, const REAL4TimeSeries *tseries, const REAL4Window *window, const REAL4FFTPlan *plan)
Compute a "modified periodogram," i.e., the power spectrum of a windowed time series.
int XLALPSDRegressorAdd(LALPSDRegressor *r, const COMPLEX16FrequencySeries *sample)
Update a LALPSDRegressor object from a frequency series object.
REAL8FrequencySeries * XLALPSDRegressorGetPSD(const LALPSDRegressor *r)
Retrieve a copy of the current PSD estimate.
REAL8Sequence * XLALREAL8WindowTwoPointSpectralCorrelation(const REAL8Window *window, const REAL8FFTPlan *plan)
Compute the two-point spectral correlation function for a whitened frequency series from the window a...
int XLALREAL8AverageSpectrumWelch(REAL8FrequencySeries *spectrum, const REAL8TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL8Window *window, const REAL8FFTPlan *plan)
Use Welch's method to compute the average power spectrum of a time series.
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.
void XLALPSDRegressorFree(LALPSDRegressor *r)
Free all memory associated with a LALPSDRegressor object.
int XLALREAL8AverageSpectrumMedian(REAL8FrequencySeries *spectrum, const REAL8TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL8Window *window, const REAL8FFTPlan *plan)
Median Method: use median average rather than mean.
int XLALPSDRegressorSetAverageSamples(LALPSDRegressor *r, unsigned average_samples)
Change the average_samples of a LALPSDRegressor object.
unsigned XLALPSDRegressorGetMedianSamples(const LALPSDRegressor *r)
Return the median_samples of a LALPSDRegressor object.
int XLALPSDRegressorSetPSD(LALPSDRegressor *r, const REAL8FrequencySeries *psd, unsigned weight)
Initialize the running average of a LALPSDRegressor to the given PSD, and record it has having counte...
int XLALPSDRegressorSetMedianSamples(LALPSDRegressor *r, unsigned median_samples)
Change the median_samples of a LALPSDRegressor object.
COMPLEX16FrequencySeries * XLALWhitenCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *fseries, const REAL8FrequencySeries *psd)
Double-precision version of XLALWhitenCOMPLEX8FrequencySeries().
int XLALREAL8ModifiedPeriodogram(REAL8FrequencySeries *periodogram, const REAL8TimeSeries *tseries, const REAL8Window *window, const REAL8FFTPlan *plan)
Compute a "modified periodogram," i.e., the power spectrum of a windowed time series.
unsigned XLALPSDRegressorGetNSamples(const LALPSDRegressor *r)
Return the number of frequency series samples over which the running average has been computed.
REAL8 XLALLogMedianBiasGeometric(UINT4 nn)
Geometric mean median bias factor.
COMPLEX8FrequencySeries * XLALWhitenCOMPLEX8FrequencySeries(COMPLEX8FrequencySeries *fseries, const REAL4FrequencySeries *psd)
Normalize a COMPLEX8 frequency series to a REAL4 average PSD.
int XLALREAL8SpectrumInvertTruncate(REAL8FrequencySeries *spectrum, REAL8 lowfreq, UINT4 seglen, UINT4 trunclen, REAL8FFTPlan *fwdplan, REAL8FFTPlan *revplan)
UNDOCUMENTED.
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.
int XLALREAL4AverageSpectrumMedianMean(REAL4FrequencySeries *spectrum, const REAL4TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL4Window *window, const REAL4FFTPlan *plan)
Median-Mean Method: divide overlapping segments into "even" and "odd" segments; compute the bin-by-bi...
int XLALREAL8AverageSpectrumMedianMean(REAL8FrequencySeries *spectrum, const REAL8TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL8Window *window, const REAL8FFTPlan *plan)
Median-Mean Method: divide overlapping segments into "even" and "odd" segments; compute the bin-by-bi...
int XLALREAL4SpectrumInvertTruncate(REAL4FrequencySeries *spectrum, REAL4 lowfreq, UINT4 seglen, UINT4 trunclen, REAL4FFTPlan *fwdplan, REAL4FFTPlan *revplan)
UNDOCUMENTED.
const LALUnit lalSecondUnit
second [s]
const LALUnit lalHertzUnit
Hertz [Hz].
LALUnit * XLALUnitDivide(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
UNDOCUMENTED.
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
This function multiplies together the LALUnit structures *(input->unitOne) and *(input->unitTwo),...
LALUnit * XLALUnitRaiseINT2(LALUnit *output, const LALUnit *input, INT2 power)
Raises a LALUnit structure to an integer power power.
LALUnit * XLALUnitSquare(LALUnit *output, const LALUnit *input)
Produces the square of a LALUnit structure.
LALUnit * XLALUnitSqrt(LALUnit *output, const LALUnit *input)
Produces the square-root of a LALUnit structure.
COMPLEX16Vector * XLALCreateCOMPLEX16Vector(UINT4 length)
void XLALDestroyREAL4Vector(REAL4Vector *vector)
REAL4Vector * XLALCreateREAL4Vector(UINT4 length)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
void XLALDestroyCOMPLEX16Vector(COMPLEX16Vector *vector)
COMPLEX8Vector * XLALCreateCOMPLEX8Vector(UINT4 length)
void XLALDestroyCOMPLEX8Vector(COMPLEX8Vector *vector)
REAL4Sequence * XLALUnitaryWindowREAL4Sequence(REAL4Sequence *sequence, const REAL4Window *window)
Single-precision version of XLALUnitaryWindowREAL8Sequence().
REAL8Sequence * XLALUnitaryWindowREAL8Sequence(REAL8Sequence *sequence, const REAL8Window *window)
Multiply a REAL8Sequence in-place by a REAL8Window with a normalization that preserves the variance o...
#define XLAL_ERROR_NULL(...)
Macro to invoke a failure from a XLAL routine returning a pointer.
#define xlalErrno
Modifiable lvalue containing the XLAL error number.
#define XLAL_ERROR(...)
Macro to invoke a failure from a XLAL routine returning an integer.
@ XLAL_EBADLEN
Inconsistent or invalid length.
@ XLAL_ENOMEM
Memory allocation error.
@ XLAL_EDATA
Invalid data.
@ XLAL_EFAULT
Invalid pointer.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
@ XLAL_EDOM
Input domain error.
@ XLAL_EINVAL
Invalid argument.
@ XLAL_FAILURE
Failure return value (not an error number)
See DATATYPE-FrequencySeries types for documentation.
Vector of type COMPLEX16, see DATATYPE-Vector types for more details.
UINT4 length
Number of elements in array.
COMPLEX16 * data
Pointer to the data array.
See DATATYPE-FrequencySeries types for documentation.
Vector of type COMPLEX8, see DATATYPE-Vector types for more details.
UINT4 length
Number of elements in array.
COMPLEX8 * data
Pointer to the data array.
This structure stores units in the mksA system (plus Kelvin, Strain, and ADC Count).
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.
LALUnit sampleUnits
The physical units of the quantity being sampled.
REAL8 deltaT
The time step between samples of the time series in seconds.
LIGOTimeGPS epoch
The start time of the time series.
REAL8 f0
The heterodyning frequency, in Hertz (zero if not heterodyned).
Vector of type REAL4, see DATATYPE-Vector types for more details.
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...
See DATATYPE-FrequencySeries types for documentation.
Time series of REAL8 data, see DATATYPE-TimeSeries types for more details.
REAL8Sequence * data
The sequence of sampled data.
LALUnit sampleUnits
The physical units of the quantity being sampled.
REAL8 f0
The heterodyning frequency, in Hertz (zero if not heterodyned).
REAL8 deltaT
The time step between samples of the time series in seconds.
LIGOTimeGPS epoch
The start time of the time series.
Vector of type REAL8, see DATATYPE-Vector types for more details.
REAL8 * data
Pointer to the data array.
UINT4 length
Number of elements in array.
Structure for storing REAL8 window function data, providing storage for a sequence of samples as well...
REAL8Sequence * data
The window function samples.
REAL8 sumofsquares
The sum of the squares of the window function samples.