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 */
float mNoiseLev;
noiseVector mNoises;
avgVector mNoises;
/* Shadowed downlink attenuation */
int mPower;

View File

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

View File

@ -76,12 +76,12 @@ 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;
@ -94,7 +94,7 @@ float noiseVector::avg() const
return val / (float) size();
}
bool noiseVector::insert(float val)
bool avgVector::insert(float val)
{
if (size() < max) {
push_back(val);
@ -109,12 +109,12 @@ bool noiseVector::insert(float val)
return true;
}
bool noiseVector::full() const
bool avgVector::full() const
{
return size() >= max;
}
void noiseVector::reset()
void avgVector::reset()
{
resize(0);
}

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);
bool full() const;
float avg() const;