QNoiseGenerator.hh
Go to the documentation of this file.00001
00008 #ifndef __Q_NOISE_GENERATOR__HH
00009 #define __Q_NOISE_GENERATOR__HH
00010
00011 #include <ctime>
00012 #include <cstdlib>
00013 #include <iostream>
00014 #include "QVector.hh"
00015 #include "QVectorC.hh"
00016 #include <stdlib.h>
00017 #include "QRealComplexFFT.hh"
00018 #include <gsl/gsl_rng.h>
00019
00020 using namespace std;
00021 using namespace Cuore;
00022
00023 class QNoiseGenerator{
00024
00025 public:
00026 enum Type {
00027 NONE = 0,
00028 InputPS = 1,
00029 Random = 2,
00030 Sin = 3,
00031 RandomWithBessel = 4,
00032 InputPS_FD = 5,
00033 PinkPS = 6,
00034 PinkPSWithBessel = 7,
00035 };
00036 QNoiseGenerator(Type type, size_t size, double samplFreq, double p1, double p2, const gsl_rng* randGen, const QVector* = NULL);
00037 QVector GetNoise(bool continued);
00038 QVector fShift(QVector&, float &);
00039 void SetBesselCutOff(double bessCut) { fBesselCutOff = bessCut; }
00040
00041 private:
00042 void SetPSParameters(const QVector &);
00043 void RandomizePS(bool continued);
00044 void RandomizePS_FD(bool continued,bool useBessel = false);
00045 void RandomizeSin(bool continued);
00046 void RandomizeRandom();
00047 void RandomizeRandomWithBessel(bool continued);
00048 void SetPSShape(const QVector &);
00049 QVector GetPinkPS(size_t size);
00050 QVector noisesample;
00051 const gsl_rng* fRandomGen;
00052 Type fType;
00053 size_t fSize;
00054 double fSamplingFrequency;
00055 double fBesselCutOff;
00056 double fScale;
00057 double fScale2;
00058
00059 double fLambda;
00060 double fMeanRMS;
00061 QVector fPast;
00062 QVector Shape;
00063 QRealComplexFFT fft;
00064 double mean_ps;
00065
00066 QVectorC fShapeC;
00067 QRealComplexFFT fWideFFT;
00068 double fNorm;
00069
00070 double fFrequency;
00071
00072 };
00073
00074 #endif
00075