From d325343ecca5c6484eeda5ebf9e230c810ea4b82 Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Sun, 6 Mar 2016 03:08:01 -0800 Subject: EDGE: Add 8-PSK modulator and demodulator Setup correlator and detection process similar to the GMSK receiver chain. Require 4 SPS sampling on both Rx and Tx paths as 1 SPS sampling adds too much distoration for 8-PSK recovery. Core receiver operations still run at 1 SPS with the exception of fractional delay filtering, which runs at the higher rate. Perform linear equalization to handle the Gaussian pulse induced ISI. The fixed impulse response used for equalizer tap calculation consists of combined EDGE pulse shape filter and effects of the downsampling filter. Note that the non-adaptive equalizer corrects for modulation induced band limiting and does not account for or compensate for fading channel effects. Signed-off-by: Tom Tsou --- Transceiver52M/Resampler.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'Transceiver52M/Resampler.cpp') diff --git a/Transceiver52M/Resampler.cpp b/Transceiver52M/Resampler.cpp index 624b666..e4b66a7 100644 --- a/Transceiver52M/Resampler.cpp +++ b/Transceiver52M/Resampler.cpp @@ -173,10 +173,15 @@ int Resampler::rotate(float *in, size_t in_len, float *out, size_t out_len) int hist_len = filt_len - 1; if (!check_vec_len(in_len, out_len, p, q)) - return -1; - - /* Insert history */ - memcpy(&in[-2 * hist_len], history, hist_len * 2 * sizeof(float)); + return -1; + + if (history_on) { + memcpy(&in[-2 * hist_len], + history, hist_len * 2 * sizeof(float)); + } else { + memset(&in[-2 * hist_len], 0, + hist_len * 2 * sizeof(float)); + } /* Generate output from precomputed input/output paths */ for (size_t i = 0; i < out_len; i++) { @@ -190,8 +195,10 @@ int Resampler::rotate(float *in, size_t in_len, float *out, size_t out_len) } /* Save history */ - memcpy(history, &in[2 * (in_len - hist_len)], - hist_len * 2 * sizeof(float)); + if (history_on) { + memcpy(history, &in[2 * (in_len - hist_len)], + hist_len * 2 * sizeof(float)); + } return out_len; } @@ -221,8 +228,14 @@ size_t Resampler::len() return filt_len; } +void Resampler::enableHistory(bool on) +{ + history_on = on; +} + Resampler::Resampler(size_t p, size_t q, size_t filt_len) - : in_index(NULL), out_path(NULL), partitions(NULL), history(NULL) + : in_index(NULL), out_path(NULL), partitions(NULL), + history(NULL), history_on(true) { this->p = p; this->q = q; -- cgit v1.2.3