From 2ff955631f27b0a770d45753b388b2d04fcef889 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Thu, 29 Dec 2016 00:36:45 -0300 Subject: [PATCH] Adding #define constants in the RSSI average code --- DMRDMORX.cpp | 3 ++- DMRSlotRX.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DMRDMORX.cpp b/DMRDMORX.cpp index 1677bbd..a435e94 100644 --- a/DMRDMORX.cpp +++ b/DMRDMORX.cpp @@ -133,7 +133,8 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi) samplesToBits(ptr, DMR_FRAME_LENGTH_SYMBOLS, frame, 8U, centre, threshold); #if defined(SEND_RSSI_DATA) - rssi_avg = avgRSSI(m_startPtr+120, 420); + // Calculate RSSI average over a burst period. We don't take into account 2.5 ms at the beginning and 2.5 ms at the end + rssi_avg = avgRSSI(m_startPtr + DMR_SYNC_LENGTH_SAMPLES / 2U, DMR_FRAME_LENGTH_SAMPLES - DMR_SYNC_LENGTH_SAMPLES); #endif if (m_control == CONTROL_DATA) { diff --git a/DMRSlotRX.cpp b/DMRSlotRX.cpp index 830b713..454ccea 100644 --- a/DMRSlotRX.cpp +++ b/DMRSlotRX.cpp @@ -136,7 +136,8 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi) samplesToBits(ptr, DMR_FRAME_LENGTH_SYMBOLS, frame, 8U, centre, threshold); #if defined(SEND_RSSI_DATA) - rssi_avg = avgRSSI(m_startPtr+120, 420); + // Calculate RSSI average over a burst period. We don't take into account 2.5 ms at the beginning and 2.5 ms at the end + rssi_avg = avgRSSI(m_startPtr + DMR_SYNC_LENGTH_SAMPLES / 2U, DMR_FRAME_LENGTH_SAMPLES - DMR_SYNC_LENGTH_SAMPLES); #endif if (m_control == CONTROL_DATA) {