Omicron  4.1.1
An algorithm to detect and characterize transient events in gravitational-wave detectors
Oqplane Class Reference

Create a time-frequency Q-plane. More...

#include <Oqplane.h>

Inheritance diagram for Oqplane:
Collaboration diagram for Oqplane:

Public Member Functions

void AddTileSegments (Segments *aSegments, TH1D *aSnrThreshold, const double aT0, const double aPadding)
 Adds tile segments to a Segments structure. More...
 
void FillMap (const string aContentType, const double aTimeStart, const double aTimeEnd)
 Fills the Q-plane map. More...
 
double GetSnrSqMax (void)
 Returns the maximum SNR squared estimated in the entire Q plane. More...
 
double GetSnrThr (void)
 Gets the tile SNR threshold. More...
 
double GetTileAmplitude (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the amplitude estimated in a tile. More...
 
double GetTileAmplitudeSq (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the amplitude squared estimated in a tile. More...
 
double GetTileSnrSq (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the SNR squared estimated in a tile. More...
 
long unsigned int ProjectData (fft *aDataFft, const double aPadding=0.0)
 Projects a whitened data vector onto the Q-plane. More...
 
bool SaveTriggers (TriggerBuffer *aTriggers, const double aT0, Segments *aSeg)
 Fills a trigger structure with tiles above the SNR threshold. More...
 
void SetPower (Spectrum *aSpec1, Spectrum *aSpec2)
 Computes the noise power associated to each frequency band. More...
 
void SetSnrThr (const double aSnrThr=2.0)
 Sets the tile SNR threshold. More...
 
Constructors and destructors
 Oqplane (const double aQ, const unsigned int aSampleFrequency, const double aFrequencyMin, const double aFrequencyMax, const unsigned int aTimeRange, const double aMaximumMismatch)
 Constructor of the Oqplane class. More...
 
virtual ~Oqplane (void)
 Destructor of the Oqplane class. More...
 
- Public Member Functions inherited from Omap
double GetBandEnd (const unsigned int aBandIndex)
 Returns the band frequency end [Hz]. More...
 
double GetBandFrequency (const unsigned int aBandIndex)
 Returns the band central frequency [Hz]. More...
 
int GetBandIndex (const double aFrequency)
 Returns the band index for a given frequency. More...
 
unsigned int GetBandN (void)
 Returns the number of frequency bands in the map. More...
 
double * GetBands (void)
 Returns the list of frequency bands. More...
 
double GetBandStart (const unsigned int aBandIndex)
 Returns the band frequency start [Hz]. More...
 
unsigned int GetBandTileN (const unsigned int aBandIndex)
 Returns the number of tiles in a band. More...
 
double GetBandWidth (const unsigned int aBandIndex)
 Returns the band width [Hz]. More...
 
double GetFrequencyMax (void)
 Returns the map frequency maximum [Hz]. More...
 
double GetFrequencyMin (void)
 Returns the map frequency minimum [Hz]. More...
 
double GetQ (void)
 Returns the Q factor. More...
 
double GetTileContent (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the content of a tile. More...
 
double GetTileDuration (const unsigned int aBandIndex)
 Returns the tile duration [s]. More...
 
long unsigned int GetTileN (const double aPadding)
 Returns the number of tiles in the map. More...
 
long unsigned int GetTileN (void)
 Returns the number of tiles in the map. More...
 
double GetTileTime (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the central time of a tile [s]. More...
 
double GetTileTimeEnd (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the end time of a tile [s]. More...
 
double GetTileTimeStart (const unsigned int aTimeTileIndex, const unsigned int aBandIndex)
 Returns the start time of a tile [s]. More...
 
double GetTimeMax (void)
 Returns the map time maximum [s]. More...
 
double GetTimeMin (void)
 Returns the map time minimum [s]. More...
 
unsigned int GetTimeRange (void)
 Returns the map time range [s]. More...
 
int GetTimeTileIndex (const unsigned int aBandIndex, const double aTime)
 Returns the index of a tile in a band. More...
 
void PrintParameters (void)
 Prints the map parameters. More...
 
void SetTileContent (const unsigned int aTimeTileIndex, const unsigned int aBandIndex, const double aContent)
 Sets the content of a tile. More...
 
int Write (TFile *aFile, const string aName)
 Writes the time-frequency map to a ROOT file. More...
 
 Omap (const double aQ, const unsigned int aSampleFrequency, const double aFrequencyMin, const double aFrequencyMax, const unsigned int aTimeRange, const double aMaximumMismatch)
 Constructor of the Omap class. More...
 
virtual ~Omap (void)
 Destructor of the Omap class. More...
 

Private Attributes

fft ** bandFFT
 Band ffts. More...
 
double * bandNoiseAmplitude
 Band noise amplitude. More...
 
double ** bandWindow_i
 Band bisquare windows (imaginary). More...
 
double ** bandWindow_r
 Band bisquare windows (real). More...
 
unsigned int * bandWindowSize
 Band bisquare window size. More...
 
double SnrSqMax
 Maximum SNR squared in the Q plane. More...
 
double SnrThr
 SNR threshold to save tiles. More...
 

Additional Inherited Members

- Protected Attributes inherited from Omap
TH2D * tfmap
 Time-frequency map. More...
 

Detailed Description

Create a time-frequency Q-plane.

This class is designed to create and use a time-frequency Q-plane defined by a Q value. The time-frequency map is described using the Omap class. In addition, this class creates a bisquare window for each frequency row which is used to performed the Q-transform. The Q-transform of whitened data is performed with ProjectData(). The result of the Q-transform can be used to fill the time-frequency map (FillMap()) and/or to fill a trigger structure (SaveTriggers()).

Constructor & Destructor Documentation

◆ Oqplane()

Oqplane::Oqplane ( const double  aQ,
const unsigned int  aSampleFrequency,
const double  aFrequencyMin,
const double  aFrequencyMax,
const unsigned int  aTimeRange,
const double  aMaximumMismatch 
)

Constructor of the Oqplane class.

An empty time-frequency map is created with Omap::Omap(). In addition, for each frequency band, a fast fourier transform is initialized, as well as bisquare windows.

Parameters
[in]aQQ factor \(Q\).
[in]aSampleFrequencySampling frequency [Hz] \(f_s\).
[in]aFrequencyMinMinimum frequency [Hz].
[in]aFrequencyMaxMaximum frequency [Hz].
[in]aTimeRangeTime range \(T\) [s]. The map is centered on 0.
[in]aMaximumMismatchMaximum mismatch between 2 consecutive tiles.

◆ ~Oqplane()

Oqplane::~Oqplane ( void  )
virtual

Destructor of the Oqplane class.

Member Function Documentation

◆ AddTileSegments()

void Oqplane::AddTileSegments ( Segments *  aSegments,
TH1D *  aSnrThreshold,
const double  aT0,
const double  aPadding 
)

Adds tile segments to a Segments structure.

The tiling structure is scanned. The tile start and end times are added as a segment to the input segment structure if the tile SNR is above a given threshold.

The SNR threshold is given as a TH1D histogram binned in tile frequency. The bin content is the SNR threshold.

Note
For bins with a negative content, the SNR threshold is considered to be infinite.
Tiles with a frequency outside the histogram frequency range are excluded.
Parameters
[in,out]aSegmentsSegments structure in which tile segments will be added. This object must be created before calling this function.
[in]aSnrThresholdSNR threshold histogram.
[in]aT0Reference time to center the time-frequency map [s].
[in]aPaddingNumber of seconds excluded on both sides of the tiling structure when selecting tiles above the SNR threshold.

◆ FillMap()

void Oqplane::FillMap ( const string  aContentType,
const double  aTimeStart,
const double  aTimeEnd 
)

Fills the Q-plane map.

The Q-plane tiles are filled with:

  • the SNR if "snr" is specified as a content type.
  • the amplitude if "amplitude" is specified as a content type.
  • the phase if "phase" is specified as a content type.
  • a demo tiling for any other type.
Parameters
[in]aContentTypeContent type.
[in]aTimeStartTime after which to fill the map [s].
[in]aTimeEndTime before which to fill the map [s].

◆ GetSnrSqMax()

double Oqplane::GetSnrSqMax ( void  )
inline

Returns the maximum SNR squared estimated in the entire Q plane.

◆ GetSnrThr()

double Oqplane::GetSnrThr ( void  )
inline

Gets the tile SNR threshold.

◆ GetTileAmplitude()

double Oqplane::GetTileAmplitude ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the amplitude estimated in a tile.

Warning
This function returns meaningful data only if the data noise power spectrum was previously set with SetPower().
Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ GetTileAmplitudeSq()

double Oqplane::GetTileAmplitudeSq ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the amplitude squared estimated in a tile.

Warning
This function returns meaningful data only if the data noise power spectrum was previously set with SetPower().
Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ GetTileSnrSq()

double Oqplane::GetTileSnrSq ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the SNR squared estimated in a tile.

See also
ProjectData().
Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ ProjectData()

long unsigned int Oqplane::ProjectData ( fft *  aDataFft,
const double  aPadding = 0.0 
)

Projects a whitened data vector onto the Q-plane.

The input whitened data vector is shifted in frequency to match the frequency bands. Then it is multiplied by the band bisquare window. Finally the inverse Fourier transform is performed for each frequency row to obtain SNR values for each tile.

The number of tiles with a SNR above the threshold set with SetSnrThr() is counted. Tiles on both edges of the time range can be excluded using a padding parameter.

Returns
The number of tiles above the SNR threshold.
Note
This function does not fill the time-frequency map. To fill the map, call FillMap().
Parameters
[in]aDataFftWhitened data vector in the fourier domain.
[in]aPaddingNumber of seconds excluded on both sides of the time range when counting tiles above the SNR threshold.
Precondition
The padding value is not checked! Make sure it is compatible with the map time range.

◆ SaveTriggers()

bool Oqplane::SaveTriggers ( TriggerBuffer *  aTriggers,
const double  aT0,
Segments *  aSeg 
)

Fills a trigger structure with tiles above the SNR threshold.

By construction, the time-frequency map is centered on 0. This central time can be shifted to a physical time with 'aT0'. Moreover a time selection is applied using a segment list. Only tiles with a central time (after the time shift) inside these segments are saved.

Parameters
[in]aTriggersTrigger structure (must be valid!)
[in]aT0Reference time to center the time-frequency map [s].
[in]aSegSegment list to select the tiles to save.

◆ SetPower()

void Oqplane::SetPower ( Spectrum *  aSpec1,
Spectrum *  aSpec2 
)

Computes the noise power associated to each frequency band.

For each frequency band, the Spectrum object is integrated over the frequency range. The power is weighted by the bisquare window.

Parameters
[in]aSpec1First noise power spectrum used to whiten the data.
[in]aSpec2Second noise power spectrum used to whiten the data.

◆ SetSnrThr()

void Oqplane::SetSnrThr ( const double  aSnrThr = 2.0)
inline

Sets the tile SNR threshold.

Parameters
[in]aSnrThrSNR threshold.

Member Data Documentation

◆ bandFFT

fft** Oqplane::bandFFT
private

Band ffts.

◆ bandNoiseAmplitude

double* Oqplane::bandNoiseAmplitude
private

Band noise amplitude.

◆ bandWindow_i

double** Oqplane::bandWindow_i
private

Band bisquare windows (imaginary).

◆ bandWindow_r

double** Oqplane::bandWindow_r
private

Band bisquare windows (real).

◆ bandWindowSize

unsigned int* Oqplane::bandWindowSize
private

Band bisquare window size.

◆ SnrSqMax

double Oqplane::SnrSqMax
private

Maximum SNR squared in the Q plane.

◆ SnrThr

double Oqplane::SnrThr
private

SNR threshold to save tiles.


The documentation for this class was generated from the following files: