diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-13 22:48:11 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-15 23:35:07 -0500 |
commit | a2fe91a688fb16f1055e3af77478cfb4bceb3ae2 (patch) | |
tree | 6ff5dc34e0664adeb7b2bd171e926e1fb48e6172 /Transceiver52M/Transceiver.cpp | |
parent | e1ce92599af0054590aadab5b04a5bdb24bf6243 (diff) |
Transceiver52M: Add vectorized radio burst capability
This patch allows multiple signalVectors to be stored within
a single radioVector object. The motivation is to provide
a facility for diversity and/or MIMO burst handling. When
no channel value is specified, single channel bevhaviour
is maintained.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 4bd3143..caf2452 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -165,23 +165,23 @@ bool Transceiver::init() return true; } -void Transceiver::addRadioVector(size_t chan, BitVector &burst, +void Transceiver::addRadioVector(size_t chan, BitVector &bits, int RSSI, GSM::Time &wTime) { + signalVector *burst; + radioVector *radio_burst; + if (chan >= mTxPriorityQueues.size()) { LOG(ALERT) << "Invalid channel " << chan; return; } - // modulate and stick into queue - signalVector* modBurst = modulateBurst(burst, - 8 + (wTime.TN() % 4 == 0), - mSPSTx); - scaleVector(*modBurst,txFullScale * pow(10,-RSSI/10)); - radioVector *newVec = new radioVector(*modBurst,wTime); - mTxPriorityQueues[chan].write(newVec); + burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), mSPSTx); + scaleVector(*burst, txFullScale * pow(10, -RSSI / 10)); + + radio_burst = new radioVector(wTime, burst); - delete modBurst; + mTxPriorityQueues[chan].write(radio_burst); } void Transceiver::pushRadioVector(GSM::Time &nowTime) @@ -202,7 +202,9 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) modFN = burst->getTime().FN() % state->fillerModulus[TN]; delete state->fillerTable[modFN][TN]; - state->fillerTable[modFN][TN] = burst; + state->fillerTable[modFN][TN] = burst->getVector(); + burst->setVector(NULL); + delete burst; } TN = nowTime.TN(); @@ -213,8 +215,10 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) if ((burst = mTxPriorityQueues[i].getCurrentBurst(nowTime))) { delete state->fillerTable[modFN][TN]; - state->fillerTable[modFN][TN] = burst; - bursts[i] = burst; + state->fillerTable[modFN][TN] = burst->getVector(); + bursts[i] = burst->getVector(); + burst->setVector(NULL); + delete burst; } } @@ -346,7 +350,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, int &RSSI, return NULL; } - signalVector *vectorBurst = rxBurst; + signalVector *vectorBurst = rxBurst->getVector(); energyDetect(*vectorBurst, 20 * mSPSRx, 0.0, &avg); |