diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-02-04 22:00:10 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-02-04 22:00:10 +0100 |
commit | 8ecda350fbde0d544ba284f0441859e2a52b4ce3 (patch) | |
tree | 1321366d38d399d2842e853616b3179b7988b596 /AlignSample.hpp | |
parent | 5ecde2c1ae68431248eb1b49b3bffb74304efd19 (diff) | |
download | odr-dpd-8ecda350fbde0d544ba284f0441859e2a52b4ce3.tar.gz odr-dpd-8ecda350fbde0d544ba284f0441859e2a52b4ce3.tar.bz2 odr-dpd-8ecda350fbde0d544ba284f0441859e2a52b4ce3.zip |
Add subsample delay compensation (untested)
Diffstat (limited to 'AlignSample.hpp')
-rw-r--r-- | AlignSample.hpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/AlignSample.hpp b/AlignSample.hpp index d027823..9529792 100644 --- a/AlignSample.hpp +++ b/AlignSample.hpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 + Copyright (C) 2017 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -33,7 +33,8 @@ #define FFT_TYPE fftwf_complex -typedef std::complex<float> complexf; +using complexf = std::complex<float>; +using vec_cf = std::vector<complexf>; struct CorrelationResult { CorrelationResult(size_t len) : @@ -43,7 +44,7 @@ struct CorrelationResult { rx_timestamp(0), tx_timestamp(0) {} - std::vector<complexf> correlation; + vec_cf correlation; float rx_power; float tx_power; @@ -85,8 +86,14 @@ class AlignSample { CorrelationResult crosscorrelate(size_t len); - std::pair<std::vector<complexf>, std::vector<complexf> > get_samples( - size_t len, size_t rx_delay); + /* Drop delay samples from the rx_samples */ + void delay_rx_samples(size_t delay); + + /* Calculate and compensate for subsample delay, assuming that the + * RX and TX samples are already aligned + */ + std::pair<vec_cf, vec_cf> get_samples( + size_t len); void consume(size_t samples); |