IT++ Logo
source.h
Go to the documentation of this file.
1 
29 #ifndef SOURCE_H
30 #define SOURCE_H
31 
32 #include <itpp/base/vec.h>
33 #include <itpp/itexports.h>
34 
35 namespace itpp
36 {
37 
39 
44 class ITPP_EXPORT Sine_Source
45 {
46 public:
48  Sine_Source(double freq, double mean = 0.0, double ampl = 1.0, double inphase = 0.0);
50  double operator()() { return sample(); }
52  vec operator()(int n);
54  mat operator()(int h, int w);
55 protected:
56 private:
57  double sample();
58  double m, A, theta, dtheta;
59 };
60 
65 class ITPP_EXPORT Square_Source
66 {
67 public:
69  Square_Source(double freq, double mean = 0.0, double ampl = 1.0, double inphase = 0.0);
71  double operator()() { return sample(); }
73  vec operator()(int n);
75  mat operator()(int h, int w);
76 protected:
77 private:
78  double sample();
79  double m, A, theta, dtheta;
80 };
81 
86 class ITPP_EXPORT Triangle_Source
87 {
88 public:
90  Triangle_Source(double freq, double mean = 0.0, double ampl = 1.0, double inphase = 0.0);
92  double operator()() { return sample(); }
94  vec operator()(int n);
96  mat operator()(int h, int w);
97 protected:
98 private:
99  double sample();
100  double m, A, theta, dtheta;
101 };
102 
107 class ITPP_EXPORT Sawtooth_Source
108 {
109 public:
111  Sawtooth_Source(double freq, double mean = 0.0, double ampl = 1.0, double inphase = 0.0);
113  double operator()() { return sample(); }
115  vec operator()(int n);
117  mat operator()(int h, int w);
118 protected:
119 private:
120  double sample();
121  double m, A, theta, dtheta;
122 };
123 
128 class ITPP_EXPORT Impulse_Source
129 {
130 public:
132  Impulse_Source(double freq, double ampl = 1.0, double inphase = 0.0);
134  double operator()() { return sample(); }
136  vec operator()(int n);
138  mat operator()(int h, int w);
139 protected:
140 private:
141  double sample();
142  double A, pos, dtheta;
143 };
144 
149 class ITPP_EXPORT Pattern_Source
150 {
151 public:
153  Pattern_Source(const vec &pattern, int start_pos = 0);
155  virtual ~Pattern_Source() { }
157  double operator()() { return sample(); }
159  vec operator()(int n);
161  mat operator()(int h, int w);
162 protected:
163 private:
164  double sample();
165  int pos;
166  vec pat;
167  double mean, var;
168 };
169 
170 } //namespace itpp
171 
172 #endif // #ifndef SOURCE_H
SourceForge Logo

Generated on Sat May 25 2013 16:32:23 for IT++ by Doxygen 1.8.2