source: Sophya/trunk/SophyaLib/Samba/bruit.h@ 3725

Last change on this file since 3725 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
8namespace SOPHYA {
9
10class NoiseGenerator {
11public :
12 NoiseGenerator(float sigma=1.);
13 virtual ~NoiseGenerator();
14 virtual float Noise();
15 inline unsigned long int NCoups() { return(mNCoups); }
16
17protected :
18unsigned long int mNCoups;
19 float mSigma;
20};
21
22class RWalkNoise : public NoiseGenerator {
23public :
24 RWalkNoise(float sigma=1.);
25 virtual ~RWalkNoise();
26 virtual float Noise();
27
28protected:
29 float mState;
30};
31
32class OOFNoise : public NoiseGenerator {
33public :
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
44protected:
45 int mTypACF;
46 int mMemL;
47 float mTau;
48 double* mState;
49 double* mDyn;
50};
51
52class EXPNoise : public NoiseGenerator {
53public :
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
64protected:
65 int mTypACF;
66long int mMemL;
67 float mTau;
68 double* mState;
69 double* mDyn;
70};
71
72class MemNoise : public NoiseGenerator {
73public :
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
84protected:
85 int mTypACF;
86 int mMemL; int mCoupHaut;
87unsigned long mNappel;
88unsigned 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
102class SumNoise : public NoiseGenerator {
103public :
104 SumNoise(float fknee, float sig=1., int mem=32, float tau=10.);
105 virtual ~SumNoise();
106 virtual float Noise();
107
108protected:
109 MemNoise* mn;
110};
111
112} // namespace SOPHYA
113
114#endif
115
Note: See TracBrowser for help on using the repository browser.