mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
Projector: fixed DOA calculation
This commit is contained in:
parent
d1b80524ea
commit
4d14f332bc
@ -70,18 +70,21 @@ Real Projector::run(const Sample& s)
|
||||
}
|
||||
break;
|
||||
case ProjectionPhase:
|
||||
v = std::atan2((float) s.m_imag, (float) s.m_real) / M_PI;
|
||||
v = std::atan2((float) s.m_imag, (float) s.m_real) / M_PI; // normalize
|
||||
break;
|
||||
case ProjectionDOAP:
|
||||
{
|
||||
Real p = std::atan2((float) s.m_imag, (float) s.m_real) / M_PI; // calculate phase. Assume phase difference between
|
||||
v = acos(p) / M_PI; // two sources at half wavelength distance with sources axis as reference (positive side)
|
||||
// calculate phase. Assume phase difference between two sources at half wavelength distance with sources axis as reference (positive side)
|
||||
// cos(theta) = phi / 2*pi*k
|
||||
Real p = std::atan2((float) s.m_imag, (float) s.m_real); // do not mormalize phi (phi in -pi..+pi)
|
||||
v = acos(p/M_PI) / M_PI; // normalize theta
|
||||
}
|
||||
break;
|
||||
case ProjectionDOAN:
|
||||
{
|
||||
Real p = std::atan2((float) s.m_imag, (float) s.m_real) / M_PI; // calculate phase. Assume phase difference between
|
||||
v = -(acos(p) / M_PI); // two sources at half wavelength distance with sources axis as reference (negative source)
|
||||
// calculate phase. Assume phase difference between two sources at half wavelength distance with sources axis as reference (negative source)
|
||||
Real p = std::atan2((float) s.m_imag, (float) s.m_real); // do not mormalize phi (phi in -pi..+pi)
|
||||
v = -acos(p/M_PI) / M_PI; // normalize theta
|
||||
}
|
||||
break;
|
||||
case ProjectionDPhase:
|
||||
@ -223,5 +226,3 @@ Real Projector::normalizeAngle(Real angle)
|
||||
}
|
||||
return angle;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user