From 81c6873205bd510bd83c2b352a93a51a357918d8 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Wed, 10 Jun 2015 22:18:31 -0400 Subject: Transceiver: Do not update state->SNRestimate if equalization is disabled. This also fix a bug of using bool type for noise instead of float. Signed-off-by: Tom Tsou --- Transceiver52M/Transceiver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Transceiver52M') diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index f03d7af..7634980 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -554,7 +554,7 @@ int Transceiver::detectTSC(TransceiverState *state, signalVector &burst, int success; int tn = time.TN(); float chanOffset, threshold = 5.0; - bool noise, needDFE = false, estimateChan = false; + bool needDFE = false, estimateChan = false; double elapsed = time - state->chanEstimateTime[tn]; signalVector *chanResp; @@ -576,11 +576,11 @@ int Transceiver::detectTSC(TransceiverState *state, signalVector &burst, return success; } - noise = state->mNoiseLev; - state->SNRestimate[tn] = amp.norm2() / (noise * noise + 1.0); - /* Set equalizer if unabled */ if (needDFE && estimateChan) { + float noise = state->mNoiseLev; + state->SNRestimate[tn] = amp.norm2() / (noise * noise + 1.0); + state->chanResponse[tn] = chanResp; state->chanRespOffset[tn] = chanOffset; state->chanRespAmplitude[tn] = amp; -- cgit v1.2.3