aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterface.cpp
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2013-11-09 22:05:23 -0500
committerThomas Tsou <tom@tsou.cc>2013-11-15 23:35:07 -0500
commitd0f3ca3e94be458cde4b2654681ba2e7e21197b4 (patch)
tree7e9dece0893a26b01dfde17476fc569f06c5fad5 /Transceiver52M/radioInterface.cpp
parentf8bc7c351ff96ffca57ad30535de315cf7e1c8ae (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>
Diffstat (limited to 'Transceiver52M/radioInterface.cpp')
-rw-r--r--Transceiver52M/radioInterface.cpp15
1 files changed, 11 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)