mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-trx.git
synced 2025-11-20 13:58:11 +00:00
sigProcLib: make energyDetect() simpler by returning actual energy.
Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
This commit is contained in:
@@ -1721,10 +1721,7 @@ static float computePeakRatio(signalVector *corr,
|
||||
return (amp.abs()) / rms;
|
||||
}
|
||||
|
||||
bool energyDetect(signalVector &rxBurst,
|
||||
unsigned windowLength,
|
||||
float detectThreshold,
|
||||
float *avgPwr)
|
||||
float energyDetect(signalVector &rxBurst, unsigned windowLength)
|
||||
{
|
||||
|
||||
signalVector::const_iterator windowItr = rxBurst.begin(); //+rxBurst.size()/2 - 5*windowLength/2;
|
||||
@@ -1735,8 +1732,7 @@ bool energyDetect(signalVector &rxBurst,
|
||||
energy += windowItr->norm2();
|
||||
windowItr+=4;
|
||||
}
|
||||
if (avgPwr) *avgPwr = energy/windowLength;
|
||||
return (energy/windowLength > detectThreshold*detectThreshold);
|
||||
return energy/windowLength;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user