Transceiver52M: Use independent noise vectors for each channel

Each ARFCN channel may be independently configureted and possibly on
separate hardware, so don't share a single vector for noise estimate
calculations. Allow a non-pointer based iterator so we can get away
with using the default copy constructor.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
This commit is contained in:
Thomas Tsou
2013-11-14 15:52:04 -05:00
parent ef25dba4e7
commit a0179e37f8
4 changed files with 27 additions and 24 deletions

View File

@@ -74,10 +74,9 @@ bool radioVector::setVector(signalVector *vector, size_t chan)
return true;
}
noiseVector::noiseVector(size_t n)
noiseVector::noiseVector(size_t size)
: std::vector<float>(size), itr(0)
{
this->resize(n);
it = this->begin();
}
float noiseVector::avg()
@@ -95,10 +94,10 @@ bool noiseVector::insert(float val)
if (!size())
return false;
if (it == this->end())
it = this->begin();
if (itr >= this->size())
itr = 0;
*it++ = val;
(*this)[itr++] = val;
return true;
}