| Last change
 on this file since 1516 was             1371, checked in by ansari, 25 years ago | 
        
          | 
MAJ documentation, Makefile, ... - Reza 5/1/2001
 | 
        
          | File size:
            2.2 KB | 
      
      
| Line |  | 
|---|
| 1 | // Noise generators | 
|---|
| 2 | //        R. Ansari , F. Couchot   1998 | 
|---|
| 3 | // DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay) | 
|---|
| 4 |  | 
|---|
| 5 | #ifndef BRUIT_H_SEEN | 
|---|
| 6 | #define BRUIT_H_SEEN | 
|---|
| 7 |  | 
|---|
| 8 | namespace SOPHYA { | 
|---|
| 9 |  | 
|---|
| 10 | class NoiseGenerator { | 
|---|
| 11 | public : | 
|---|
| 12 | NoiseGenerator(float sigma=1.); | 
|---|
| 13 | virtual               ~NoiseGenerator(); | 
|---|
| 14 | virtual float         Noise(); | 
|---|
| 15 | inline  unsigned long int           NCoups() { return(mNCoups); } | 
|---|
| 16 |  | 
|---|
| 17 | protected : | 
|---|
| 18 | unsigned long  int mNCoups; | 
|---|
| 19 | float mSigma; | 
|---|
| 20 | }; | 
|---|
| 21 |  | 
|---|
| 22 | class  RWalkNoise : public NoiseGenerator { | 
|---|
| 23 | public : | 
|---|
| 24 | RWalkNoise(float sigma=1.); | 
|---|
| 25 | virtual               ~RWalkNoise(); | 
|---|
| 26 | virtual float         Noise(); | 
|---|
| 27 |  | 
|---|
| 28 | protected: | 
|---|
| 29 | float mState; | 
|---|
| 30 | }; | 
|---|
| 31 |  | 
|---|
| 32 | class OOFNoise : public NoiseGenerator { | 
|---|
| 33 | public : | 
|---|
| 34 | enum { | 
|---|
| 35 | ACF_Def = 0, | 
|---|
| 36 | ACF_Exp = 1 | 
|---|
| 37 | }; | 
|---|
| 38 | OOFNoise(float sigma=1., int typacf=ACF_Exp, | 
|---|
| 39 | int mem=128, float tau=1.); | 
|---|
| 40 | virtual               ~OOFNoise(); | 
|---|
| 41 | virtual float         Noise(); | 
|---|
| 42 | void                  Print(); | 
|---|
| 43 |  | 
|---|
| 44 | protected: | 
|---|
| 45 | int mTypACF; | 
|---|
| 46 | int mMemL; | 
|---|
| 47 | float mTau; | 
|---|
| 48 | double* mState; | 
|---|
| 49 | double* mDyn; | 
|---|
| 50 | }; | 
|---|
| 51 |  | 
|---|
| 52 | class EXPNoise : public NoiseGenerator { | 
|---|
| 53 | public : | 
|---|
| 54 | enum { | 
|---|
| 55 | ACF_Def = 0, | 
|---|
| 56 | ACF_Exp = 1 | 
|---|
| 57 | }; | 
|---|
| 58 | EXPNoise(float sigma=1., int typacf=ACF_Exp, | 
|---|
| 59 | int mem=128, float tau=1.); | 
|---|
| 60 | virtual               ~EXPNoise(); | 
|---|
| 61 | virtual float         Noise(); | 
|---|
| 62 | void                  Print(); | 
|---|
| 63 |  | 
|---|
| 64 | protected: | 
|---|
| 65 | int mTypACF; | 
|---|
| 66 | long  int mMemL; | 
|---|
| 67 | float mTau; | 
|---|
| 68 | double* mState; | 
|---|
| 69 | double* mDyn; | 
|---|
| 70 | }; | 
|---|
| 71 |  | 
|---|
| 72 | class MemNoise : public NoiseGenerator { | 
|---|
| 73 | public : | 
|---|
| 74 | enum { | 
|---|
| 75 | ACF_Def = 0, | 
|---|
| 76 | ACF_Exp = 1 | 
|---|
| 77 | }; | 
|---|
| 78 | MemNoise(float sigma=1., int mem=128, float tau=1., int ava=4096); | 
|---|
| 79 | virtual               ~MemNoise(); | 
|---|
| 80 | virtual float         Noise(); | 
|---|
| 81 | virtual float         Avance(long Asauter); | 
|---|
| 82 | int                   Print(); | 
|---|
| 83 |  | 
|---|
| 84 | protected: | 
|---|
| 85 | int mTypACF; | 
|---|
| 86 | int mMemL; int mCoupHaut; | 
|---|
| 87 | unsigned long   mNappel; | 
|---|
| 88 | unsigned long   mNappLast; | 
|---|
| 89 | float mTeappel; | 
|---|
| 90 | float mTau; | 
|---|
| 91 | float mduree; | 
|---|
| 92 | float mTdernier; | 
|---|
| 93 | int mNtirage; | 
|---|
| 94 | int mMemPos; | 
|---|
| 95 | int mMemNeg; | 
|---|
| 96 | float* mStPos; | 
|---|
| 97 | float* mTePos; | 
|---|
| 98 | float* mStNeg; | 
|---|
| 99 | float* mTeNeg; | 
|---|
| 100 | }; | 
|---|
| 101 |  | 
|---|
| 102 | class  SumNoise : public NoiseGenerator { | 
|---|
| 103 | public : | 
|---|
| 104 | SumNoise(float fknee, float sig=1., int mem=32, float tau=10.); | 
|---|
| 105 | virtual               ~SumNoise(); | 
|---|
| 106 | virtual float         Noise(); | 
|---|
| 107 |  | 
|---|
| 108 | protected: | 
|---|
| 109 | MemNoise* mn; | 
|---|
| 110 | }; | 
|---|
| 111 |  | 
|---|
| 112 | } // namespace SOPHYA | 
|---|
| 113 |  | 
|---|
| 114 | #endif | 
|---|
| 115 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.