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

40 lines
685 B
C
Raw Permalink Normal View History

2021-12-15 23:24:42 +01:00
#ifndef _FFT_BEACON_FINDER_
#define _FFT_BEACON_FINDER_
#include <complex>
2021-12-15 23:43:41 +01:00
2021-12-15 23:24:42 +01:00
#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;
2021-12-28 18:52:13 +01:00
int last_center;
float last_center_level;
2021-12-29 14:21:10 +01:00
bool has_sync;
2021-12-15 23:24:42 +01:00
int spectral_bin_to_fft_idx(int);
2021-12-15 23:43:41 +01:00
2021-12-15 23:24:42 +01:00
public:
FFTBeaconFinder(int);
~FFTBeaconFinder();
2021-12-28 18:52:13 +01:00
2021-12-29 14:21:10 +01:00
void reset_sync();
2021-12-15 23:24:42 +01:00
std::complex<float> work(std::complex<float>);
};
#endif