36 lines
633 B
C++
36 lines
633 B
C++
#ifndef _FFT_BEACON_FINDER_
|
|
#define _FFT_BEACON_FINDER_
|
|
|
|
#include <complex>
|
|
|
|
#include <liquid/liquid.h>
|
|
|
|
const size_t FFT_LEN = 512;
|
|
|
|
class FFTBeaconFinder {
|
|
private:
|
|
int samplingrate;
|
|
|
|
nco_crcf coarse_correction;
|
|
fftplan fft;
|
|
|
|
std::complex<float> fft_in[FFT_LEN];
|
|
std::complex<float> fft_out[FFT_LEN];
|
|
|
|
size_t pos;
|
|
int next_fft_in;
|
|
|
|
int last_center;
|
|
float last_center_level;
|
|
|
|
int spectral_bin_to_fft_idx(int);
|
|
|
|
public:
|
|
FFTBeaconFinder(int);
|
|
~FFTBeaconFinder();
|
|
|
|
std::complex<float> work(std::complex<float>);
|
|
};
|
|
|
|
#endif
|