aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-06-10 22:18:31 -0400
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-06-10 23:13:33 -0400
commit34e5a3807f4d77f098c786b99aa6bea5c0160918 (patch)
tree9f6668c8ba55bf73f1625f5c2af52dbeb9c672fa
parentb49874aa646bfae23355a6a4c38d835323f2c8f4 (diff)
Transceiver: Do not update state->SNRestimate if equalization is disabled.
This also fix a bug of using bool type for noise instead of float.
-rw-r--r--Transceiver52M/Transceiver.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 9bd90df..f572987 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;