mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-trx.git
				synced 2025-11-04 06:03:17 +00:00 
			
		
		
		
	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:
		@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user