aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-06-10 22:18:31 -0400
committerTom Tsou <tom.tsou@ettus.com>2015-07-30 14:22:41 -0700
commit81c6873205bd510bd83c2b352a93a51a357918d8 (patch)
tree9f91e47594ef11bc0d2bca6eab025e6ecb5deb5d
parentc052aa1d4cbccb1802cdefc02f105c957d037fae (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. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
-rw-r--r--Transceiver52M/Transceiver.cpp8
1 files changed, 4 insertions, 4 deletions
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;