qo100-trx-prototypes/blocks/fft-beacon-finder.h

40 lines
685 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;
bool has_sync;
int spectral_bin_to_fft_idx(int);
public:
FFTBeaconFinder(int);
~FFTBeaconFinder();
void reset_sync();
std::complex<float> work(std::complex<float>);
};
#endif