diff options
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 |