21 #include <lal/LALStdlib.h>
22 #include <lal/LALConstants.h>
23 #include <lal/TimeSeries.h>
24 #include <lal/FrequencySeries.h>
25 #include <lal/TimeFreqFFT.h>
26 #include <lal/Units.h>
27 #include <lal/LALSimUtils.h>
68 first = round(f0 - old->
f0) / deltaF;
71 if (first >=0 && old->
data->
length >= length + first)
87 kmin = ceil((old->
f0 - f0) / deltaF);
97 for (k = 0; k < kmin; ++k)
98 new->data->data[k] = 0.0;
99 for (k = kmax; k < length; ++k)
100 new->data->data[k] = 0.0;
102 for (k = kmin; k < kmax; ++k) {
107 x = modf((f0 + k * deltaF - old->
f0) / old->
deltaF, &ix);
111 y0 = ix < 0.0 ? 0.0 : old->
data->
data[
i];
114 if (y0 == 0.0 || y1 == 0.0)
115 new->data->data[k] = 0.0;
117 new->data->data[k] = exp((1.0 -
x) * log(y0) +
x * log(y1));
244 return Mpc * snr / snr_8;
299 LALUnit strainSquaredPerHertzUnit = { 0, { 0, 0, 1, 0, 0, 2, 0}, { 0, 0, 0, 0, 0, 0, 0} };
301 size_t k, k_min, k_max;
311 double mu = m1 * m2 /
M;
324 if (f_max < 0 || f_max > f_isco)
328 if (
f_min < 0 || f_min <= psd->f0)
354 for (k = k_min; k <= k_max; ++k) {
356 double f = psd->
f0 + k * psd->
deltaF;
366 x = pow(f, -7.0/3.0) / psd->
data->
data[k] +
e;
381 A_1_Mpc = -sqrt(5.0 / 24.0 /
LAL_PI);
385 A_1_Mpc *= pow(
M, 1.0/3.0);
387 return fabs(A_1_Mpc) * sqrt(
sum);
477 size_t k, k_min, k_max;
499 if (
f_min < 0 || f_min <= htilde->f0)
527 for (k = k_min; k <= k_max; ++k) {
600 new_length = (size_t)ldexp(1.0, length_exp);
608 if (!hpadded || !plan || !htilde) {
static REAL8FrequencySeries * create_interpolated_psd(double f0, double deltaF, size_t length, const REAL8FrequencySeries *old)
Creates a new interpolated psd from an existing psd (if necessary).
static REAL8 sum(REAL8 *arr1, REAL8 *arr2, int k)
static LALUnit strainSquaredPerHertzUnit
REAL8FrequencySeries * XLALCreateREAL8FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
REAL8FrequencySeries * XLALResizeREAL8FrequencySeries(REAL8FrequencySeries *series, int first, size_t length)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
REAL8FrequencySeries * XLALCutREAL8FrequencySeries(const REAL8FrequencySeries *series, size_t first, size_t length)
void XLALDestroyREAL8FrequencySeries(REAL8FrequencySeries *series)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
double XLALMeasureStandardSirenHorizonDistance(const REAL8FrequencySeries *psd, double f_min, double f_max)
Computes the horizon distance for a binary neutron star standard siren signal for a given one-sided d...
double XLALMeasureStandardSirenSenseMonitorRange(const REAL8FrequencySeries *psd, double f_min, double f_max)
Computes the sense-monitor range for a binary neutron star standard siren signal for a given one-side...
#define LAL_HORIZON_DISTANCE_OVER_SENSEMON_RANGE
Ratio of horizon distance to sense-monitor range.
double XLALMeasureSNR(const REAL8TimeSeries *h, const REAL8FrequencySeries *psd, double f_min, double f_max)
Measures the characteristic signal-to-noise ratio of a gravitational waveform.
double XLALMeasureSNRFD(const COMPLEX16FrequencySeries *htilde, const REAL8FrequencySeries *psd, double f_min, double f_max)
Measures the characteristic signal-to-noise ratio of a gravitational waveform represented in the freq...
double XLALMeasureStandardSirenSNR(const REAL8FrequencySeries *psd, double f_min, double f_max)
Computes the characteristic signal-to-noise for a binary neutron star standard siren signal located a...
void XLALDestroyREAL8FFTPlan(REAL8FFTPlan *plan)
REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan(UINT4 size, int measurelvl)
int XLALREAL8TimeFreqFFT(COMPLEX16FrequencySeries *freq, const REAL8TimeSeries *tser, const REAL8FFTPlan *plan)
REAL8TimeSeries * XLALResizeREAL8TimeSeries(REAL8TimeSeries *series, int first, size_t length)
REAL8TimeSeries * XLALCutREAL8TimeSeries(const REAL8TimeSeries *series, size_t first, size_t length)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
int XLALUnitIsDimensionless(const LALUnit *unit)
REAL8 XLALUnitPrefactor(const LALUnit *unit)
const LALUnit lalHertzUnit
const LALUnit lalDimensionlessUnit
LALUnit * XLALUnitDivide(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
LALUnit * XLALUnitSquare(LALUnit *output, const LALUnit *input)
#define XLAL_ERROR_REAL8(...)
#define XLAL_CHECK_REAL8(assertion,...)
#define XLAL_IS_REAL8_FAIL_NAN(val)