Omicron
4.1.1
An algorithm to detect and characterize transient events in gravitational-wave detectors
|
Create a time-frequency Q-plane. More...
#include <Oqplane.h>
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... | |
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()).
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.
[in] | aQ | Q factor \(Q\). |
[in] | aSampleFrequency | Sampling frequency [Hz] \(f_s\). |
[in] | aFrequencyMin | Minimum frequency [Hz]. |
[in] | aFrequencyMax | Maximum frequency [Hz]. |
[in] | aTimeRange | Time range \(T\) [s]. The map is centered on 0. |
[in] | aMaximumMismatch | Maximum mismatch between 2 consecutive tiles. |
|
virtual |
Destructor of the Oqplane class.
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.
[in,out] | aSegments | Segments structure in which tile segments will be added. This object must be created before calling this function. |
[in] | aSnrThreshold | SNR threshold histogram. |
[in] | aT0 | Reference time to center the time-frequency map [s]. |
[in] | aPadding | Number of seconds excluded on both sides of the tiling structure when selecting tiles above the SNR threshold. |
void Oqplane::FillMap | ( | const string | aContentType, |
const double | aTimeStart, | ||
const double | aTimeEnd | ||
) |
Fills the Q-plane map.
The Q-plane tiles are filled with:
[in] | aContentType | Content type. |
[in] | aTimeStart | Time after which to fill the map [s]. |
[in] | aTimeEnd | Time before which to fill the map [s]. |
|
inline |
Returns the maximum SNR squared estimated in the entire Q plane.
|
inline |
Gets the tile SNR threshold.
|
inline |
Returns the amplitude estimated in a tile.
[in] | aTimeTileIndex | Tile index in the band. |
[in] | aBandIndex | Band index. |
|
inline |
Returns the amplitude squared estimated in a tile.
[in] | aTimeTileIndex | Tile index in the band. |
[in] | aBandIndex | Band index. |
|
inline |
Returns the SNR squared estimated in a tile.
[in] | aTimeTileIndex | Tile index in the band. |
[in] | aBandIndex | Band index. |
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.
[in] | aDataFft | Whitened data vector in the fourier domain. |
[in] | aPadding | Number of seconds excluded on both sides of the time range when counting tiles above the SNR threshold. |
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.
[in] | aTriggers | Trigger structure (must be valid!) |
[in] | aT0 | Reference time to center the time-frequency map [s]. |
[in] | aSeg | Segment list to select the tiles to save. |
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.
[in] | aSpec1 | First noise power spectrum used to whiten the data. |
[in] | aSpec2 | Second noise power spectrum used to whiten the data. |
|
inline |
Sets the tile SNR threshold.
[in] | aSnrThr | SNR threshold. |
|
private |
Band ffts.
|
private |
Band noise amplitude.
|
private |
Band bisquare windows (imaginary).
|
private |
Band bisquare windows (real).
|
private |
Band bisquare window size.
|
private |
Maximum SNR squared in the Q plane.
|
private |
SNR threshold to save tiles.