#include <lal/LALDatatypes.h>#include <lal/ComplexFFT.h>#include <lal/RealFFT.h>#include <lal/Window.h>Include dependency graph for TimeFreqFFT.h:

Go to the source code of this file.
| #define TIMEFREQFFTH_ENULL 1 |
Definition at line 81 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_ESIZE 2 |
Definition at line 82 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_ERATE 4 |
Definition at line 83 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_ESIGN 4 |
Definition at line 84 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EALLOC 16 |
Definition at line 85 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EPOSARG 32 |
Definition at line 86 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EMALLOC 64 |
Definition at line 87 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EINCOMP 128 |
Definition at line 88 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_ENNUL 256 |
Definition at line 89 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EZSEG 512 |
Definition at line 90 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EZOVR 1024 |
Definition at line 91 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EMISM 2048 |
Definition at line 92 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_EUAVG 4096 |
Definition at line 93 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGENULL "Null pointer" |
Definition at line 95 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGESIZE "Invalid size" |
Definition at line 96 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGERATE "Invalid rate" |
Definition at line 97 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGESIGN "Incorrect plan sign" |
Definition at line 98 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEALLOC "Pointer has already been allocated, should be null" |
Definition at line 99 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEPOSARG "Argument must be positive" |
Definition at line 100 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEMALLOC "Malloc failure" |
Definition at line 101 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEINCOMP "Incompatible arguments" |
Definition at line 102 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGENNUL "Non-null pointer" |
Definition at line 103 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEZSEG "Segment length is zero" |
Definition at line 104 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEZOVR "Overlap length is zero" |
Definition at line 105 of file TimeFreqFFT.h.
Definition at line 106 of file TimeFreqFFT.h.
| #define TIMEFREQFFTH_MSGEUAVG "Unknown average power spectum method" |
Definition at line 107 of file TimeFreqFFT.h.
| typedef struct tagAverageSpectrumParams AverageSpectrumParams |
| enum AvgSpecMethod |
Definition at line 137 of file TimeFreqFFT.h.
| NRCSID | ( | TIMEFREQFFTH | , | |
| "$Id: TimeFreqFFT. | h, | |||
| v 1.20 2007/07/12 22:33:51 jolien Exp $" | ||||
| ) |
| int XLALREAL4TimeFreqFFT | ( | COMPLEX8FrequencySeries * | freq, | |
| REAL4TimeSeries * | tser, | |||
| REAL4FFTPlan * | plan | |||
| ) |
Definition at line 186 of file TimeFreqFFT.c.
| int XLALREAL4FreqTimeFFT | ( | REAL4TimeSeries * | tser, | |
| COMPLEX8FrequencySeries * | freq, | |||
| REAL4FFTPlan * | plan | |||
| ) |
Definition at line 226 of file TimeFreqFFT.c.
| int XLALREAL8TimeFreqFFT | ( | COMPLEX16FrequencySeries * | freq, | |
| REAL8TimeSeries * | tser, | |||
| REAL8FFTPlan * | plan | |||
| ) |
Definition at line 270 of file TimeFreqFFT.c.
| int XLALREAL8FreqTimeFFT | ( | REAL8TimeSeries * | tser, | |
| COMPLEX16FrequencySeries * | freq, | |||
| REAL8FFTPlan * | plan | |||
| ) |
Definition at line 310 of file TimeFreqFFT.c.
| int XLALCOMPLEX8TimeFreqFFT | ( | COMPLEX8FrequencySeries * | freq, | |
| COMPLEX8TimeSeries * | tser, | |||
| COMPLEX8FFTPlan * | plan | |||
| ) |
Definition at line 364 of file TimeFreqFFT.c.
| int XLALCOMPLEX8FreqTimeFFT | ( | COMPLEX8TimeSeries * | tser, | |
| COMPLEX8FrequencySeries * | freq, | |||
| COMPLEX8FFTPlan * | plan | |||
| ) |
Definition at line 428 of file TimeFreqFFT.c.
| int XLALCOMPLEX16TimeFreqFFT | ( | COMPLEX16FrequencySeries * | freq, | |
| COMPLEX16TimeSeries * | tser, | |||
| COMPLEX16FFTPlan * | plan | |||
| ) |
Definition at line 509 of file TimeFreqFFT.c.
| int XLALCOMPLEX16FreqTimeFFT | ( | COMPLEX16TimeSeries * | tser, | |
| COMPLEX16FrequencySeries * | freq, | |||
| COMPLEX16FFTPlan * | plan | |||
| ) |
Definition at line 573 of file TimeFreqFFT.c.
| 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.
Definition at line 43 of file AverageSpectrum.c.
| 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.
Definition at line 132 of file AverageSpectrum.c.
| 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.
See: Peter D. Welch "The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on Time Averaging Over Short, Modified Periodograms" IEEE Transactions on Audio and Electroacoustics, Vol. AU-15, No. 2, June 1967.
Definition at line 226 of file AverageSpectrum.c.
| 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.
See: Peter D. Welch "The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on Time Averaging Over Short, Modified Periodograms" IEEE Transactions on Audio and Electroacoustics, Vol. AU-15, No. 2, June 1967.
Definition at line 325 of file AverageSpectrum.c.
Definition at line 422 of file AverageSpectrum.c.
| 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.
Note: this will cause a bias if the segments overlap, i.e., if the stride is less than the segment length -- even though the median bias for Gaussian noise is accounted for -- because the segments are not independent and their correlation is non-zero.
Definition at line 489 of file AverageSpectrum.c.
| 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.
Note: this will cause a bias if the segments overlap, i.e., if the stride is less than the segment length -- even though the median bias for Gaussian noise is accounted for -- because the segments are not independent and their correlation is non-zero.
Definition at line 630 of file AverageSpectrum.c.
| 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-bin median of the "even" segments and the "odd" segments, and then take the bin-by-bin average of these two median averages.
Definition at line 812 of file AverageSpectrum.c.
| 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-bin median of the "even" segments and the "odd" segments, and then take the bin-by-bin average of these two median averages.
Definition at line 994 of file AverageSpectrum.c.
| int XLALREAL4SpectrumInvertTruncate | ( | REAL4FrequencySeries * | spectrum, | |
| REAL4 | lowfreq, | |||
| UINT4 | seglen, | |||
| UINT4 | trunclen, | |||
| REAL4FFTPlan * | fwdplan, | |||
| REAL4FFTPlan * | revplan | |||
| ) |
Definition at line 1169 of file AverageSpectrum.c.
| int XLALREAL8SpectrumInvertTruncate | ( | REAL8FrequencySeries * | spectrum, | |
| REAL8 | lowfreq, | |||
| UINT4 | seglen, | |||
| UINT4 | trunclen, | |||
| REAL8FFTPlan * | fwdplan, | |||
| REAL8FFTPlan * | revplan | |||
| ) |
Definition at line 1267 of file AverageSpectrum.c.
| COMPLEX8FrequencySeries* XLALWhitenCOMPLEX8FrequencySeries | ( | COMPLEX8FrequencySeries * | fseries, | |
| const REAL4FrequencySeries * | psd, | |||
| REAL8 | fmin, | |||
| REAL8 | fmax | |||
| ) |
Normalize a COMPLEX8 frequency series to a REAL4 average PSD.
If the frequency series is the Fourier transform of (coloured) Gaussian random noise, and the PSD is of the same noise, and both have been computed according to the LAL technical specifications (LIGO-T010095-00-Z), then the output frequency series' bins will be complex Gaussian random variables with mean squares of 1 (the real and imaginary components, individually, have variances of 1/2). Fourier transforms computed by XLALREAL4ForwardFFT(), and PSDs computed by XLALREAL4AverageSpectrumMedian() and friends conform to the LAL technical specifications.
PSDs computed from high- or low-passed data can include 0s at one or the other end of the spectrum, and these would normally result in divide-by-zero errors. This routine avoids PSD divide-by-zero errors by permitting zeroes in the PSD outside of the band given by fmin <= f < fmax. The fmin and fmax parameters set the frequency band ``of interest''. Divide-by-zero errors within the band of interest are reported, while divide-by-zero errors outside the band of interest are ignored and the output frequency series zeroed in the affected bins.
The input PSD is allowed to span a larger frequency band than the input frequency series, but the frequency resolutions of the two must be the same. The frequency series is modified in place. The return value is the input frequency series pointer on success, or NULL on error. When an error occurs, the contents of the input frequency series are undefined.
Definition at line 1395 of file AverageSpectrum.c.
| COMPLEX16FrequencySeries* XLALWhitenCOMPLEX16FrequencySeries | ( | COMPLEX16FrequencySeries * | fseries, | |
| const REAL8FrequencySeries * | psd, | |||
| REAL8 | fmin, | |||
| REAL8 | fmax | |||
| ) |
Double-precision version of XLALWhitenCOMPLEX8FrequencySeries().
Definition at line 1447 of file AverageSpectrum.c.
| void LALTimeFreqRealFFT | ( | LALStatus * | status, | |
| COMPLEX8FrequencySeries * | fser, | |||
| REAL4TimeSeries * | tser, | |||
| RealFFTPlan * | plan | |||
| ) |
Definition at line 647 of file TimeFreqFFT.c.
| void LALFreqTimeRealFFT | ( | LALStatus * | status, | |
| REAL4TimeSeries * | tser, | |||
| COMPLEX8FrequencySeries * | fser, | |||
| RealFFTPlan * | plan | |||
| ) |
Definition at line 678 of file TimeFreqFFT.c.
| void LALREAL4AverageSpectrum | ( | LALStatus * | status, | |
| REAL4FrequencySeries * | fSeries, | |||
| REAL4TimeSeries * | tSeries, | |||
| AverageSpectrumParams * | params | |||
| ) |
Definition at line 785 of file TimeFreqFFT.c.
| void LALCOMPLEX8AverageSpectrum | ( | LALStatus * | status, | |
| COMPLEX8FrequencySeries * | fSeries, | |||
| REAL4TimeSeries * | tSeries0, | |||
| REAL4TimeSeries * | tSeries1, | |||
| AverageSpectrumParams * | params | |||
| ) |
Definition at line 1011 of file TimeFreqFFT.c.
| void LALTimeFreqComplexFFT | ( | LALStatus * | status, | |
| COMPLEX8FrequencySeries * | fser, | |||
| COMPLEX8TimeSeries * | tser, | |||
| ComplexFFTPlan * | plan | |||
| ) |
Definition at line 1189 of file TimeFreqFFT.c.
| void LALFreqTimeComplexFFT | ( | LALStatus * | status, | |
| COMPLEX8TimeSeries * | tser, | |||
| COMPLEX8FrequencySeries * | fser, | |||
| ComplexFFTPlan * | plan | |||
| ) |
Definition at line 1222 of file TimeFreqFFT.c.
1.5.2