NoiseSaS.cc
Go to the documentation of this file.
1 #include <utl/MathConstants.h>
2 #include <utl/Math.h>
3 #include <utl/NoiseSaS.h>
4 #include <utl/RandomEngine.h>
5 #include <CLHEP/Random/RandFlat.h>
6 #include <utl/Trace.h>
7 #include <time.h>
8 #include <utl/MathConstants.h>
9 #include <utl/RandomEngine.h>
10 #include <CLHEP/Random/RandExponential.h>
11 #include <fwk/RandomEngineRegistry.h>
12 #include <fwk/CentralConfig.h>
13 #include <utl/config.h>
14 
15 using namespace std;
16 using namespace utl;
17 using namespace fwk;
18 using CLHEP::RandExponential;
19 
20 
21 double
22 NoiseSaS::CreateSaSNoiseInTimeDomain(const double alpha)
23 {
24  // Create an SaS noise sample
25  const double v = fRandomGeneratorV();
26  const double w = RandExponential::shoot(&fRandomEngine->GetEngine(), 1);
27  const int i = random() & 1 ? 1 : -1;
28  // calculate the following SaS trace sample
29  const double x1 = sin(alpha*v) / pow(cos(v), 1/alpha);
30  const double x2 = pow(cos(v-alpha*v)/w, (1 - alpha)/alpha);
31  return i*x1*x2;
32 }
double pow(const double x, const unsigned int i)

, generated on Tue Sep 26 2023.