Omicron
4.1.1
An algorithm to detect and characterize transient events in gravitational-wave detectors
|
Inject sinusoidal Gaussian waveforms. More...
#include <Oinject.h>
Public Member Functions | |
double | GetAmplitude (void) |
Returns the injection amplitude \(A\). More... | |
double | GetAmplitudeMax (void) |
Returns the maximum amplitude \(A_{max}\). More... | |
double | GetAmplitudeMin (void) |
Returns the minimum amplitude \(A_{min}\). More... | |
double | GetFrequency (void) |
Returns the injection frequency \(\phi\) [Hz]. More... | |
double | GetFrequencyMax (void) |
Returns the maximum frequency \(\phi_{max}\) [Hz]. More... | |
double | GetFrequencyMin (void) |
Returns the minimum frequency \(\phi_{min}\) [Hz]. More... | |
double | GetPhase (void) |
Returns the injection phase \(\varphi\). More... | |
double | GetQ (void) |
Returns the injection Q \(Q\). More... | |
double | GetQMax (void) |
Returns the maximum Q \(Q_{max}\). More... | |
double | GetQMin (void) |
Returns the minimum Q \(Q_{min}\). More... | |
double | GetSigmaf (void) |
Returns the injection bandwidth \(\sigma_f\). More... | |
double | GetSigmat (void) |
Returns the injection duration \(\sigma_t\). More... | |
double | GetTime (void) |
Returns the injection time \(\tau\) [s]. More... | |
double | GetTimeMax (void) |
Returns the maximum time \(\tau_{max}\) [s]. More... | |
double | GetTimeMin (void) |
Returns the minimum time \(\tau_{min}\) [s]. More... | |
double | GetTrueSNR (Spectrum *aSpec1, Spectrum *aSpec2) |
Returns the true value of SNR. More... | |
double | GetWaveform (const unsigned int aIndex, const unsigned int aSamplingFrequency) |
Returns the waveform amplitude \(s\) for a given time index \(i\). More... | |
void | MakeWaveform (void) |
Generates a new set of waveform parameters. More... | |
void | SetAmplitudeRange (const double aAmpMin, const double aAmpMax) |
Sets a new range for \(A\): \(A_{min}\) - \(A_{max}\). More... | |
void | SetFrequencyRange (const double aFreqMin, const double aFreqMax) |
Sets a new range for \(\phi\): \(\phi_{min}\) - \(\phi_{max}\). More... | |
void | SetQRange (const double aQMin, const double aQMax) |
Sets a new range for \(Q\): \(Q_{min}\) - \(Q_{max}\). More... | |
void | SetTimeRange (const double aTimeMin, const double aTimeMax) |
Sets a new range for \(\tau\): \(\tau_{min}\) - \(\tau_{max}\). More... | |
Constructors and destructors | |
Oinject (const double aDuration) | |
Constructor of the Oinject class. More... | |
virtual | ~Oinject (void) |
Destructor of the Oinject class. More... | |
Private Member Functions | |
void | GenerateParameters (void) |
Generates a random set of parameters. More... | |
Private Attributes | |
double | amp |
Injection amplitude \(A\). More... | |
double | ampmax |
Maximum injection amplitude. More... | |
double | ampmin |
Minimum injection amplitude. More... | |
double | duration |
Vector duration [s]. More... | |
double | phase |
Injection phase \(\varphi\). More... | |
double | phi |
Injection frequency \(\phi\). More... | |
double | phimax |
Maximum injection frequency. More... | |
double | phimin |
Minimum injection frequency. More... | |
double | Q |
Injection Q \(Q\). More... | |
double | Qmax |
Maximum injection Q. More... | |
double | Qmin |
Minimum injection Q. More... | |
TRandom3 * | randgen |
Random generator. More... | |
double | sigma_f |
Gaussian window width (frequency). More... | |
double | sigma_t |
Gaussian window width (time). More... | |
double | snr |
Injection SNR \(\rho\). More... | |
double | tau |
Injection time \(\tau\). More... | |
double | taumax |
Maximum injection time. More... | |
double | taumin |
Minimum injection time. More... | |
double | Wg |
Gaussian window normalization. More... | |
Inject sinusoidal Gaussian waveforms.
Oinject::Oinject | ( | const double | aDuration | ) |
Constructor of the Oinject class.
The ranges for the parameters are set to default values:
A set of random parameters is generated with MakeWaveform(). The user must specify the duration of the injection waveform.
[in] | aDuration | Waveform duration [s]. |
|
virtual |
Destructor of the Oinject class.
|
private |
Generates a random set of parameters.
Random parameters:
|
inline |
Returns the injection amplitude \(A\).
|
inline |
Returns the maximum amplitude \(A_{max}\).
|
inline |
Returns the minimum amplitude \(A_{min}\).
|
inline |
Returns the injection frequency \(\phi\) [Hz].
|
inline |
Returns the maximum frequency \(\phi_{max}\) [Hz].
|
inline |
Returns the minimum frequency \(\phi_{min}\) [Hz].
|
inline |
Returns the injection phase \(\varphi\).
|
inline |
Returns the injection Q \(Q\).
|
inline |
Returns the maximum Q \(Q_{max}\).
|
inline |
Returns the minimum Q \(Q_{min}\).
|
inline |
Returns the injection bandwidth \(\sigma_f\).
|
inline |
Returns the injection duration \(\sigma_t\).
|
inline |
Returns the injection time \(\tau\) [s].
|
inline |
Returns the maximum time \(\tau_{max}\) [s].
|
inline |
Returns the minimum time \(\tau_{min}\) [s].
double Oinject::GetTrueSNR | ( | Spectrum * | aSpec1, |
Spectrum * | aSpec2 | ||
) |
Returns the true value of SNR.
TBC.
[in] | aSpec1 | Noise spectrum (1) |
[in] | aSpec2 | Noise spectrum (2) |
|
inline |
Returns the waveform amplitude \(s\) for a given time index \(i\).
The waveform amplitude is computed for the set of parameters previously generated with MakeWaveform(). The user must specify the frequency \(f_0\) at which the data vector is sampled. This way, combined with the duration \(T\) set in the constructor, the index can be converted to a time value: \(t_i = -T/2+i/f_0\).
\[ s[i] = A \times \frac{W_g}{\sigma_t\sqrt{2\pi}}\times \exp\left( -\frac{(t_i-\tau)^2}{2\sigma_t^2}\right) \times \cos\left(2\pi\phi t_i+\varphi\right) \]
where \(W_g = \sqrt{\sqrt{2/\pi} \times Q/\phi}\) and \(\sigma_t = Q/(\sqrt{8}\pi\phi)\).[in] | aIndex | Waveform time index \(i\). |
[in] | aSamplingFrequency | Sampling frequency \(f_0\) [Hz]. |
void Oinject::MakeWaveform | ( | void | ) |
Generates a new set of waveform parameters.
|
inline |
Sets a new range for \(A\): \(A_{min}\) - \(A_{max}\).
[in] | aAmpMin | Minimum amplitude \(A_{min}\). |
[in] | aAmpMax | Maximum amplitude \(A_{max}\). |
|
inline |
Sets a new range for \(\phi\): \(\phi_{min}\) - \(\phi_{max}\).
[in] | aFreqMin | Minimum frequency \(\phi_{min}\) [Hz]. |
[in] | aFreqMax | Maximum frequency \(\phi_{max}\) [Hz]. |
|
inline |
Sets a new range for \(Q\): \(Q_{min}\) - \(Q_{max}\).
[in] | aQMin | Minimum Q \(Q_{min}\). |
[in] | aQMax | Maximum Q \(Q_{max}\). |
|
inline |
Sets a new range for \(\tau\): \(\tau_{min}\) - \(\tau_{max}\).
[in] | aTimeMin | Minimum time \(\tau_{min}\) [s]. |
[in] | aTimeMax | Maximum time \(\tau_{max}\) [s]. |
|
private |
Injection amplitude \(A\).
|
private |
Maximum injection amplitude.
|
private |
Minimum injection amplitude.
|
private |
Vector duration [s].
|
private |
Injection phase \(\varphi\).
|
private |
Injection frequency \(\phi\).
|
private |
Maximum injection frequency.
|
private |
Minimum injection frequency.
|
private |
Injection Q \(Q\).
|
private |
Maximum injection Q.
|
private |
Minimum injection Q.
|
private |
Random generator.
|
private |
Gaussian window width (frequency).
|
private |
Gaussian window width (time).
|
private |
Injection SNR \(\rho\).
|
private |
Injection time \(\tau\).
|
private |
Maximum injection time.
|
private |
Minimum injection time.
|
private |
Gaussian window normalization.