21 #include <lal/NormalizeSFTRngMed.h>
71 const REAL8 assumeSqrtS
84 if ( assumeSqrtS == 0 ) {
97 const REAL8 assume_Tsft_Sn_b2 =
Tsft * assumeSqrtS * assumeSqrtS / 2;
98 for (
UINT4 j = 0;
j < length;
j++ ) {
99 rngmed->
data->
data[
j] = assume_Tsft_Sn_b2;
104 for (
UINT4 j = 0;
j < length;
j++ ) {
106 REAL8 norm = 1.0 / sqrt( Tsft_Sn_b2 );
122 const REAL8 assumeSqrtS
173 multiPSD->
length = numifo;
177 for (
UINT4 X = 0; X < numifo; X++ ) {
187 for (
UINT4 j = 0;
j < numsft;
j++ ) {
195 const REAL8 assumeSqrtS = ( assumeSqrtSX != NULL ) ? assumeSqrtSX->
sqrtSn[X] : 0.0;
237 if ( blockSize > 0 ) {
240 strcpy( rngmed->
name, periodo.
name );
242 rngmed->
f0 = periodo.
f0;
278 periodo->
f0 = SFT->
f0;
286 for (
UINT4 j = 0;
j < length;
j++ ) {
290 *
out = ( (
REAL8 )crealf( *in ) ) * ( (
REAL8 )crealf( *in ) ) + ( (
REAL8 )cimagf( *in ) ) * ( (
REAL8 )cimagf( *in ) );
310 XLAL_EINVAL,
"Invalid input 'periodo': needs to be allocated and non-zero length" );
312 XLAL_EINVAL,
"Invalid input 'rngmend': needs to be allocated and non-zero length" );
317 XLAL_CHECK( length >= blockSize,
XLAL_EINVAL,
"Need at least %d bins in SFT (have %d) to perform running median!\n", blockSize, length );
320 strcpy( rngmed->
name, periodo->
name );
322 rngmed->
f0 = periodo->
f0;
325 UINT4 blocks2 = blockSize / 2;
332 UINT4 medianVLength = length - blockSize + 1;
333 mediansV.
length = medianVLength;
341 for (
UINT4 j = 0;
j < blocks2;
j++ ) {
345 for (
UINT4 j = blocks2 + medianVLength;
j < length;
j++ ) {
354 REAL8 medianBiasInv = 1.0 / medianBias;
355 for (
UINT4 j = 0;
j < length;
j++ ) {
375 XLAL_EINVAL,
"Invalid NULL or zero-length input 'periodo'" );
378 XLAL_EINVAL,
"Invalud NULL or zero-length input 'sft1'" );
381 XLAL_EINVAL,
"Invalud NULL or zero-length input 'sft2'" );
392 periodo->
f0 = sft1->
f0;
403 for (
UINT4 j = 0;
j < length;
j++ ) {
407 *
out = ( (
REAL8 )crealf( *in1 ) ) * ( (
REAL8 )crealf( *in2 ) ) + ( (
REAL8 )cimagf( *in1 ) ) * ( (
REAL8 )cimagf( *in2 ) );
#define XLAL_INIT_DECL(var,...)
void * XLALCalloc(size_t m, size_t n)
int XLALNormalizeSFT(REAL8FrequencySeries *rngmed, SFTtype *sft, UINT4 blockSize, const REAL8 assumeSqrtS)
Normalize an sft based on RngMed estimated PSD, and returns running-median.
MultiPSDVector * XLALNormalizeMultiSFTVect(MultiSFTVector *multsft, UINT4 blockSize, const MultiNoiseFloor *assumeSqrtSX)
Function for normalizing a multi vector of SFTs in a multi IFO search and returns the running-median ...
int XLALSFTstoCrossPeriodogram(REAL8FrequencySeries *periodo, const COMPLEX8FrequencySeries *sft1, const COMPLEX8FrequencySeries *sft2)
Calculate the cross-correlation periodogram from 2 SFTs.
int XLALNormalizeSFTVect(SFTVector *sftVect, UINT4 blockSize, const REAL8 assumeSqrtS)
Function for normalizing a vector of SFTs.
int XLALPeriodoToRngmed(REAL8FrequencySeries *rngmed, const REAL8FrequencySeries *periodo, UINT4 blockSize)
Calculates running median over a single periodogram.
int XLALSFTtoPeriodogram(REAL8FrequencySeries *periodo, const COMPLEX8FrequencySeries *SFT)
Calculate the "periodogram" of an SFT, ie the modulus-squares of the SFT-data.
int XLALSFTtoRngmed(REAL8FrequencySeries *rngmed, const SFTtype *sft, UINT4 blockSize)
Calculates a smoothed (running-median) periodogram for the given SFT.
REAL8 XLALRngMedBias(INT4 blkSize)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
array of detector-specific 'noise floors' (ie PSD values), assumed constant over the frequency-band o...
REAL8 sqrtSn[PULSAR_MAX_DETECTORS]
per-IFO sqrt(PSD) values , where
UINT4 length
number of detectors
A collection of PSD vectors – one for each IFO in a multi-IFO search.
PSDVector ** data
sftvector for each ifo
UINT4 length
number of ifos
A collection of SFT vectors – one for each IFO in a multi-IFO search.
UINT4 length
number of ifos
SFTVector ** data
sftvector for each ifo
REAL8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.