うなりを生成
sinc.h@0:66d8d7360022, 2018-06-26 (annotated)
- Committer:
- k0050288
- Date:
- Tue Jun 26 06:27:08 2018 +0000
- Revision:
- 0:66d8d7360022
??????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
k0050288 | 0:66d8d7360022 | 1 | /* |
k0050288 | 0:66d8d7360022 | 2 | * うなりを生成する |
k0050288 | 0:66d8d7360022 | 3 | */ |
k0050288 | 0:66d8d7360022 | 4 | |
k0050288 | 0:66d8d7360022 | 5 | #ifndef SINC_H |
k0050288 | 0:66d8d7360022 | 6 | #define SINC_H |
k0050288 | 0:66d8d7360022 | 7 | |
k0050288 | 0:66d8d7360022 | 8 | #include <math.h> |
k0050288 | 0:66d8d7360022 | 9 | #include <stdint.h> |
k0050288 | 0:66d8d7360022 | 10 | |
k0050288 | 0:66d8d7360022 | 11 | #define BUFFER_SIZE 2000 |
k0050288 | 0:66d8d7360022 | 12 | #define AMPLITUDE 0.75 // 3.3V * amplitude |
k0050288 | 0:66d8d7360022 | 13 | #define OFFSET 1.6 |
k0050288 | 0:66d8d7360022 | 14 | |
k0050288 | 0:66d8d7360022 | 15 | class sinc { |
k0050288 | 0:66d8d7360022 | 16 | private: |
k0050288 | 0:66d8d7360022 | 17 | void generate(); |
k0050288 | 0:66d8d7360022 | 18 | public: |
k0050288 | 0:66d8d7360022 | 19 | uint16_t buffer[BUFFER_SIZE]; |
k0050288 | 0:66d8d7360022 | 20 | |
k0050288 | 0:66d8d7360022 | 21 | sinc(); |
k0050288 | 0:66d8d7360022 | 22 | |
k0050288 | 0:66d8d7360022 | 23 | void init(); |
k0050288 | 0:66d8d7360022 | 24 | }; |
k0050288 | 0:66d8d7360022 | 25 | |
k0050288 | 0:66d8d7360022 | 26 | #endif |