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>
This commit is contained in:
Thomas Tsou 2013-11-09 22:05:23 -05:00
parent f8bc7c351f
commit d0f3ca3e94
3 changed files with 17 additions and 4 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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;