musiclight2/fft.h

23 rader
727 B
C

/*
* vim: sw=2 ts=2 expandtab
*
* THE PIZZA-WARE LICENSE" (derived from "THE BEER-WARE LICENCE"):
* <cfr34k@tkolb.de> wrote this file. As long as you retain this notice you can
* do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a pizza in return. - Thomas Kolb
*/
#ifndef FFT_H
#define FFT_H
#include "config.h"
void init_fft(void);
void complex_to_absolute(double *re, double *im, double *result);
void apply_hanning(sample *dftinput);
void fft_transform(sample *samples, double *resultRe, double *resultIm);
uint32_t find_loudest_frequency(double *absFFT);
double get_energy_in_band(double *fft, uint32_t minFreq, uint32_t maxFreq);
#endif // FFT_H