1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

DOA2: fixed phase difference sign

This commit is contained in:
f4exb 2022-06-01 20:15:57 +02:00
parent 7e8db84e67
commit 016c6964c2
3 changed files with 13 additions and 8 deletions

View File

@ -269,7 +269,7 @@ void DOA2Baseband::setFFTAveraging(int nbFFT)
m_samplesCount = 0; m_samplesCount = 0;
} }
void DOA2Baseband::processDOA(const std::vector<Complex>::iterator& begin, int nbSamples) void DOA2Baseband::processDOA(const std::vector<Complex>::iterator& begin, int nbSamples, bool reverse)
{ {
const std::vector<Complex>::iterator end = begin + nbSamples; const std::vector<Complex>::iterator end = begin + nbSamples;
@ -290,7 +290,7 @@ void DOA2Baseband::processDOA(const std::vector<Complex>::iterator& begin, int n
{ {
if (++m_fftAvgCount == m_fftAvg) 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; m_fftAvgCount = 0;
} }
} }

View File

@ -118,7 +118,7 @@ private:
void processFifo(const std::vector<SampleVector>& data, unsigned int ibegin, unsigned int iend); void processFifo(const std::vector<SampleVector>& data, unsigned int ibegin, unsigned int iend);
void run(); void run();
bool handleMessage(const Message& cmd); bool handleMessage(const Message& cmd);
void processDOA(const std::vector<Complex>::iterator& begin, int nbSamples); void processDOA(const std::vector<Complex>::iterator& begin, int nbSamples, bool reverse = true);
DOA2Correlator m_correlator; DOA2Correlator m_correlator;
DOA2Settings::CorrelationType m_correlationType; DOA2Settings::CorrelationType m_correlationType;

View File

@ -2,7 +2,12 @@
<h2>Introduction</h2> <h2>Introduction</h2>
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 (&phi;) is negative from 0 (at right angle) to -&pi; (from B). When the wave comes from the back then &phi; is positive from 0 (at right angle) to &pi; (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: Example of setup:
@ -233,26 +238,26 @@ Known corrections and connections for some devices:
<tr> <tr>
<td>Pluto+</td> <td>Pluto+</td>
<td>&plusmn;180 &deg;</td> <td>&plusmn;180 &deg;</td>
<td>RX2</td>
<td>RX1</td> <td>RX1</td>
<td>RX2</td>
</tr> </tr>
<tr> <tr>
<td>BladeRF2</td> <td>BladeRF2</td>
<td>0 &deg;</td> <td>0 &deg;</td>
<td>RX2</td>
<td>RX1</td> <td>RX1</td>
<td>RX2</td>
</tr> </tr>
<tr> <tr>
<td>LimeSDR USB</td> <td>LimeSDR USB</td>
<td>variable</td> <td>variable</td>
<td>RX2</td>
<td>RX1</td> <td>RX1</td>
<td>RX2</td>
</tr> </tr>
<tr> <tr>
<td>XTRX</td> <td>XTRX</td>
<td>variable</td> <td>variable</td>
<td>RX2</td>
<td>RX1</td> <td>RX1</td>
<td>RX2</td>
</tr> </tr>
</table> </table>