LALPulsar  6.1.0.1-fe68b98
NormalizeSFTRngMed.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Reinhard Prix
3 * Copyright (C) 2007 Badri Krishnan, Reinhard Prix
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with with program; see the file COPYING. If not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301 USA
19 */
20 
21 #include <lal/NormalizeSFTRngMed.h>
22 
23 /**
24  * \addtogroup NormalizeSFTRngMed_h
25  * \author Badri Krishnan and Alicia Sintes
26  * \brief Normalizes SFTs based on their noise floor calculated using the running median
27  *
28  * History: Created by B. Krishnan Aug, 2004
29  * Taken from SFTbin.c and PeakSelect.c from Hough code
30  *
31  * ### Description ###
32  *
33  * This module contains functions for normalizing SFTs. Currently two normalizations
34  * are supported. Given SFT data \f$ \tilde{x}_k \f$ where \f$ k \f$ labels a frequency bin,
35  * the normalized SFT is either \f$ \tilde{x}_k/\sqrt{ < |\tilde{x}_k|^2 >} \f$ or
36  * \f$ \sqrt{2N} \tilde{x}_k/\sqrt{ < |\tilde{x}_k|^2 >} \f$ , where \f$ N \f$ is the number
37  * of frequency bins in the SFT. The first normalization
38  * ensures that the SFT power follows an exponential distribution with unit mean
39  * (if the SFT data is distributed normally), while the second normalization is appropriate
40  * in the time domain. In either case, the mean of \f$ |\tilde{x}_k|^2 \f$ is
41  * estimated using the median, suitably normalized assuming that the power is
42  * distributed is exponentially.
43  *
44  * ### Uses ###
45  *
46  * \code
47  * XLALSFTtoPeriodogram ()
48  * XLALPeriodoToRngmed ()
49  * XLALNormalizeSFT ()
50  * XLALNormalizeSFTVect ()
51  * XLALNormalizeMultiSFTVect ()
52  * \endcode
53  *
54  * The function XLALNormalizeSFTVect() takes as input a vector of SFTs and normalizes
55  * them. This function calls the functions XLALNormalizeSFT() which normalizes a
56  * single SFT, XLALSFTtoPeriodogram() which calculates the \f$ |\tilde{x}|^2 \f$ and
57  * XLALPeriodoToRngmed () which applies the running median algorithm to find a vector
58  * of medians. The function XLALNormalizeMultiSFTVect() normalizes a multi-IFO collection
59  * of SFT vectors and also returns a collection of power-estimates for these vectors using
60  * the Running median method.
61  *
62  */
63 
64 /**
65  * Normalize an sft based on RngMed estimated PSD, and returns running-median.
66  */
67 int
68 XLALNormalizeSFT( REAL8FrequencySeries *rngmed, /**< [out] rng-median smoothed periodogram over SFT (Tsft*Sn/2) (must be allocated) */
69  SFTtype *sft, /**< SFT to be normalized */
70  UINT4 blockSize, /**< Running median block size for rngmed calculation */
71  const REAL8 assumeSqrtS /**< If >0, instead assume sqrt(S) value *instead* of calculating PSD from running median */
72  )
73 {
74  /* check input argments */
75  XLAL_CHECK( sft && sft->data && sft->data->data && sft->data->length > 0, XLAL_EINVAL, "Invalid NULL or zero-length input in 'sft'" );
76 
77  XLAL_CHECK( rngmed && rngmed->data && rngmed->data->data && rngmed->data->length > 0, XLAL_EINVAL, "Invalid NULL or zero-length input in 'rngmed'" );
78  /* make sure there is no size mismatch */
79  UINT4 length = sft->data->length;
80  XLAL_CHECK( length == rngmed->data->length, XLAL_EINVAL, "SFT length (%d) differs from rngmed length (%d)", length, rngmed->data->length );
81 
82  XLAL_CHECK( assumeSqrtS >= 0.0, XLAL_EINVAL );
83 
84  if ( assumeSqrtS == 0 ) {
85  /* calculate the rngmed */
86  XLAL_CHECK( XLALSFTtoRngmed( rngmed, sft, blockSize ) == XLAL_SUCCESS, XLAL_EFUNC, "XLALSFTtoRngmed() failed" );
87  } else {
88  // copy whole SFT header info to be on the safe side (deltaF definitely needed for Tsft=1/deltaF later)
89  strcpy( rngmed->name, sft->name );
90  rngmed->epoch = sft->epoch;
91  rngmed->f0 = sft->f0;
92  rngmed->deltaF = sft->deltaF;
93  rngmed->sampleUnits = sft->sampleUnits;
94 
95  /* set PSD to constant value: Tsft * S / 2 = Tsft * (sqrt(S))^2 / 2 */
96  const REAL8 Tsft = 1.0 / sft->deltaF;
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;
100  }
101  }
102 
103  /* loop over sft and normalize */
104  for ( UINT4 j = 0; j < length; j++ ) {
105  REAL8 Tsft_Sn_b2 = rngmed->data->data[j]; /* Wiener-Kinchine: E[|data|^2] = Tsft * Sn / 2 */
106  REAL8 norm = 1.0 / sqrt( Tsft_Sn_b2 );
107  /* frequency domain normalization */
108  sft->data->data[j] *= ( ( REAL4 ) norm );
109  } // for j < length
110 
111  return XLAL_SUCCESS;
112 
113 } /* XLALNormalizeSFT() */
114 
115 
116 /**
117  * Function for normalizing a vector of SFTs.
118  */
119 int
120 XLALNormalizeSFTVect( SFTVector *sftVect, /**< [in/out] pointer to a vector of SFTs which will be normalized */
121  UINT4 blockSize, /**< Running median window size */
122  const REAL8 assumeSqrtS /**< If >0, instead assume sqrt(S) value *instead* of calculating PSD from running median */
123  )
124 {
125  /* check input argments */
126  XLAL_CHECK( sftVect && sftVect->data && sftVect->length > 0, XLAL_EINVAL, "Invalid NULL or zero-length input in 'sftVect'" );
127 
128  /* memory allocation of rngmed using length of first sft -- assume all sfts have the same length*/
129  UINT4 lengthsft = sftVect->data->data->length;
130 
131  /* allocate memory for a single rngmed */
132  REAL8FrequencySeries *rngmed;
133  XLAL_CHECK( ( rngmed = XLALCalloc( 1, sizeof( *rngmed ) ) ) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1,%zu)", sizeof( *rngmed ) );
134  XLAL_CHECK( ( rngmed->data = XLALCreateREAL8Vector( lengthsft ) ) != NULL, XLAL_EFUNC, "XLALCreateREAL8Vector ( %d ) failed.", lengthsft );
135 
136  /* loop over sfts and normalize them */
137  for ( UINT4 j = 0; j < sftVect->length; j++ ) {
138  SFTtype *sft = &sftVect->data[j];
139 
140  /* call sft normalization function */
141  XLAL_CHECK( XLALNormalizeSFT( rngmed, sft, blockSize, assumeSqrtS ) == XLAL_SUCCESS, XLAL_EFUNC, "XLALNormalizeSFT() failed." );
142 
143  } /* for j < sftVect->length */
144 
145  /* free memory for psd */
146  XLALDestroyREAL8Vector( rngmed->data );
147  XLALFree( rngmed );
148 
149  return XLAL_SUCCESS;
150 
151 } /* XLALNormalizeSFTVect() */
152 
153 
154 /**
155  * Function for normalizing a multi vector of SFTs in a multi IFO search and
156  * returns the running-median estimates of the power.
157  */
159 XLALNormalizeMultiSFTVect( MultiSFTVector *multsft, /**< [in/out] multi-vector of SFTs which will be normalized */
160  UINT4 blockSize, /**< Running median window size */
161  const MultiNoiseFloor *assumeSqrtSX /**< If !NULL, instead assume sqrt(S^X) values *instead* of calculating PSD from running median */
162  )
163 {
164  /* check input argments */
165  XLAL_CHECK_NULL( multsft && multsft->data && multsft->length > 0, XLAL_EINVAL, "Invalid NULL or zero-length input 'multsft'" );
166  XLAL_CHECK_NULL( assumeSqrtSX == NULL || assumeSqrtSX->length == multsft->length, XLAL_EINVAL );
167 
168  /* allocate multipsd structure */
169  MultiPSDVector *multiPSD;
170  XLAL_CHECK_NULL( ( multiPSD = XLALCalloc( 1, sizeof( *multiPSD ) ) ) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1, sizeof(*multiPSD))" );
171 
172  UINT4 numifo = multsft->length;
173  multiPSD->length = numifo;
174  XLAL_CHECK_NULL( ( multiPSD->data = XLALCalloc( numifo, sizeof( *multiPSD->data ) ) ) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc ( %d, %zu)", numifo, sizeof( *multiPSD->data ) );
175 
176  /* loop over ifos */
177  for ( UINT4 X = 0; X < numifo; X++ ) {
178  UINT4 numsft = multsft->data[X]->length;
179 
180  /* allocation of psd vector over SFTs for this detector X */
181  XLAL_CHECK_NULL( ( multiPSD->data[X] = XLALCalloc( 1, sizeof( *multiPSD->data[X] ) ) ) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1, %zu)", sizeof( *multiPSD->data[X] ) );
182 
183  multiPSD->data[X]->length = numsft;
184  XLAL_CHECK_NULL( ( multiPSD->data[X]->data = XLALCalloc( numsft, sizeof( *( multiPSD->data[X]->data ) ) ) ) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc ( %d, %zu)", numsft, sizeof( *( multiPSD->data[X]->data ) ) );
185 
186  /* loop over sfts for this IFO X */
187  for ( UINT4 j = 0; j < numsft; j++ ) {
188  SFTtype *sft = &multsft->data[X]->data[j];
189 
190  /* memory allocation of psd vector for this SFT */
191  UINT4 lengthsft = sft->data->length;
192  XLAL_CHECK_NULL( ( multiPSD->data[X]->data[j].data = XLALCreateREAL8Vector( lengthsft ) ) != NULL, XLAL_EFUNC, "XLALCreateREAL8Vector(%d) failed.", lengthsft );
193 
194  /* if assumeSqrtSX is not given, pass 0.0 to calculate PSD from running median */
195  const REAL8 assumeSqrtS = ( assumeSqrtSX != NULL ) ? assumeSqrtSX->sqrtSn[X] : 0.0;
196 
197  XLAL_CHECK_NULL( XLALNormalizeSFT( &multiPSD->data[X]->data[j], sft, blockSize, assumeSqrtS ) == XLAL_SUCCESS, XLAL_EFUNC, "XLALNormalizeSFT() failed" );
198 
199  } /* for j < numsft */
200 
201  } /* for X < numifo */
202 
203  return multiPSD;
204 
205 } /* XLALNormalizeMultiSFTVect() */
206 
207 
208 /**
209  * Calculates a smoothed (running-median) periodogram for the given SFT.
210  */
211 int
212 XLALSFTtoRngmed( REAL8FrequencySeries *rngmed, /**< [out] running-median smoothed periodo [must be allocated!] */
213  const SFTtype *sft, /**< [in] input SFT */
214  UINT4 blockSize /**< Running median block size */
215  )
216 {
217  /* check argments */
218  XLAL_CHECK( sft != NULL, XLAL_EINVAL, "Invalid NULL pointer passed in 'sft'" );
219  XLAL_CHECK( sft->data != NULL, XLAL_EINVAL, "Invalid NULL pointer in sft->data" );
220  XLAL_CHECK( sft->data->length > 0, XLAL_EINVAL, "Zero-length SFT passed (sft->data->length=0)" );
221  XLAL_CHECK( sft->data->data != NULL, XLAL_EINVAL, "Invalid NULL data in sft->data->data" );
222  XLAL_CHECK( rngmed != NULL, XLAL_EINVAL, "Invalid NULL pointer passed in 'rngmed'" );
223  XLAL_CHECK( rngmed->data != NULL, XLAL_EINVAL, "Invalid NULL pointer in rngmed->data" );
224  XLAL_CHECK( rngmed->data->length == sft->data->length, XLAL_EINVAL, "Allocated rngmed data-vector has to have same length (%d) as the SFT (%d)",
225  rngmed->data->length, sft->data->length );
226  XLAL_CHECK( rngmed->data->data != NULL, XLAL_EINVAL, "Invalid NULL pointer in rngmed->data->data" );
227 
228  UINT4 length = sft->data->length;
229 
230  REAL8FrequencySeries periodo;
231  XLAL_CHECK( ( periodo.data = XLALCreateREAL8Vector( length ) ) != NULL, XLAL_EFUNC, "Failed to allocate periodo.data of length %d", length );
232 
233  /* calculate the periodogram */
234  XLAL_CHECK( XLALSFTtoPeriodogram( &periodo, sft ) == XLAL_SUCCESS, XLAL_EFUNC, "Call to XLALSFTtoPeriodogram() failed.\n" );
235 
236  /* calculate the rngmed */
237  if ( blockSize > 0 ) {
238  XLAL_CHECK( XLALPeriodoToRngmed( rngmed, &periodo, blockSize ) == XLAL_SUCCESS, XLAL_EFUNC, "Call to XLALPeriodoToRngmed() failed." );
239  } else { // blockSize==0 means don't use any running-median, just *copy* the periodogram contents into the output
240  strcpy( rngmed->name, periodo.name );
241  rngmed->epoch = periodo.epoch;
242  rngmed->f0 = periodo.f0;
243  rngmed->deltaF = periodo.deltaF;
244  rngmed->sampleUnits = periodo.sampleUnits;
245  memcpy( rngmed->data->data, periodo.data->data, periodo.data->length * sizeof( periodo.data->data[0] ) );
246  }
247 
248  /* free memory */
249  XLALFree( periodo.data->data );
250  XLALFree( periodo.data );
251 
252  return XLAL_SUCCESS;
253 
254 } /* XLALSFTtoRngmed() */
255 
256 /**
257  * Calculate the "periodogram" of an SFT, ie the modulus-squares of the SFT-data.
258  */
259 int
260 XLALSFTtoPeriodogram( REAL8FrequencySeries *periodo, /**< [out] mod squares of SFT data (has to be allocated) */
261  const COMPLEX8FrequencySeries *SFT /**< [in] input SFT */
262  )
263 {
264  /* check input argments */
265  XLAL_CHECK( SFT != NULL, XLAL_EINVAL, "Invalid NULL pointer passed in 'SFT'" );
266  XLAL_CHECK( SFT->data != NULL, XLAL_EINVAL, "Invalid NULL pointer in SFT->data" );
267  XLAL_CHECK( SFT->data->length > 0, XLAL_EINVAL, "Zero-length SFT passed (SFT->data->length=0)" );
268  XLAL_CHECK( SFT->data->data != NULL, XLAL_EINVAL, "Invalid NULL data in SFT->data->data" );
269  XLAL_CHECK( periodo != NULL, XLAL_EINVAL, "Invalid NULL pointer passed in 'periodo'" );
270  XLAL_CHECK( periodo->data != NULL, XLAL_EINVAL, "Invalid NULL pointer in periodo->data" );
271  XLAL_CHECK( periodo->data->length == SFT->data->length, XLAL_EINVAL, "Allocated periodo data-vector has to have same length (%d) as the SFT (%d)",
272  periodo->data->length, SFT->data->length );
273  XLAL_CHECK( periodo->data->data != NULL, XLAL_EINVAL, "Invalid NULL pointer in periodo->data->data" );
274 
275  /* copy SFT header */
276  strcpy( periodo->name, SFT->name );
277  periodo->epoch = SFT->epoch;
278  periodo->f0 = SFT->f0;
279  periodo->deltaF = SFT->deltaF;
280 
281  /* check lengths are same */
282  UINT4 length = SFT->data->length;
283  REAL8 *out = periodo->data->data;
284  COMPLEX8 *in = SFT->data->data;
285 
286  for ( UINT4 j = 0; j < length; j++ ) {
287  /* extra-paranoia: make absolutely sure that the calculation below is in REAL8
288  * in order to avoid underflow-problems (data 'in' can be of order ~ 1e-20 )
289  */
290  *out = ( ( REAL8 )crealf( *in ) ) * ( ( REAL8 )crealf( *in ) ) + ( ( REAL8 )cimagf( *in ) ) * ( ( REAL8 )cimagf( *in ) );
291  ++out;
292  ++in;
293  } // for j<length
294 
295  return XLAL_SUCCESS;
296 
297 } /* XLALSFTtoPeriodogram() */
298 
299 /**
300  * Calculates running median over a single periodogram.
301  */
302 int
303 XLALPeriodoToRngmed( REAL8FrequencySeries *rngmed, /**< [out] resulting 'smoothed' periodogram (must be allocated) */
304  const REAL8FrequencySeries *periodo, /**< [in] input periodogram */
305  UINT4 blockSize /**< Running median block size */
306  )
307 {
308  /* check input argments are not NULL */
309  XLAL_CHECK( periodo != NULL && periodo->data != NULL && periodo->data->data && periodo->data->length > 0,
310  XLAL_EINVAL, "Invalid input 'periodo': needs to be allocated and non-zero length" );
311  XLAL_CHECK( rngmed != NULL && rngmed->data != NULL && rngmed->data->data != NULL && rngmed->data->length > 0,
312  XLAL_EINVAL, "Invalid input 'rngmend': needs to be allocated and non-zero length" );
313  UINT4 length = periodo->data->length;
314  XLAL_CHECK( length == rngmed->data->length,
315  XLAL_EINVAL, "'periodo' vector must be same length (%d) as 'rngmed' vector (%d)", periodo->data->length, rngmed->data->length );
316  XLAL_CHECK( blockSize > 0, XLAL_EINVAL, "'blockSize = %d' must be > 0", blockSize );
317  XLAL_CHECK( length >= blockSize, XLAL_EINVAL, "Need at least %d bins in SFT (have %d) to perform running median!\n", blockSize, length );
318 
319  /* copy periodogram header */
320  strcpy( rngmed->name, periodo->name );
321  rngmed->epoch = periodo->epoch;
322  rngmed->f0 = periodo->f0;
323  rngmed->deltaF = periodo->deltaF;
324 
325  UINT4 blocks2 = blockSize / 2; /* integer division, round down */
326 
327  LALRunningMedianPar rngMedPar;
328  rngMedPar.blocksize = blockSize;
329  REAL8Sequence mediansV, inputV;
330  inputV.length = length;
331  inputV.data = periodo->data->data;
332  UINT4 medianVLength = length - blockSize + 1;
333  mediansV.length = medianVLength;
334  mediansV.data = rngmed->data->data + blocks2;
335 
337  LALDRunningMedian2( &status, &mediansV, &inputV, rngMedPar );
338  XLAL_CHECK( status.statusCode == 0, XLAL_EFAILED, "LALDRunningMedian2() failed with statusCode = %d", status.statusCode );
339 
340  /* copy values in the wings */
341  for ( UINT4 j = 0; j < blocks2; j++ ) {
342  rngmed->data->data[j] = rngmed->data->data [ blocks2 ];
343  }
344 
345  for ( UINT4 j = blocks2 + medianVLength; j < length; j++ ) {
346  rngmed->data->data[j] = rngmed->data->data [ blocks2 + medianVLength - 1 ];
347  }
348 
349  /* get the bias factor -- for estimating the mean from the median */
350  REAL8 medianBias = XLALRngMedBias( blockSize );
351  XLAL_CHECK( xlalErrno == 0, XLAL_EFUNC, "XLALRngMedBias() failed" );
352 
353  /* normalize by the bias factor */
354  REAL8 medianBiasInv = 1.0 / medianBias;
355  for ( UINT4 j = 0; j < length; j++ ) {
356  rngmed->data->data[j] *= medianBiasInv;
357  }
358 
359  return XLAL_SUCCESS;
360 
361 } /* XLALPeriodoToRngmed() */
362 
363 
364 /**
365  * Calculate the cross-correlation periodogram from 2 SFTs.
366  */
367 int
368 XLALSFTstoCrossPeriodogram( REAL8FrequencySeries *periodo, /**< [out] modulus square of SFT data (must be allocated) */
369  const COMPLEX8FrequencySeries *sft1, /**< [in] pointer to first SFT */
370  const COMPLEX8FrequencySeries *sft2 /**< [in] pointer to second SFT */
371  )
372 {
373  /* check input argments */
374  XLAL_CHECK( periodo && periodo->data && periodo->data->data && periodo->data->length > 0,
375  XLAL_EINVAL, "Invalid NULL or zero-length input 'periodo'" );
376 
377  XLAL_CHECK( sft1 && sft1->data && sft1->data->data && sft1->data->length > 0,
378  XLAL_EINVAL, "Invalud NULL or zero-length input 'sft1'" );
379 
380  XLAL_CHECK( sft2 && sft2->data && sft2->data->data && sft2->data->length > 0,
381  XLAL_EINVAL, "Invalud NULL or zero-length input 'sft2'" );
382 
383  /* make sure both sfts are consistent in frequency and freq. band
384  -- time stamps need not be consistent */
385  XLAL_CHECK( sft2->data->length == sft1->data->length, XLAL_EINVAL, "SFT lengths differ len1 = %d, len2 = %d", sft1->data->length, sft2->data->length );
386  XLAL_CHECK( sft2->f0 == sft1->f0, XLAL_EINVAL, "SFT start-frequencies differ f0_1 = %g, f0_2 = %g", sft1->f0, sft2->f0 );
387  XLAL_CHECK( sft2->deltaF == sft1->deltaF, XLAL_EINVAL, "SFT frequency spacings differ deltaF_1 = %g, deltaF_2 = %g", sft1->deltaF, sft2->deltaF );
388 
389  /* copy values from SFT */
390  /* periodo->epoch.gpsSeconds = sft1->epoch.gpsSeconds; */
391  /* periodo->epoch.gpsNanoSeconds = sft1->epoch.gpsNanoSeconds; */
392  periodo->f0 = sft1->f0;
393  periodo->deltaF = sft1->deltaF;
394 
395  /* check lengths are same */
396  UINT4 length = sft1->data->length;
397  XLAL_CHECK( length == periodo->data->length, XLAL_EINVAL, "SFT length (%d) differs from periodo length (%d)", length, periodo->data->length );
398 
399  REAL8 *out = periodo->data->data;
400  COMPLEX8 *in1 = sft1->data->data;
401  COMPLEX8 *in2 = sft2->data->data;
402 
403  for ( UINT4 j = 0; j < length; j++ ) {
404  /* extra-paranoia: make absolutely sure that the calculation below is in REAL8
405  * in order to avoid underflow-problems (data 'in' can be of order ~ 1e-20 )
406  */
407  *out = ( ( REAL8 )crealf( *in1 ) ) * ( ( REAL8 )crealf( *in2 ) ) + ( ( REAL8 )cimagf( *in1 ) ) * ( ( REAL8 )cimagf( *in2 ) );
408  ++out;
409  ++in1;
410  ++in2;
411  } // for j < length
412 
413  return XLAL_SUCCESS;
414 
415 } /* XLALSFTstoCrossPeriodogram() */
int j
double REAL8
#define XLAL_INIT_DECL(var,...)
uint32_t UINT4
float complex COMPLEX8
float REAL4
void * XLALCalloc(size_t m, size_t n)
void XLALFree(void *p)
void LALDRunningMedian2(LALStatus *status, REAL8Sequence *medians, const REAL8Sequence *input, LALRunningMedianPar param)
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 xlalErrno
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EINVAL
XLAL_EFAILED
out
CHAR name[LALNameLength]
COMPLEX8Sequence * data
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
COMPLEX8 * data
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.
Definition: PSDutils.h:62
PSDVector ** data
sftvector for each ifo
Definition: PSDutils.h:67
UINT4 length
number of ifos
Definition: PSDutils.h:66
A collection of SFT vectors – one for each IFO in a multi-IFO search.
Definition: SFTfileIO.h:179
UINT4 length
number of ifos
Definition: SFTfileIO.h:183
SFTVector ** data
sftvector for each ifo
Definition: SFTfileIO.h:184
REAL8Sequence * data
CHAR name[LALNameLength]
REAL8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
REAL8 * data