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

Create a time-frequency map for the Q-transform. More...

#include <Omap.h>

Inheritance diagram for Omap:

Public Member Functions

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...
 
Constructors and destructors
 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...
 

Protected Attributes

TH2D * tfmap
 Time-frequency map. More...
 

Private Attributes

unsigned int * bandMultiple
 Band multiple (time resolution). More...
 
long unsigned int Ntiles
 Number of tiles in the tf map. More...
 
double q
 Q factor.
More...
 

Friends

class Otile
 

Detailed Description

Create a time-frequency map for the Q-transform.

This class is designed to create and use a multi-resolution time-frequency map. The time-frequency map is represented by a 2-dimensional histogram with a TH2D object. The vertical axis is binned logarithmically in frequency [Hz]. Each frequency band is simply called a band. Each band is binned linearly in time (horizontal axis), and the number of bins in a band is a power of two.

Constructor & Destructor Documentation

◆ Omap()

Omap::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.

An empty time-frequency map is created.

Warning
The parameters must verify some conditions to perform a Q-transform, or else they will be automatically adjusted:
  • The time range \(T\) must be an even number of seconds.
  • The time range \(T\) must be at least 4 seconds.
  • The minimum frequency must be larger than \(\frac{4Q}{2\pi \times T}\).
  • The maximum frequency must be smaller than \(\frac{f_s/2}{1+\sqrt{11}/Q}\).
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.

◆ ~Omap()

Omap::~Omap ( void  )
virtual

Destructor of the Omap class.

Member Function Documentation

◆ GetBandEnd()

double Omap::GetBandEnd ( const unsigned int  aBandIndex)
inline

Returns the band frequency end [Hz].

Parameters
[in]aBandIndexBand index.

◆ GetBandFrequency()

double Omap::GetBandFrequency ( const unsigned int  aBandIndex)
inline

Returns the band central frequency [Hz].

Parameters
[in]aBandIndexBand index.

◆ GetBandIndex()

int Omap::GetBandIndex ( const double  aFrequency)
inline

Returns the band index for a given frequency.

Parameters
[in]aFrequencyFrequency [Hz].

◆ GetBandN()

unsigned int Omap::GetBandN ( void  )
inline

Returns the number of frequency bands in the map.

◆ GetBands()

double * Omap::GetBands ( void  )

Returns the list of frequency bands.

The returned array is of size GetBandN()+1 and contains the bin limits.

Warning
The returned array must be deleted by the user.

◆ GetBandStart()

double Omap::GetBandStart ( const unsigned int  aBandIndex)
inline

Returns the band frequency start [Hz].

Parameters
[in]aBandIndexBand index.

◆ GetBandTileN()

unsigned int Omap::GetBandTileN ( const unsigned int  aBandIndex)
inline

Returns the number of tiles in a band.

Parameters
[in]aBandIndexBand index.

◆ GetBandWidth()

double Omap::GetBandWidth ( const unsigned int  aBandIndex)
inline

Returns the band width [Hz].

Parameters
[in]aBandIndexBand index.

◆ GetFrequencyMax()

double Omap::GetFrequencyMax ( void  )
inline

Returns the map frequency maximum [Hz].

◆ GetFrequencyMin()

double Omap::GetFrequencyMin ( void  )
inline

Returns the map frequency minimum [Hz].

◆ GetQ()

double Omap::GetQ ( void  )
inline

Returns the Q factor.

◆ GetTileContent()

double Omap::GetTileContent ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the content of a tile.

Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ GetTileDuration()

double Omap::GetTileDuration ( const unsigned int  aBandIndex)
inline

Returns the tile duration [s].

Parameters
[in]aBandIndexBand index.

◆ GetTileN() [1/2]

long unsigned int Omap::GetTileN ( const double  aPadding)

Returns the number of tiles in the map.

Parameters
[in]aPaddingNumber of seconds excluded on both sides of the time range.
Precondition
The padding value is not checked! Make sure it is compatible with the map time range.

◆ GetTileN() [2/2]

long unsigned int Omap::GetTileN ( void  )
inline

Returns the number of tiles in the map.

◆ GetTileTime()

double Omap::GetTileTime ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the central time of a tile [s].

Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ GetTileTimeEnd()

double Omap::GetTileTimeEnd ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the end time of a tile [s].

Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ GetTileTimeStart()

double Omap::GetTileTimeStart ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex 
)
inline

Returns the start time of a tile [s].

Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.

◆ GetTimeMax()

double Omap::GetTimeMax ( void  )
inline

Returns the map time maximum [s].

◆ GetTimeMin()

double Omap::GetTimeMin ( void  )
inline

Returns the map time minimum [s].

◆ GetTimeRange()

unsigned int Omap::GetTimeRange ( void  )
inline

Returns the map time range [s].

◆ GetTimeTileIndex()

int Omap::GetTimeTileIndex ( const unsigned int  aBandIndex,
const double  aTime 
)
inline

Returns the index of a tile in a band.

Warning
The returned index might be out-of range.
Parameters
[in]aBandIndexBand index.
[in]aTimeTime [s].

◆ PrintParameters()

void Omap::PrintParameters ( void  )

Prints the map parameters.

◆ SetTileContent()

void Omap::SetTileContent ( const unsigned int  aTimeTileIndex,
const unsigned int  aBandIndex,
const double  aContent 
)
inline

Sets the content of a tile.

Parameters
[in]aTimeTileIndexTile index in the band.
[in]aBandIndexBand index.
[in]aContentContent.

◆ Write()

int Omap::Write ( TFile *  aFile,
const string  aName 
)
inline

Writes the time-frequency map to a ROOT file.

Returns
The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.
Parameters
[in]aFilePointer to an open TFile.
[in]aNameMap name.

Friends And Related Function Documentation

◆ Otile

friend class Otile
friend

Member Data Documentation

◆ bandMultiple

unsigned int* Omap::bandMultiple
private

Band multiple (time resolution).

◆ Ntiles

long unsigned int Omap::Ntiles
private

Number of tiles in the tf map.

◆ q

double Omap::q
private

Q factor.

◆ tfmap

TH2D* Omap::tfmap
protected

Time-frequency map.


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