BULME_AHEL20
/
LPC_HL_FUNC_GENERATOR_DAC
Function generator
FuncGen.h@2:100244cef3d6, 2016-03-17 (annotated)
- Committer:
- hollegha2
- Date:
- Thu Mar 17 13:45:13 2016 +0000
- Revision:
- 2:100244cef3d6
- Child:
- 3:c8c3b755ef54
V1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hollegha2 | 2:100244cef3d6 | 1 | #ifndef FuncGenFSST_h |
hollegha2 | 2:100244cef3d6 | 2 | #define FuncGenFSST_h |
hollegha2 | 2:100244cef3d6 | 3 | |
hollegha2 | 2:100244cef3d6 | 4 | // Amplituden fix auf +/-1 |
hollegha2 | 2:100244cef3d6 | 5 | |
hollegha2 | 2:100244cef3d6 | 6 | class SignedRampGen |
hollegha2 | 2:100244cef3d6 | 7 | { |
hollegha2 | 2:100244cef3d6 | 8 | public: |
hollegha2 | 2:100244cef3d6 | 9 | float val; // momentaner Ausgangswert |
hollegha2 | 2:100244cef3d6 | 10 | private: |
hollegha2 | 2:100244cef3d6 | 11 | float _inc; |
hollegha2 | 2:100244cef3d6 | 12 | public: |
hollegha2 | 2:100244cef3d6 | 13 | SignedRampGen(); // Konstruktor |
hollegha2 | 2:100244cef3d6 | 14 | |
hollegha2 | 2:100244cef3d6 | 15 | void SetPointsPerPeriod(int aPoints); |
hollegha2 | 2:100244cef3d6 | 16 | |
hollegha2 | 2:100244cef3d6 | 17 | // bezogen auf Fsample 0..0.5 |
hollegha2 | 2:100244cef3d6 | 18 | void SetFrequ(float aFrequ); |
hollegha2 | 2:100244cef3d6 | 19 | |
hollegha2 | 2:100244cef3d6 | 20 | // Einen Abtastwert berechnen |
hollegha2 | 2:100244cef3d6 | 21 | // wird bei z.B. Fsample=100Hz 100x pro sec afgerufen |
hollegha2 | 2:100244cef3d6 | 22 | void CalcOneStep(); |
hollegha2 | 2:100244cef3d6 | 23 | }; |
hollegha2 | 2:100244cef3d6 | 24 | |
hollegha2 | 2:100244cef3d6 | 25 | |
hollegha2 | 2:100244cef3d6 | 26 | class TriangleGen |
hollegha2 | 2:100244cef3d6 | 27 | { |
hollegha2 | 2:100244cef3d6 | 28 | public: |
hollegha2 | 2:100244cef3d6 | 29 | float val; // momentaner Ausgangswert |
hollegha2 | 2:100244cef3d6 | 30 | private: |
hollegha2 | 2:100244cef3d6 | 31 | float _inc; |
hollegha2 | 2:100244cef3d6 | 32 | int _state; |
hollegha2 | 2:100244cef3d6 | 33 | public: |
hollegha2 | 2:100244cef3d6 | 34 | TriangleGen(); |
hollegha2 | 2:100244cef3d6 | 35 | |
hollegha2 | 2:100244cef3d6 | 36 | void SetPointsPerPeriod(int aPoints); |
hollegha2 | 2:100244cef3d6 | 37 | |
hollegha2 | 2:100244cef3d6 | 38 | // bezogen auf Fsample 0..0.5 |
hollegha2 | 2:100244cef3d6 | 39 | void SetFrequ(float aFrequ); |
hollegha2 | 2:100244cef3d6 | 40 | |
hollegha2 | 2:100244cef3d6 | 41 | // Einen Abtastwert berechnen |
hollegha2 | 2:100244cef3d6 | 42 | void CalcOneStep(); |
hollegha2 | 2:100244cef3d6 | 43 | }; |
hollegha2 | 2:100244cef3d6 | 44 | |
hollegha2 | 2:100244cef3d6 | 45 | |
hollegha2 | 2:100244cef3d6 | 46 | class RectGen |
hollegha2 | 2:100244cef3d6 | 47 | { |
hollegha2 | 2:100244cef3d6 | 48 | public: |
hollegha2 | 2:100244cef3d6 | 49 | float val; // momentaner Ausgangswert |
hollegha2 | 2:100244cef3d6 | 50 | private: |
hollegha2 | 2:100244cef3d6 | 51 | float _inc; |
hollegha2 | 2:100244cef3d6 | 52 | float _phase; |
hollegha2 | 2:100244cef3d6 | 53 | public: |
hollegha2 | 2:100244cef3d6 | 54 | RectGen(); |
hollegha2 | 2:100244cef3d6 | 55 | |
hollegha2 | 2:100244cef3d6 | 56 | void SetPointsPerPeriod(int aPoints); |
hollegha2 | 2:100244cef3d6 | 57 | |
hollegha2 | 2:100244cef3d6 | 58 | void SetFrequ(float aFrequ); |
hollegha2 | 2:100244cef3d6 | 59 | |
hollegha2 | 2:100244cef3d6 | 60 | // Dauer des ON-Pulses in Prozent ( 0..1 ) |
hollegha2 | 2:100244cef3d6 | 61 | void SetPulsWidth(float aPercent); |
hollegha2 | 2:100244cef3d6 | 62 | |
hollegha2 | 2:100244cef3d6 | 63 | // Einen Abtastwert berechnen |
hollegha2 | 2:100244cef3d6 | 64 | void CalcOneStep(); |
hollegha2 | 2:100244cef3d6 | 65 | }; |
hollegha2 | 2:100244cef3d6 | 66 | |
hollegha2 | 2:100244cef3d6 | 67 | #endif |
hollegha2 | 2:100244cef3d6 | 68 | |
hollegha2 | 2:100244cef3d6 | 69 | |
hollegha2 | 2:100244cef3d6 | 70 |