transceiver: rename getting radio vector time to getTime()
Small name change to match setTime for a get/set pair. Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This commit is contained in:
parent
bb1c2f2ad2
commit
9d0beae1a5
|
@ -149,7 +149,7 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime)
|
||||||
// Even if the burst is stale, put it in the fillter table.
|
// Even if the burst is stale, put it in the fillter table.
|
||||||
// (It might be an idle pattern.)
|
// (It might be an idle pattern.)
|
||||||
LOG(NOTICE) << "dumping STALE burst in TRX->USRP interface";
|
LOG(NOTICE) << "dumping STALE burst in TRX->USRP interface";
|
||||||
const GSM::Time& nextTime = staleBurst->time();
|
const GSM::Time& nextTime = staleBurst->getTime();
|
||||||
int TN = nextTime.TN();
|
int TN = nextTime.TN();
|
||||||
int modFN = nextTime.FN() % fillerModulus[TN];
|
int modFN = nextTime.FN() % fillerModulus[TN];
|
||||||
delete fillerTable[modFN][TN];
|
delete fillerTable[modFN][TN];
|
||||||
|
@ -282,11 +282,11 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
|
|
||||||
if (!rxBurst) return NULL;
|
if (!rxBurst) return NULL;
|
||||||
|
|
||||||
LOG(DEBUG) << "receiveFIFO: read radio vector at time: " << rxBurst->time() << ", new size: " << mReceiveFIFO->size();
|
LOG(DEBUG) << "receiveFIFO: read radio vector at time: " << rxBurst->getTime() << ", new size: " << mReceiveFIFO->size();
|
||||||
|
|
||||||
int timeslot = rxBurst->time().TN();
|
int timeslot = rxBurst->getTime().TN();
|
||||||
|
|
||||||
CorrType corrType = expectedCorrType(rxBurst->time());
|
CorrType corrType = expectedCorrType(rxBurst->getTime());
|
||||||
|
|
||||||
if ((corrType==OFF) || (corrType==IDLE)) {
|
if ((corrType==OFF) || (corrType==IDLE)) {
|
||||||
delete rxBurst;
|
delete rxBurst;
|
||||||
|
@ -299,26 +299,26 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
float TOA = 0.0;
|
float TOA = 0.0;
|
||||||
float avgPwr = 0.0;
|
float avgPwr = 0.0;
|
||||||
if (!energyDetect(*vectorBurst,20*mSamplesPerSymbol,mEnergyThreshold,&avgPwr)) {
|
if (!energyDetect(*vectorBurst,20*mSamplesPerSymbol,mEnergyThreshold,&avgPwr)) {
|
||||||
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->time();
|
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime();
|
||||||
double framesElapsed = rxBurst->time()-prevFalseDetectionTime;
|
double framesElapsed = rxBurst->getTime()-prevFalseDetectionTime;
|
||||||
if (framesElapsed > 50) { // if we haven't had any false detections for a while, lower threshold
|
if (framesElapsed > 50) { // if we haven't had any false detections for a while, lower threshold
|
||||||
mEnergyThreshold -= 10.0/10.0;
|
mEnergyThreshold -= 10.0/10.0;
|
||||||
if (mEnergyThreshold < 0.0)
|
if (mEnergyThreshold < 0.0)
|
||||||
mEnergyThreshold = 0.0;
|
mEnergyThreshold = 0.0;
|
||||||
|
|
||||||
prevFalseDetectionTime = rxBurst->time();
|
prevFalseDetectionTime = rxBurst->getTime();
|
||||||
}
|
}
|
||||||
delete rxBurst;
|
delete rxBurst;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->time();
|
LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime();
|
||||||
|
|
||||||
// run the proper correlator
|
// run the proper correlator
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if (corrType==TSC) {
|
if (corrType==TSC) {
|
||||||
LOG(DEEPDEBUG) << "looking for TSC at time: " << rxBurst->time();
|
LOG(DEBUG) << "looking for TSC at time: " << rxBurst->getTime();
|
||||||
signalVector *channelResp;
|
signalVector *channelResp;
|
||||||
double framesElapsed = rxBurst->time()-channelEstimateTime[timeslot];
|
double framesElapsed = rxBurst->getTime()-channelEstimateTime[timeslot];
|
||||||
bool estimateChannel = false;
|
bool estimateChannel = false;
|
||||||
if ((framesElapsed > 50) || (channelResponse[timeslot]==NULL)) {
|
if ((framesElapsed > 50) || (channelResponse[timeslot]==NULL)) {
|
||||||
if (channelResponse[timeslot]) delete channelResponse[timeslot];
|
if (channelResponse[timeslot]) delete channelResponse[timeslot];
|
||||||
|
@ -353,15 +353,15 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
chanRespAmplitude[timeslot] = amplitude;
|
chanRespAmplitude[timeslot] = amplitude;
|
||||||
scaleVector(*channelResp, complex(1.0,0.0)/amplitude);
|
scaleVector(*channelResp, complex(1.0,0.0)/amplitude);
|
||||||
designDFE(*channelResp, SNRestimate[timeslot], 7, &DFEForward[timeslot], &DFEFeedback[timeslot]);
|
designDFE(*channelResp, SNRestimate[timeslot], 7, &DFEForward[timeslot], &DFEFeedback[timeslot]);
|
||||||
channelEstimateTime[timeslot] = rxBurst->time();
|
channelEstimateTime[timeslot] = rxBurst->getTime();
|
||||||
LOG(DEBUG) << "SNR: " << SNRestimate[timeslot] << ", DFE forward: " << *DFEForward[timeslot] << ", DFE backward: " << *DFEFeedback[timeslot];
|
LOG(DEBUG) << "SNR: " << SNRestimate[timeslot] << ", DFE forward: " << *DFEForward[timeslot] << ", DFE backward: " << *DFEFeedback[timeslot];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
double framesElapsed = rxBurst->time()-prevFalseDetectionTime;
|
double framesElapsed = rxBurst->getTime()-prevFalseDetectionTime;
|
||||||
LOG(DEEPDEBUG) << "wTime: " << rxBurst->time() << ", pTime: " << prevFalseDetectionTime << ", fElapsed: " << framesElapsed;
|
LOG(DEBUG) << "wTime: " << rxBurst->getTime() << ", pTime: " << prevFalseDetectionTime << ", fElapsed: " << framesElapsed;
|
||||||
mEnergyThreshold += 10.0F/10.0F*exp(-framesElapsed);
|
mEnergyThreshold += 10.0F/10.0F*exp(-framesElapsed);
|
||||||
prevFalseDetectionTime = rxBurst->time();
|
prevFalseDetectionTime = rxBurst->getTime();
|
||||||
channelResponse[timeslot] = NULL;
|
channelResponse[timeslot] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,9 +379,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
channelResponse[timeslot] = NULL;
|
channelResponse[timeslot] = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
double framesElapsed = rxBurst->time()-prevFalseDetectionTime;
|
double framesElapsed = rxBurst->getTime()-prevFalseDetectionTime;
|
||||||
mEnergyThreshold += (1.0F/10.0F)*exp(-framesElapsed);
|
mEnergyThreshold += (1.0F/10.0F)*exp(-framesElapsed);
|
||||||
prevFalseDetectionTime = rxBurst->time();
|
prevFalseDetectionTime = rxBurst->getTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG(DEBUG) << "energy Threshold = " << mEnergyThreshold;
|
LOG(DEBUG) << "energy Threshold = " << mEnergyThreshold;
|
||||||
|
@ -403,7 +403,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
||||||
*DFEForward[timeslot],
|
*DFEForward[timeslot],
|
||||||
*DFEFeedback[timeslot]);
|
*DFEFeedback[timeslot]);
|
||||||
}
|
}
|
||||||
wTime = rxBurst->time();
|
wTime = rxBurst->getTime();
|
||||||
RSSI = (int) floor(20.0*log10(rxFullScale/amplitude.abs()));
|
RSSI = (int) floor(20.0*log10(rxFullScale/amplitude.abs()));
|
||||||
LOG(DEBUG) << "RSSI: " << RSSI;
|
LOG(DEBUG) << "RSSI: " << RSSI;
|
||||||
timingOffset = (int) round(TOA*256.0/mSamplesPerSymbol);
|
timingOffset = (int) round(TOA*256.0/mSamplesPerSymbol);
|
||||||
|
|
|
@ -26,7 +26,7 @@ radioVector::radioVector(const signalVector& wVector, GSM::Time& wTime)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GSM::Time radioVector::time() const
|
GSM::Time radioVector::getTime() const
|
||||||
{
|
{
|
||||||
return mTime;
|
return mTime;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ GSM::Time VectorQueue::nextTime() const
|
||||||
while (mQ.size()==0)
|
while (mQ.size()==0)
|
||||||
mWriteSignal.wait(mLock);
|
mWriteSignal.wait(mLock);
|
||||||
|
|
||||||
retVal = mQ.top()->time();
|
retVal = mQ.top()->getTime();
|
||||||
mLock.unlock();
|
mLock.unlock();
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
|
@ -78,7 +78,7 @@ radioVector* VectorQueue::getStaleBurst(const GSM::Time& targTime)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mQ.top()->time() < targTime) {
|
if (mQ.top()->getTime() < targTime) {
|
||||||
radioVector* retVal = mQ.top();
|
radioVector* retVal = mQ.top();
|
||||||
mQ.pop();
|
mQ.pop();
|
||||||
mLock.unlock();
|
mLock.unlock();
|
||||||
|
@ -97,7 +97,7 @@ radioVector* VectorQueue::getCurrentBurst(const GSM::Time& targTime)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mQ.top()->time() == targTime) {
|
if (mQ.top()->getTime() == targTime) {
|
||||||
radioVector* retVal = mQ.top();
|
radioVector* retVal = mQ.top();
|
||||||
mQ.pop();
|
mQ.pop();
|
||||||
mLock.unlock();
|
mLock.unlock();
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
class radioVector : public signalVector {
|
class radioVector : public signalVector {
|
||||||
public:
|
public:
|
||||||
radioVector(const signalVector& wVector, GSM::Time& wTime);
|
radioVector(const signalVector& wVector, GSM::Time& wTime);
|
||||||
GSM::Time time() const;
|
GSM::Time getTime() const;
|
||||||
void setTime(const GSM::Time& wTime);
|
void setTime(const GSM::Time& wTime);
|
||||||
bool operator>(const radioVector& other) const;
|
bool operator>(const radioVector& other) const;
|
||||||
|
|
||||||
|
|
Reference in New Issue