78 const unsigned int aDataDuration,
79 const unsigned int aDataSamplingFrequency,
80 const unsigned int aVerbosity=0);
119 bool AddData(
const unsigned int aDataSize,
121 const unsigned int aDataStart=0,
122 const bool aMute=
false);
133 bool LoadData(
const unsigned int aDataSize,
135 const unsigned int aDataStart=0,
136 const bool aMute=
false);
153 double GetPower(
const double aFrequency);
160 inline double GetPower(
const unsigned int aFrequencyIndex){
170 return TMath::Sqrt(
GetPower(aFrequency));
185 TGraph*
GetPSD(
const double aFrequencyMin,
const double aFrequencyMax);
199 TGraph*
GetASD(
const double aFrequencyMin,
const double aFrequencyMax);
207 TGraph*
GetPeriodogram(
const unsigned int aParity,
const unsigned int aIndex);
Fast Fourier transform wrapper for FFTW.
Monitor a GWOLLUM processing.
Definition Monitor.h:39
bool GetStatus(void)
Returns the object status.
Definition Monitor.h:109
Compute the noise power spectral density.
Definition Spectrum.h:58
double GetPower(const double aFrequency)
Returns the current PSD value at a given frequency.
Definition Spectrum.cc:132
unsigned int sampling
Data sampling frequency [Hz].
Definition Spectrum.h:264
TGraph * GetPSD(void)
Returns a copy of the current PSD as a TGraph.
Definition Spectrum.cc:344
void Reset(void)
Resets the current PSD and the periodogram circular buffer.
Definition Spectrum.cc:107
TGraph * GetAmplitudePeriodogram(const unsigned int aParity, const unsigned int aIndex)
Returns a copy of a given (amplitude) periodogram.
Definition Spectrum.cc:441
TGraph * GetASD(void)
Returns a copy of the current ASD as a TGraph.
Definition Spectrum.cc:383
unsigned int GetSpectrumNyquist(void)
Returns the Nyquist frequency of the spectrum [Hz].
Definition Spectrum.h:245
Monitor * mon
Class monitor.
Definition Spectrum.h:263
double GetSpectrumResolution(void)
Returns the frequency resolution of the spectrum [Hz]: .
Definition Spectrum.h:240
double ** periodogram[2]
Buffer for periodograms.
Definition Spectrum.h:271
void ComputeMedianMean(const bool aMute=false)
Computes the median-mean PSD.
Definition Spectrum.cc:252
double * HannWindow
Hann window vector.
Definition Spectrum.h:270
bool AddData(const unsigned int aDataSize, const double *aData, const unsigned int aDataStart=0, const bool aMute=false)
Loads a data vector and updates the current PSD.
Definition Spectrum.cc:172
unsigned int GetDataBufferLength(void)
Returns the effective circular buffer length [s] used to compute the PSD.
Definition Spectrum.h:259
Spectrum(const unsigned int aSpectrumSize, const unsigned int aDataDuration, const unsigned int aDataSamplingFrequency, const unsigned int aVerbosity=0)
Constructor of the Spectrum class.
bool WritePeriodogram(const string aOutFileName)
Writes periodograms and the resulting PSD in a ROOT file.
Definition Spectrum.cc:455
TGraph * GetPeriodogram(const unsigned int aParity, const unsigned int aIndex)
Returns a copy of a given periodogram.
Definition Spectrum.cc:422
double GetAmplitude(const double aFrequency)
Returns the current ASD value at a given frequency.
Definition Spectrum.h:169
bool GetStatus(void)
Returns the class status.
Definition Spectrum.h:93
virtual ~Spectrum(void)
Destructor of the Spectrum class.
Definition Spectrum.cc:93
bool LoadData(const unsigned int aDataSize, const double *aData, const unsigned int aDataStart=0, const bool aMute=false)
Loads a data vector and computes a new PSD.
Definition Spectrum.cc:235
double GetPower(const unsigned int aFrequencyIndex)
Returns the current PSD value at a given frequency index.
Definition Spectrum.h:160
unsigned int GetNSubSegmentsMax(const unsigned int aParity)
Returns the maximum number of sub-segments in the buffer.
Definition Spectrum.h:252
unsigned int write_index[2]
Write index in the buffer.
Definition Spectrum.h:272
double GetSpectrumFrequency(const unsigned int aIndex)
Returns the frequency of a given spectrum frequency index [Hz].
Definition Spectrum.h:233
bool IsBufferFull(void)
Tests if the buffer of periodograms is full.
Definition Spectrum.cc:326
unsigned int GetSpectrumSize(void)
Returns the number of points in the spectrum: .
Definition Spectrum.h:227
fft * fft_psd
FFT plan to compute the PSD.
Definition Spectrum.h:274
unsigned int nSubSegments[2]
Number of even/odd sub-subsegments.
Definition Spectrum.h:267
Wrap and optimize FFTW.
Definition FFT.h:19
unsigned int GetSize_f(void)
Returns the size of the frequency-domain vector.
Definition FFT.h:266
double GetRe_f(const unsigned int aIndex)
Returns the real part of a frequency-domain data vector element.
Definition FFT.h:141
unsigned int GetSize_t(void)
Returns the size of the time-domain vector.
Definition FFT.h:261