aboutsummaryrefslogtreecommitdiff
path: root/fft/fft.h
blob: b446739f2531d6d7f507c28859bdb44cea5759fb (plain)
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 MYON_FMPLAYER_FFT_FFT_H_INCLUDED
#define MYON_FMPLAYER_FFT_FFT_H_INCLUDED

#include <stdint.h>

enum {
  FFTLEN = 8192,
  FFTDISPLEN = 70,
};

struct fmplayer_fft_data {
  int16_t buf[FFTLEN];
  unsigned ind;
};

struct fmplayer_fft_input_data {
  struct fmplayer_fft_data fdata;
  int16_t work[FFTLEN];
  double dwork[FFTLEN];
  float fwork[FFTLEN*2];
};

struct fmplayer_fft_disp_data {
  // 0 - 31
  // 4 per 6db
  uint8_t buf[FFTDISPLEN];
};

void fft_init_table(void);

void fft_write(struct fmplayer_fft_data *data, const int16_t *buf, unsigned len);

void fft_calc(struct fmplayer_fft_disp_data *ddata, struct fmplayer_fft_input_data *idata);

#endif // MYON_FMPLAYER_FFT_FFT_H_INCLUDED