lyblsgo
2023-04-11 f9115a7bc7495e8b00810a164bb93162c13e23c9
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
 
#ifndef FEATUREEXTRACT_H
#define FEATUREEXTRACT_H
 
#include <fftw3.h>
#include <stdint.h>
 
#include "FeatureQueue.h"
#include "SpeechWrap.h"
#include "Tensor.h"
 
class FeatureExtract {
  private:
    SpeechWrap speech;
    FeatureQueue fqueue;
    int mode;
    int fft_size = 512;
    int window_size = 400;
    int window_shift = 160;
 
    //void fftw_init();
    void melspect(float *din, float *dout);
    void global_cmvn(float *din);
 
  public:
    FeatureExtract(int mode);
    ~FeatureExtract();
    int size();
    //int status();
    void reset();
    void insert(fftwf_plan plan, float *din, int len, int flag);
    bool fetch(Tensor<float> *&dout);
};
 
#endif