diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-04-15 01:00:20 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-04-15 01:00:20 +0900 |
commit | 680ab52d9e151676b8f90d105b23d2d0d89b0471 (patch) | |
tree | 5a05e82900393d2e1ecdf034cf1735d4ebfaec98 /fft/fft.h | |
parent | 428126ee4c8802a4b5f9c9ee491d54013857741b (diff) |
add fmdsp fft analyzer
Diffstat (limited to 'fft/fft.h')
-rw-r--r-- | fft/fft.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/fft/fft.h b/fft/fft.h new file mode 100644 index 0000000..b446739 --- /dev/null +++ b/fft/fft.h @@ -0,0 +1,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 |