diff --git a/plugins/channelmimo/doa2/doa2baseband.cpp b/plugins/channelmimo/doa2/doa2baseband.cpp index 8ae581f25..c47481441 100644 --- a/plugins/channelmimo/doa2/doa2baseband.cpp +++ b/plugins/channelmimo/doa2/doa2baseband.cpp @@ -269,7 +269,7 @@ void DOA2Baseband::setFFTAveraging(int nbFFT) m_samplesCount = 0; } -void DOA2Baseband::processDOA(const std::vector::iterator& begin, int nbSamples) +void DOA2Baseband::processDOA(const std::vector::iterator& begin, int nbSamples, bool reverse) { const std::vector::iterator end = begin + nbSamples; @@ -290,7 +290,7 @@ void DOA2Baseband::processDOA(const std::vector::iterator& begin, int n { if (++m_fftAvgCount == m_fftAvg) { - m_phi = m_wphSum / m_magSum; + m_phi = reverse ? -(m_wphSum / m_magSum) : (m_wphSum / m_magSum); m_fftAvgCount = 0; } } diff --git a/plugins/channelmimo/doa2/doa2baseband.h b/plugins/channelmimo/doa2/doa2baseband.h index 47c0f7dac..b0c34c0d8 100644 --- a/plugins/channelmimo/doa2/doa2baseband.h +++ b/plugins/channelmimo/doa2/doa2baseband.h @@ -118,7 +118,7 @@ private: void processFifo(const std::vector& data, unsigned int ibegin, unsigned int iend); void run(); bool handleMessage(const Message& cmd); - void processDOA(const std::vector::iterator& begin, int nbSamples); + void processDOA(const std::vector::iterator& begin, int nbSamples, bool reverse = true); DOA2Correlator m_correlator; DOA2Settings::CorrelationType m_correlationType; diff --git a/plugins/channelmimo/doa2/readme.md b/plugins/channelmimo/doa2/readme.md index c7bcbb8b0..e6cfdc3b2 100644 --- a/plugins/channelmimo/doa2/readme.md +++ b/plugins/channelmimo/doa2/readme.md @@ -2,7 +2,12 @@

Introduction

-This MIMO reception only (MI) plugin can be used to determine the direction of arrival (DOA) of an incoming wave on a 2 antenna system connected to a coherent dual receiving device in MIMO (thus MI) mode like BladeRF2 or Pluto+. It is assumed that antenna 1 is connected to stream 0 and antenna 2 is connected to stream 1. The direction of the antenna system goes from antenna 1 to antenna 2. The actual connections to RF ports is usually inverted so that antenna 1 is connected to port RX2 and antenna 2 to port RX1. See the table at the end of the document listing details of some known devices. +This MIMO reception only (MI) plugin can be used to determine the direction of arrival (DOA) of an incoming wave on a 2 antenna system connected to a coherent dual receiving device in MIMO (thus MI) mode like BladeRF2 or Pluto+. It is assumed that antenna A (or 1) (reference) is connected to stream 0 and antenna B (or 2) is connected to stream 1. The direction of the antenna system goes from antenna 1 to antenna 2. + +When a wave comes from the front i.e. it reaches B before A then A will lag with respect to B and thus B is in advance and since A is the reference the difference of phase (φ) is negative from 0 (at right angle) to -π (from B). When the wave comes from the back then φ is positive from 0 (at right angle) to π (from A) + + +Usually stream 0 is connected to RX1 port and stream 1 to RX2 port. See the table at the end of the document listing details of some known devices. Example of setup: @@ -233,26 +238,26 @@ Known corrections and connections for some devices: Pluto+ ±180 ° - RX2 RX1 + RX2 BladeRF2 0 ° - RX2 RX1 + RX2 LimeSDR USB variable - RX2 RX1 + RX2 XTRX variable - RX2 RX1 + RX2