rename noisevector class -> avgvector

The vectors feature is averaging, and not adding noise.
This commit is contained in:
Eric Wild 2022-05-08 20:14:14 +02:00
parent d40300ec63
commit 46bbdf0ace
4 changed files with 9 additions and 9 deletions

View File

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

View File

@ -69,7 +69,7 @@ struct TransceiverState {
bool mRetrans; bool mRetrans;
/* Received noise energy levels */ /* Received noise energy levels */
noiseVector mFreqOffsets; avgVector mFreqOffsets;
/* Store pointers to previous frame */ /* Store pointers to previous frame */
radioVector *prevFrame[8]; radioVector *prevFrame[8];

View File

@ -76,12 +76,12 @@ bool radioVector::setVector(signalVector *vector, size_t chan)
return true; return true;
} }
noiseVector::noiseVector(size_t size) avgVector::avgVector(size_t size)
: std::vector<float>(size), itr(0) : std::vector<float>(size), itr(0)
{ {
} }
float noiseVector::avg() const float avgVector::avg() const
{ {
float val = 0.0; float val = 0.0;
@ -94,7 +94,7 @@ float noiseVector::avg() const
return val / (float) size(); return val / (float) size();
} }
bool noiseVector::insert(float val) bool avgVector::insert(float val)
{ {
if (size() < max) { if (size() < max) {
push_back(val); push_back(val);
@ -109,12 +109,12 @@ bool noiseVector::insert(float val)
return true; return true;
} }
bool noiseVector::full() const bool avgVector::full() const
{ {
return size() >= max; return size() >= max;
} }
void noiseVector::reset() void avgVector::reset()
{ {
resize(0); resize(0);
} }

View File

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