diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-08-20 15:41:45 -0400 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-10-18 13:04:15 -0400 |
commit | d24cc2cd9647c56c0103490c3a0bfc1dd13d6cd2 (patch) | |
tree | 4a4476a77a240903a41bd424b3ff4e83beb63f89 /Transceiver52M/Transceiver.cpp | |
parent | ddd6defb431ddca2d6f1293082fadcd7a044910a (diff) |
Transceiver52M: Rename samples-per-symbol variable names
Because repeatedly typing mSamplesPerSymbol is giving me
carpal tunnel syndrome. Replace with the much shorter,
easier to type, and just as clear name of 'sps'.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 7054dec..b60496a 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -50,7 +50,7 @@ using namespace GSM; Transceiver::Transceiver(int wBasePort, const char *TRXAddress, - int wSamplesPerSymbol, + int wSPS, GSM::Time wTransmitLatency, RadioInterface *wRadioInterface) :mDataSocket(wBasePort+2,TRXAddress,wBasePort+102), @@ -66,7 +66,7 @@ Transceiver::Transceiver(int wBasePort, mTransmitPriorityQueueServiceLoopThread = new Thread(32768);///< thread to process transmit bursts from GSM core - mSamplesPerSymbol = wSamplesPerSymbol; + mSPS = wSPS; mRadioInterface = wRadioInterface; mTransmitLatency = wTransmitLatency; mTransmitDeadlineClock = startTime; @@ -76,9 +76,9 @@ Transceiver::Transceiver(int wBasePort, mMaxExpectedDelay = 0; // generate pulse and setup up signal processing library - gsmPulse = generateGSMPulse(2,mSamplesPerSymbol); + gsmPulse = generateGSMPulse(2, mSPS); LOG(DEBUG) << "gsmPulse: " << *gsmPulse; - sigProcLibSetup(mSamplesPerSymbol); + sigProcLibSetup(mSPS); txFullScale = mRadioInterface->fullScaleInputValue(); rxFullScale = mRadioInterface->fullScaleOutputValue(); @@ -87,7 +87,7 @@ Transceiver::Transceiver(int wBasePort, for (int i = 0; i < 8; i++) { signalVector* modBurst = modulateBurst(gDummyBurst,*gsmPulse, 8 + (i % 4 == 0), - mSamplesPerSymbol); + mSPS); scaleVector(*modBurst,txFullScale); fillerModulus[i]=26; for (int j = 0; j < 102; j++) { @@ -124,7 +124,7 @@ void Transceiver::addRadioVector(BitVector &burst, // modulate and stick into queue signalVector* modBurst = modulateBurst(burst,*gsmPulse, 8 + (wTime.TN() % 4 == 0), - mSamplesPerSymbol); + mSPS); scaleVector(*modBurst,txFullScale * pow(10,-RSSI/10)); radioVector *newVec = new radioVector(*modBurst,wTime); mTransmitPriorityQueue.write(newVec); @@ -137,7 +137,7 @@ void Transceiver::unModulateVector(signalVector wVector) { SoftVector *burst = demodulateBurst(wVector, *gsmPulse, - mSamplesPerSymbol, + mSPS, 1.0,0.0); LOG(DEBUG) << "LOGGED BURST: " << *burst; @@ -322,7 +322,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, complex amplitude = 0.0; float TOA = 0.0; float avgPwr = 0.0; - if (!energyDetect(*vectorBurst,20*mSamplesPerSymbol,mEnergyThreshold,&avgPwr)) { + if (!energyDetect(*vectorBurst, 20 * mSPS, mEnergyThreshold, &avgPwr)) { LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime(); double framesElapsed = rxBurst->getTime()-prevFalseDetectionTime; if (framesElapsed > 50) { // if we haven't had any false detections for a while, lower threshold @@ -358,7 +358,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, success = analyzeTrafficBurst(*vectorBurst, mTSC, 3.0, - mSamplesPerSymbol, + mSPS, &litude, &TOA, mMaxExpectedDelay, @@ -393,7 +393,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, // RACH burst success = detectRACHBurst(*vectorBurst, 5.0, // detection threshold - mSamplesPerSymbol, + mSPS, &litude, &TOA); if (success) { @@ -416,21 +416,21 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, if ((corrType==RACH) || (!needDFE)) { burst = demodulateBurst(*vectorBurst, *gsmPulse, - mSamplesPerSymbol, + mSPS, amplitude,TOA); } else { // TSC scaleVector(*vectorBurst,complex(1.0,0.0)/amplitude); burst = equalizeBurst(*vectorBurst, TOA-chanRespOffset[timeslot], - mSamplesPerSymbol, + mSPS, *DFEForward[timeslot], *DFEFeedback[timeslot]); } wTime = rxBurst->getTime(); RSSI = (int) floor(20.0*log10(rxFullScale/amplitude.abs())); LOG(DEBUG) << "RSSI: " << RSSI; - timingOffset = (int) round(TOA*256.0/mSamplesPerSymbol); + timingOffset = (int) round(TOA * 256.0 / mSPS); } //if (burst) LOG(DEBUG) << "burst: " << *burst << '\n'; @@ -497,7 +497,7 @@ void Transceiver::driveControl() // Prepare for thread start mPower = -20; mRadioInterface->start(); - generateRACHSequence(*gsmPulse,mSamplesPerSymbol); + generateRACHSequence(*gsmPulse, mSPS); // Start radio interface threads. mFIFOServiceLoopThread->start((void * (*)(void*))FIFOServiceLoopAdapter,(void*) this); @@ -589,7 +589,7 @@ void Transceiver::driveControl() sprintf(response,"RSP SETTSC 1 %d",TSC); else { mTSC = TSC; - generateMidamble(*gsmPulse,mSamplesPerSymbol,TSC); + generateMidamble(*gsmPulse, mSPS, TSC); sprintf(response,"RSP SETTSC 0 %d",TSC); } } |