-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDTLN_defs.h
55 lines (35 loc) · 1.09 KB
/
DTLN_defs.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
46
47
48
49
50
51
52
53
54
55
#include "tensorflow/lite/c/c_api.h"
#include "tensorflow/lite/c/c_api_experimental.h"
#include <fstream>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <queue>
#include<string>
#include<vector>
#include <fcntl.h>
#include <getopt.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#define BLOCK_LEN (512)
#define FFT_OUT_SIZE (BLOCK_LEN / 2 + 1)
#define STATE_SIZE (512)
#define DTLN_MODEL_A "dtln_aec_1.tflite"
#define DTLN_MODEL_B "dtln_aec_2.tflite"
#define SAMEPLERATE (16000)
#define BLOCK_SHIFT (128)
struct trg_engine {
float mic_buffer[BLOCK_LEN] = { 0 };
float out_buffer[BLOCK_LEN] = { 0 };
float states_a[STATE_SIZE] = { 0 };
float states_b[STATE_SIZE] = { 0 };
float lpb_buffer[BLOCK_LEN]= {0};
TfLiteTensor* input_details_a[3], * input_details_b[3];
const TfLiteTensor* output_details_a[2], * output_details_b[2];
TfLiteInterpreter* interpreter_a, * interpreter_b;
TfLiteModel* model_a, * model_b;
};
#endif