aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterface.cpp
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2013-11-13 23:38:09 -0500
committerThomas Tsou <tom@tsou.cc>2013-11-15 23:35:07 -0500
commite90a42becce19e9adcbf648d34fec5332cebc5ba (patch)
treedd384cb7d1352ffddb18e6844590e3cb1b9dac93 /Transceiver52M/radioInterface.cpp
parent30421a7e252889efbd1941d5220d06cbf7161160 (diff)
Transceiver52M: Add dual channel diversity receiver option
This patch add support for dual channel diversity on the receive path. This allows two antennas two shared antennas to be used for each ARFCN handling channel in the receiver. This configuration may improvde performance in multi-path fading environments, however, noise andpotential interference levels are increased due to the higher bandwidth used. The receive path is oversampled by a factor of four for a rate of 1.083333 Msps. If the receive paths are tuned within a maximum channel spacing (currently set at 600 kHz), then both ARFCN frequencies are processed by each channel of the receiver. Otherwise, the frequency shifted diversity path is disabled and standard non-diversity operation takes place. Diversity processing is handled by selecting the path with the higheset energy level and discarding the burst on the second path. Selection occurs on a burst-by-burst basis. Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/radioInterface.cpp')
-rw-r--r--Transceiver52M/radioInterface.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index 43fa3a3..ff9f493 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -34,10 +34,9 @@ extern "C" {
#define NUMCHUNKS 4
RadioInterface::RadioInterface(RadioDevice *wRadio,
- int wReceiveOffset,
- size_t sps, size_t chans,
- GSM::Time wStartTime)
- : mRadio(wRadio), mSPSTx(sps), mSPSRx(1), mChans(chans),
+ size_t sps, size_t chans, size_t diversity,
+ int wReceiveOffset, GSM::Time wStartTime)
+ : mRadio(wRadio), mSPSTx(sps), mSPSRx(1), mChans(chans), mMIMO(diversity),
sendCursor(0), recvCursor(0), underrun(false), overrun(false),
receiveOffset(wReceiveOffset), mOn(false), powerScaling(1.0),
loadTest(false)
@@ -52,11 +51,8 @@ RadioInterface::~RadioInterface(void)
bool RadioInterface::init(int type)
{
- if (type != RadioDevice::NORMAL)
- return false;
-
- if (!mChans) {
- LOG(ALERT) << "Invalid number of channels " << mChans;
+ if ((type != RadioDevice::NORMAL) || (mMIMO > 1) || !mChans) {
+ LOG(ALERT) << "Invalid configuration";
return false;
}
@@ -251,10 +247,14 @@ bool RadioInterface::driveReceiveRadio()
*/
while (recvSz > burstSize) {
for (size_t i = 0; i < mChans; i++) {
- burst = new radioVector(rcvClock, burstSize, head);
+ burst = new radioVector(rcvClock, burstSize, head, mMIMO);
+
+ for (size_t n = 0; n < mMIMO; n++) {
+ unRadioifyVector((float *)
+ (recvBuffer[mMIMO * i + n]->begin() + readSz),
+ *burst->getVector(n));
+ }
- unRadioifyVector((float *) (recvBuffer[i]->begin() + readSz),
- *burst->getVector());
if (mReceiveFIFO[i].size() < 32)
mReceiveFIFO[i].write(burst);