From 680ab52d9e151676b8f90d105b23d2d0d89b0471 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 15 Apr 2017 01:00:20 +0900 Subject: add fmdsp fft analyzer --- fft/fft.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 fft/fft.h (limited to 'fft/fft.h') 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 + +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 -- cgit v1.2.3