path: root/Transceiver52M/signalVector.cpp
diff options
authorTom Tsou <tom.tsou@ettus.com>2015-08-21 19:32:58 -0700
committerTom Tsou <tom.tsou@ettus.com>2016-07-01 03:03:11 -0700
commit28670fb5dad8e48ff74051a5bbe0c8309b04c817 (patch)
treef93d11d8a26701cdecceebdf40b9fac006c8af03 /Transceiver52M/signalVector.cpp
parent05c6feb71dd2f66b74c9e1671d91570485479836 (diff)
iface: Add inner ring-buffer implementation
Two buffers, inner and outer, are used in the transceiver implementation. The outer buffer interfaces with the device receive interface to guarantee timestamp aligned and contiguously allocated sample buffers. The inner buffer absorbs vector size differences between GSM bursts (156 or 157 samples) and the resampler interface (typically fixed multiples of 65). Reimplement the inner buffer with a ring buffer that allows fixed size segments on the outer (resampler) portion and variable lengths (GSM side) on the inner side. Compared to the previous stack-like version, this implementation removes unnecessary copying of buffer contents. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M/signalVector.cpp')
1 files changed, 9 insertions, 0 deletions
diff --git a/Transceiver52M/signalVector.cpp b/Transceiver52M/signalVector.cpp
index 4b4099e..798a3c7 100644
--- a/Transceiver52M/signalVector.cpp
+++ b/Transceiver52M/signalVector.cpp
@@ -50,6 +50,15 @@ size_t signalVector::getStart() const
return mStart - mData;
+size_t signalVector::updateHistory()
+ size_t num = getStart();
+ memmove(mData, mStart + this->size() - num, num * sizeof(complex));
+ return num;
Symmetry signalVector::getSymmetry() const
return symmetry;