Stefan Kiegerl
/
FuncGen17
Func-Gen - basic setup
FuncGenFSST.h@2:3abf5ddd9fc0, 2021-03-23 (annotated)
- Committer:
- hollegha3
- Date:
- Tue Mar 23 17:06:24 2021 +0000
- Revision:
- 2:3abf5ddd9fc0
- Child:
- 3:9fd12684fa88
xxxx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hollegha3 | 2:3abf5ddd9fc0 | 1 | |
hollegha3 | 2:3abf5ddd9fc0 | 2 | #ifndef FuncGenFSST_h |
hollegha3 | 2:3abf5ddd9fc0 | 3 | #define FuncGenFSST_h |
hollegha3 | 2:3abf5ddd9fc0 | 4 | |
hollegha3 | 2:3abf5ddd9fc0 | 5 | // Amplituden fix auf +/-1 |
hollegha3 | 2:3abf5ddd9fc0 | 6 | |
hollegha3 | 2:3abf5ddd9fc0 | 7 | class SignedRampGen { |
hollegha3 | 2:3abf5ddd9fc0 | 8 | public: |
hollegha3 | 2:3abf5ddd9fc0 | 9 | float val; // momentaner Ausgangswert |
hollegha3 | 2:3abf5ddd9fc0 | 10 | private: |
hollegha3 | 2:3abf5ddd9fc0 | 11 | float _inc; |
hollegha3 | 2:3abf5ddd9fc0 | 12 | public: |
hollegha3 | 2:3abf5ddd9fc0 | 13 | SignedRampGen(); // Konstruktor |
hollegha3 | 2:3abf5ddd9fc0 | 14 | |
hollegha3 | 2:3abf5ddd9fc0 | 15 | void SetPointsPerPeriod(float aPoints); |
hollegha3 | 2:3abf5ddd9fc0 | 16 | |
hollegha3 | 2:3abf5ddd9fc0 | 17 | // bezogen auf Fsample 0..0.5 |
hollegha3 | 2:3abf5ddd9fc0 | 18 | void SetFrequ(float aFrequ); |
hollegha3 | 2:3abf5ddd9fc0 | 19 | |
hollegha3 | 2:3abf5ddd9fc0 | 20 | // Einen Abtastwert berechnen |
hollegha3 | 2:3abf5ddd9fc0 | 21 | // wird bei z.B. Fsample=100Hz 100x pro sec afgerufen |
hollegha3 | 2:3abf5ddd9fc0 | 22 | void CalcOneStep(); |
hollegha3 | 2:3abf5ddd9fc0 | 23 | }; |
hollegha3 | 2:3abf5ddd9fc0 | 24 | |
hollegha3 | 2:3abf5ddd9fc0 | 25 | |
hollegha3 | 2:3abf5ddd9fc0 | 26 | class TriangleGen { |
hollegha3 | 2:3abf5ddd9fc0 | 27 | public: |
hollegha3 | 2:3abf5ddd9fc0 | 28 | float val; // momentaner Ausgangswert |
hollegha3 | 2:3abf5ddd9fc0 | 29 | private: |
hollegha3 | 2:3abf5ddd9fc0 | 30 | float _inc; |
hollegha3 | 2:3abf5ddd9fc0 | 31 | int _state; |
hollegha3 | 2:3abf5ddd9fc0 | 32 | float _phase; |
hollegha3 | 2:3abf5ddd9fc0 | 33 | public: |
hollegha3 | 2:3abf5ddd9fc0 | 34 | TriangleGen(); |
hollegha3 | 2:3abf5ddd9fc0 | 35 | |
hollegha3 | 2:3abf5ddd9fc0 | 36 | void SetPointsPerPeriod(float aPoints); |
hollegha3 | 2:3abf5ddd9fc0 | 37 | |
hollegha3 | 2:3abf5ddd9fc0 | 38 | // bezogen auf Fsample 0..0.5 |
hollegha3 | 2:3abf5ddd9fc0 | 39 | void SetFrequ(float aFrequ); |
hollegha3 | 2:3abf5ddd9fc0 | 40 | |
hollegha3 | 2:3abf5ddd9fc0 | 41 | // Einen Abtastwert berechnen |
hollegha3 | 2:3abf5ddd9fc0 | 42 | void CalcOneStep(); |
hollegha3 | 2:3abf5ddd9fc0 | 43 | }; |
hollegha3 | 2:3abf5ddd9fc0 | 44 | |
hollegha3 | 2:3abf5ddd9fc0 | 45 | |
hollegha3 | 2:3abf5ddd9fc0 | 46 | class RectGen { |
hollegha3 | 2:3abf5ddd9fc0 | 47 | public: |
hollegha3 | 2:3abf5ddd9fc0 | 48 | float val; // momentaner Ausgangswert |
hollegha3 | 2:3abf5ddd9fc0 | 49 | private: |
hollegha3 | 2:3abf5ddd9fc0 | 50 | float _inc; |
hollegha3 | 2:3abf5ddd9fc0 | 51 | float _phase; |
hollegha3 | 2:3abf5ddd9fc0 | 52 | float _thrs; |
hollegha3 | 2:3abf5ddd9fc0 | 53 | public: |
hollegha3 | 2:3abf5ddd9fc0 | 54 | RectGen(); |
hollegha3 | 2:3abf5ddd9fc0 | 55 | |
hollegha3 | 2:3abf5ddd9fc0 | 56 | void SetPointsPerPeriod(float aPoints); |
hollegha3 | 2:3abf5ddd9fc0 | 57 | |
hollegha3 | 2:3abf5ddd9fc0 | 58 | void SetFrequ(float aFrequ); |
hollegha3 | 2:3abf5ddd9fc0 | 59 | |
hollegha3 | 2:3abf5ddd9fc0 | 60 | // Dauer des ON-Pulses in Prozent ( 0..1 ) |
hollegha3 | 2:3abf5ddd9fc0 | 61 | void SetPulsWidth(float aPercent) |
hollegha3 | 2:3abf5ddd9fc0 | 62 | { |
hollegha3 | 2:3abf5ddd9fc0 | 63 | _thrs=aPercent; // möglicherweise andere Formel |
hollegha3 | 2:3abf5ddd9fc0 | 64 | } |
hollegha3 | 2:3abf5ddd9fc0 | 65 | |
hollegha3 | 2:3abf5ddd9fc0 | 66 | // Einen Abtastwert berechnen |
hollegha3 | 2:3abf5ddd9fc0 | 67 | void CalcOneStep(); |
hollegha3 | 2:3abf5ddd9fc0 | 68 | }; |
hollegha3 | 2:3abf5ddd9fc0 | 69 | |
hollegha3 | 2:3abf5ddd9fc0 | 70 | #endif |
hollegha3 | 2:3abf5ddd9fc0 | 71 | |
hollegha3 | 2:3abf5ddd9fc0 | 72 | |
hollegha3 | 2:3abf5ddd9fc0 | 73 | |
hollegha3 | 2:3abf5ddd9fc0 | 74 | |
hollegha3 | 2:3abf5ddd9fc0 | 75 | |
hollegha3 | 2:3abf5ddd9fc0 | 76 | |
hollegha3 | 2:3abf5ddd9fc0 | 77 | |
hollegha3 | 2:3abf5ddd9fc0 | 78 | |
hollegha3 | 2:3abf5ddd9fc0 | 79 | |
hollegha3 | 2:3abf5ddd9fc0 | 80 | |
hollegha3 | 2:3abf5ddd9fc0 | 81 | |
hollegha3 | 2:3abf5ddd9fc0 | 82 | |
hollegha3 | 2:3abf5ddd9fc0 | 83 | |
hollegha3 | 2:3abf5ddd9fc0 | 84 | |
hollegha3 | 2:3abf5ddd9fc0 | 85 | |
hollegha3 | 2:3abf5ddd9fc0 | 86 | |
hollegha3 | 2:3abf5ddd9fc0 | 87 | |
hollegha3 | 2:3abf5ddd9fc0 | 88 | |
hollegha3 | 2:3abf5ddd9fc0 | 89 | |
hollegha3 | 2:3abf5ddd9fc0 | 90 |