aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterface.h
diff options
context:
space:
mode:
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/radioInterface.h
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/radioInterface.h')
-rw-r--r--Transceiver52M/radioInterface.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h
index ce06578..1f225a2 100644
--- a/Transceiver52M/radioInterface.h
+++ b/Transceiver52M/radioInterface.h
@@ -20,6 +20,7 @@
#include "radioDevice.h"
#include "radioVector.h"
#include "radioClock.h"
+#include "radioBuffer.h"
#include "Resampler.h"
static const unsigned gSlotLen = 148; ///< number of symbols per slot, not counting guard periods
@@ -40,10 +41,8 @@ protected:
size_t mChans;
size_t mMIMO;
- std::vector<signalVector *> sendBuffer;
- std::vector<signalVector *> recvBuffer;
- unsigned sendCursor;
- unsigned recvCursor;
+ std::vector<RadioBuffer *> sendBuffer;
+ std::vector<RadioBuffer *> recvBuffer;
std::vector<short *> convertRecvBuffer;
std::vector<short *> convertSendBuffer;
@@ -61,16 +60,14 @@ protected:
private:
- /** format samples to USRP */
- int radioifyVector(signalVector &wVector,
- float *floatVector,
- bool zero);
+ /** format samples to USRP */
+ int radioifyVector(signalVector &wVector, size_t chan, bool zero);
/** format samples from USRP */
- int unRadioifyVector(float *floatVector, signalVector &wVector);
+ int unRadioifyVector(signalVector *wVector, size_t chan);
/** push GSM bursts into the transmit buffer */
- virtual void pushBuffer(void);
+ virtual bool pushBuffer(void);
/** pull GSM bursts from the receive buffer */
virtual void pullBuffer(void);
@@ -152,20 +149,15 @@ void *AlignRadioServiceLoopAdapter(RadioInterface*);
#endif
class RadioInterfaceResamp : public RadioInterface {
-
private:
- signalVector *innerSendBuffer;
signalVector *outerSendBuffer;
- signalVector *innerRecvBuffer;
signalVector *outerRecvBuffer;
- void pushBuffer();
+ bool pushBuffer();
void pullBuffer();
public:
-
RadioInterfaceResamp(RadioDevice* wRadio, size_t wSPS = 4, size_t chans = 1);
-
~RadioInterfaceResamp();
bool init(int type);
@@ -184,7 +176,7 @@ public:
bool tuneRx(double freq, size_t chan);
private:
- std::vector<Resampler *> dnsamplers;
+ Resampler *dnsampler;
std::vector<float> phases;
signalVector *outerRecvBuffer;