diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-09 22:05:23 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-15 23:35:07 -0500 |
commit | d0f3ca3e94be458cde4b2654681ba2e7e21197b4 (patch) | |
tree | 7e9dece0893a26b01dfde17476fc569f06c5fad5 | |
parent | f8bc7c351ff96ffca57ad30535de315cf7e1c8ae (diff) |
Transceiver52M: Preallocate head room for burst correlation
Set a transceiver high level length value that specifies the largest
number of complex or real filter taps that we will encounter. This
allows preallocation of head room and prevents an extra allocation and
copy on every incoming receive burst.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r-- | Transceiver52M/radioInterface.cpp | 15 | ||||
-rw-r--r-- | Transceiver52M/radioVector.cpp | 5 | ||||
-rw-r--r-- | Transceiver52M/radioVector.h | 1 |
3 files changed, 17 insertions, 4 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp index d05dcf2..5cf34de 100644 --- a/Transceiver52M/radioInterface.cpp +++ b/Transceiver52M/radioInterface.cpp @@ -239,12 +239,19 @@ bool RadioInterface::driveReceiveRadio() const int symbolsPerSlot = gSlotLen + 8; int burstSize = (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx; - // while there's enough data in receive buffer, form received - // GSM bursts and pass up to Transceiver - // Using the 157-156-156-156 symbols per timeslot format. + /* + * Pre-allocate head room for the largest correlation size + * so we can later avoid a re-allocation and copy + * */ + size_t head = GSM::gRACHSynchSequence.size(); + + /* + * Form receive bursts and pass up to transceiver. Use repeating + * pattern of 157-156-156-156 symbols per timeslot + */ while (recvSz > burstSize) { for (size_t i = 0; i < mChans; i++) { - burst = new radioVector(burstSize, rcvClock); + burst = new radioVector(burstSize, head, rcvClock); unRadioifyVector((float *) (recvBuffer[i]->begin() + readSz), *burst); if (mReceiveFIFO[i].size() < 32) diff --git a/Transceiver52M/radioVector.cpp b/Transceiver52M/radioVector.cpp index c50cfa5..8ab6695 100644 --- a/Transceiver52M/radioVector.cpp +++ b/Transceiver52M/radioVector.cpp @@ -31,6 +31,11 @@ radioVector::radioVector(size_t size, GSM::Time& wTime) { } +radioVector::radioVector(size_t size, size_t start, GSM::Time& wTime) + : signalVector(size, start), mTime(wTime) +{ +} + GSM::Time radioVector::getTime() const { return mTime; diff --git a/Transceiver52M/radioVector.h b/Transceiver52M/radioVector.h index 5ddb638..c5c255b 100644 --- a/Transceiver52M/radioVector.h +++ b/Transceiver52M/radioVector.h @@ -30,6 +30,7 @@ class radioVector : public signalVector { public: radioVector(const signalVector& wVector, GSM::Time& wTime); radioVector(size_t size, GSM::Time& wTime); + radioVector(size_t size, size_t start, GSM::Time& wTime); GSM::Time getTime() const; void setTime(const GSM::Time& wTime); bool operator>(const radioVector& other) const; |