-
Notifications
You must be signed in to change notification settings - Fork 1
/
SigProc.h
45 lines (38 loc) · 1.15 KB
/
SigProc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __SIGPROC__h
#define __SIGPROC__h
#include "Arduino.h"
#include "GlobalDefines.h"
#include "Settings.h"
#include "SensorData.h"
#include "Statistics.h"
#include "Publisher.h"
class SigProc {
public:
void Begin(Settings *settings, SensorData *sensorData, Statistics *statistics, Publisher *publisher);
void Handle();
void StartCapture();
void StopCapture();
void Calc();
bool IsCapturing();
private:
Settings *m_settings;
SensorData *m_sensorData;
Statistics *m_statistics;
Publisher *m_publisher;
hw_timer_t *timer = NULL;
static volatile int16_t sampleRb[RINGBUFFER_SIZE];
static volatile uint32_t samplePtrIn;
static volatile uint32_t samplePtrOut;
static volatile uint32_t RbOvFlag;
static volatile byte m_adcPin;
uint publishInterval;
bool m_isCapturing;
static void IRAM_ATTR onTimer();
uint8_t SnapPending();
inline int16_t MAS(int16_t a, int16_t b);
void Window(int16_t *re, uint8_t m, int16_t *windowTable);
void FFT(int16_t *fr, int16_t *fi, uint16_t m);
void DebugConsoleOutBins(uint16_t startIdx, uint16_t stopIdx);
void DebugConsoleOutSamples(uint16_t startIdx, uint16_t stopIdx);
};
#endif