77 const unsigned int aDataDuration,
78 const unsigned int aDataSamplingFrequency,
79 const unsigned int aVerbosity=0);
112 bool AddData(
const unsigned int aDataSize,
114 const unsigned int aDataStart=0);
124 bool LoadData(
const unsigned int aDataSize,
126 const unsigned int aDataStart=0);
137 double GetPower(
const double aFrequency);
144 inline double GetPower(
const unsigned int aFrequencyIndex){
145 return fft_psd->GetRe_f(aFrequencyIndex);
154 return TMath::Sqrt(GetPower(aFrequency));
161 TGraph* GetPSD(
void);
169 TGraph* GetPSD(
const double aFrequencyMin,
const double aFrequencyMax);
175 TGraph* GetASD(
void);
183 TGraph* GetASD(
const double aFrequencyMin,
const double aFrequencyMax);
191 TGraph* GetPeriodogram(
const unsigned int aParity,
const unsigned int aIndex);
199 TGraph* GetAmplitudePeriodogram(
const unsigned int aParity,
const unsigned int aIndex);
206 bool WritePeriodogram(
const string aOutFileName);
218 return (
double)aIndex*(double)sampling/(
double)fft_psd->GetSize_t();
230 return (
unsigned int)(GetSpectrumResolution()*(double)fft_psd->GetSize_f()); };
237 return nSubSegments[aParity%2];
251 unsigned int nSubSegments[2];
255 double **periodogram[2];
256 unsigned int write_index[2];
260 void ComputeMedianMean(
void);
Fast Fourier transform wrapper for FFTW.
Compute the noise power spectral density.
Definition: Spectrum.h:57
unsigned int sampling
Data sampling frequency [Hz].
Definition: Spectrum.h:248
unsigned int fVerbosity
Verbosity level.
Definition: Spectrum.h:243
unsigned int GetSpectrumNyquist(void)
Returns the Nyquist frequency of the spectrum [Hz].
Definition: Spectrum.h:229
double GetSpectrumResolution(void)
Returns the frequency resolution of the spectrum [Hz]: .
Definition: Spectrum.h:224
double * HannWindow
Hann window vector.
Definition: Spectrum.h:254
unsigned int GetDataBufferLength(void)
Returns the effective circular buffer length [s] used to compute the PSD.
Definition: Spectrum.h:243
Spectrum(const unsigned int aSpectrumSize, const unsigned int aDataDuration, const unsigned int aDataSamplingFrequency, const unsigned int aVerbosity=0)
Constructor of the Spectrum class.
double GetAmplitude(const double aFrequency)
Returns the current ASD value at a given frequency.
Definition: Spectrum.h:153
double GetPower(const unsigned int aFrequencyIndex)
Returns the current PSD value at a given frequency index.
Definition: Spectrum.h:144
unsigned int GetNSubSegmentsMax(const unsigned int aParity)
Returns the maximum number of sub-segments in the buffer.
Definition: Spectrum.h:236
double GetSpectrumFrequency(const unsigned int aIndex)
Returns the frequency of a given spectrum frequency index [Hz].
Definition: Spectrum.h:217
unsigned int GetSpectrumSize(void)
Returns the number of points in the spectrum: .
Definition: Spectrum.h:211
fft * fft_psd
FFT plan to compute the PSD.
Definition: Spectrum.h:258
Wrap and optimize FFTW.
Definition: FFT.h:19