-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdsp_stuff.h
More file actions
57 lines (46 loc) · 1.01 KB
/
dsp_stuff.h
File metadata and controls
57 lines (46 loc) · 1.01 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
/*
tfrec - Receiver for TFA IT+ (and compatible) sensors
(c) 2017 Georg Acher, Deti Fliegl {acher|fliegl}(at)baycom.de
#include <GPL-v2>
*/
#ifndef _DSP_STUFF_H
#define _DSP_STUFF_H
#include <string>
#include <vector>
#include <thread>
using std::thread;
using std::string;
using std::vector;
class iir2 {
public:
iir2(double cutoff);
double step(double din);
void set(double cutoff);
private:
double dn1,dn2;
double yn,yn1,yn2;
double b0,b1,b2,a1,a2;
};
class decimate {
public:
decimate(void);
~decimate(void);
int process2x(int16_t *data, int length, int type); // IQ
int process2x1(int16_t *data, int length); // IQ
private:
int16_t hist[128];
int16_t hist0[128];
int16_t hist1[128];
};
class downconvert {
public:
downconvert(int p);
~downconvert(void);
int process_iq(int16_t *buf,int len, int filter=0);
private:
vector<decimate> dec_i,dec_q;
int passes;
};
int fm_dev_nrzs(int ar, int aj, int br, int bj);
int fm_dev(int ar, int aj, int br, int bj);
#endif