From 40938a36194978a0a73ffa47868986a526c0a3b0 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Mon, 23 Feb 2015 00:44:04 -0500 Subject: [PATCH] Disable sample imbalance-carry patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seems to be causing a problem with peak gains between samples causing pops, and it’s no longer necessary for SSB --- src/demod/DemodulatorPreThread.cpp | 48 ++++++++++++++++-------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/demod/DemodulatorPreThread.cpp b/src/demod/DemodulatorPreThread.cpp index c94b6c53..1d85c4a7 100644 --- a/src/demod/DemodulatorPreThread.cpp +++ b/src/demod/DemodulatorPreThread.cpp @@ -70,8 +70,8 @@ void DemodulatorPreThread::threadMain() { std::vector in_buf_data; std::vector out_buf_data; - liquid_float_complex carrySample; // Keep the stream count even to simplify some demod operations - bool carrySampleFlag = false; +// liquid_float_complex carrySample; // Keep the stream count even to simplify some demod operations +// bool carrySampleFlag = false; terminated = false; @@ -200,27 +200,29 @@ void DemodulatorPreThread::threadMain() { resamp->setRefCount(1); - bool uneven = (numWritten % 2 != 0); - - if (!carrySampleFlag && !uneven) { - resamp->data.assign(resampledData.begin(), resampledData.begin() + numWritten); - carrySampleFlag = false; - } else if (!carrySampleFlag && uneven) { - resamp->data.assign(resampledData.begin(), resampledData.begin() + (numWritten-1)); - carrySample = resampledData.back(); - carrySampleFlag = true; - } else if (carrySampleFlag && uneven) { - resamp->data.resize(numWritten+1); - resamp->data[0] = carrySample; - memcpy(&resamp->data[1],&resampledData[0],sizeof(liquid_float_complex)*numWritten); - carrySampleFlag = false; - } else if (carrySampleFlag && !uneven) { - resamp->data.resize(numWritten); - resamp->data[0] = carrySample; - memcpy(&resamp->data[1],&resampledData[0],sizeof(liquid_float_complex)*(numWritten-1)); - carrySample = resampledData.back(); - carrySampleFlag = true; - } + resamp->data.assign(resampledData.begin(), resampledData.begin() + numWritten); + +// bool uneven = (numWritten % 2 != 0); + +// if (!carrySampleFlag && !uneven) { +// resamp->data.assign(resampledData.begin(), resampledData.begin() + numWritten); +// carrySampleFlag = false; +// } else if (!carrySampleFlag && uneven) { +// resamp->data.assign(resampledData.begin(), resampledData.begin() + (numWritten-1)); +// carrySample = resampledData.back(); +// carrySampleFlag = true; +// } else if (carrySampleFlag && uneven) { +// resamp->data.resize(numWritten+1); +// resamp->data[0] = carrySample; +// memcpy(&resamp->data[1],&resampledData[0],sizeof(liquid_float_complex)*numWritten); +// carrySampleFlag = false; +// } else if (carrySampleFlag && !uneven) { +// resamp->data.resize(numWritten); +// resamp->data[0] = carrySample; +// memcpy(&resamp->data[1],&resampledData[0],sizeof(liquid_float_complex)*(numWritten-1)); +// carrySample = resampledData.back(); +// carrySampleFlag = true; +// }