rename noisevector class -> avgvector

The vectors feature is averaging, and not adding noise.

Change-Id: I05def8ab9ea7a2cece8db09c36c303e13ef40927
This commit is contained in:
Eric Wild 2022-07-19 21:15:24 +02:00
parent aa7a40ee84
commit 8984d7f2ca
3 changed files with 9 additions and 6 deletions

View File

@ -80,7 +80,7 @@ struct TransceiverState {
/* Received noise energy levels */
float mNoiseLev;
noiseVector mNoises;
avgVector mNoises;
/* Shadowed downlink attenuation */
int mPower;

View File

@ -76,22 +76,25 @@ bool radioVector::setVector(signalVector *vector, size_t chan)
return true;
}
noiseVector::noiseVector(size_t size)
avgVector::avgVector(size_t size)
: std::vector<float>(size), itr(0)
{
}
float noiseVector::avg() const
float avgVector::avg() const
{
float val = 0.0;
if (!size())
return 0.0f;
for (size_t i = 0; i < size(); i++)
val += (*this)[i];
return val / (float) size();
}
bool noiseVector::insert(float val)
bool avgVector::insert(float val)
{
if (!size())
return false;

View File

@ -48,9 +48,9 @@ private:
GSM::Time mTime;
};
class noiseVector : std::vector<float> {
class avgVector : std::vector<float> {
public:
noiseVector(size_t size = 0);
avgVector(size_t size = 0);
bool insert(float val);
float avg() const;