Skip to content

Commit

Permalink
Fixed noise recorder clear issue for spectrum filters with sub-band
Browse files Browse the repository at this point in the history
bins. Stale wheel entry recordings were only overwritten for the
sub-band bins specified during an update, leaving old energy in the
remaining sub-band bins. Updated logic now clears all sub-band bins
before setting the bins specified in the update when a stale wheel
entry is detected.
  • Loading branch information
sgalgano committed Jul 14, 2020
1 parent 5d2d6c0 commit b5562d8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/libemane/noiserecorder.cc
Expand Up @@ -184,6 +184,15 @@ EMANE::NoiseRecorder::update(const TimePoint &,
minStartOfReceptionBin_ - startOfReceptionBin;
}

if(totalSubBandBins_ > 1)
{
wheel_.set(startIndex,
beforeMinSORBinDurationCount,
0,
0,
totalSubBandBins_);
}

wheel_.set(startIndex,
beforeMinSORBinDurationCount,
dRxPower,
Expand Down Expand Up @@ -227,6 +236,15 @@ EMANE::NoiseRecorder::update(const TimePoint &,
afterMaxEORBinDurationCount = endOfReceptionBin - maxEndOfReceptionBin_;
}

if(totalSubBandBins_ > 1)
{
wheel_.set((startIndex + durationBinCount - afterMaxEORBinDurationCount) % totalWheelBins_,
afterMaxEORBinDurationCount,
0,
0,
totalSubBandBins_);
}

wheel_.set((startIndex + durationBinCount - afterMaxEORBinDurationCount) % totalWheelBins_,
afterMaxEORBinDurationCount,
dRxPower,
Expand Down

0 comments on commit b5562d8

Please sign in to comment.