DOA2: fixed blind angle and documentation (again)

This commit is contained in:
f4exb 2022-06-01 01:08:22 +02:00
parent c6c0d2dc5e
commit 3abbf4aeba
9 changed files with 54 additions and 10 deletions

View File

@ -525,8 +525,11 @@ void DOA2::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
response.getDoa2Report()->setPhi(phi);
float hwl = 1.5e8 / (m_deviceCenterFrequency + m_frequencyOffset);
float cosTheta = (getPhi() * hwl * 1000.0) / (M_PI * m_settings.m_basebandDistance);
// float blindAngle = ((cosTheta < -1.0) || (cosTheta > 1.0) ? 0 : std::acos(hwl * 1000.0 / m_settings.m_basebandDistance)) * (180/M_PI);
float cosTheta = (getPhi()/M_PI) * ((hwl * 1000.0) / m_settings.m_basebandDistance);
float blindAngle = (m_settings.m_basebandDistance > hwl * 1000.0) ?
std::acos((hwl * 1000.0) / m_settings.m_basebandDistance) * (180/M_PI) :
0;
response.getDoa2Report()->setBlindAngle((int) blindAngle);
float doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
qDebug("DOA2::webapiFormatChannelReport: phi: %f cosT: %f DOAngle: %f", getPhi(), cosTheta, doaAngle);
float posAngle = normalizeAngle(m_settings.m_antennaAz - doaAngle, 360.0f); // DOA angles are trigonometric but displayed angles are clockwise

View File

@ -475,12 +475,10 @@ void DOA2GUI::updateScopeFScale()
void DOA2GUI::updateDOA()
{
float cosTheta = (m_doa2->getPhi() * m_hwl * 1000.0) / (M_PI * m_settings.m_basebandDistance);
float cosTheta = (m_doa2->getPhi()/M_PI) * ((m_hwl * 1000.0) / m_settings.m_basebandDistance);
float blindAngle = (m_settings.m_basebandDistance > m_hwl * 1000.0) ?
std::acos((m_hwl * 1000.0) / m_settings.m_basebandDistance) * (180/M_PI) :
(m_settings.m_basebandDistance < m_hwl * 1000.0) ?
std::acos(m_settings.m_basebandDistance / (m_hwl * 1000.0)) * (180/M_PI):
0;
0;
ui->compass->setBlindAngle(blindAngle);
float doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
float posAngle = ui->antAz->value() - doaAngle; // DOA angles are trigonometric but displayed angles are clockwise

View File

@ -199,9 +199,9 @@ In general the angle can be calculated from the baseline distance D (distance be
&phi; = &pi; D cos(&theta;) / (&lambda;/2) &rArr;
cos(&theta;) = (&phi; / &pi;) . ((&lambda;/2) / D)
If D is larger than half the wavelength (&lambda;/2) then a section in front of antenna 2 and at the back of antenna 1 cannot be reached since cos(&theta;) will lie in an interval smaller than [-1:1]. The value of half the sector angle is calculated assuming &phi;/&pi; = 1 and thus cos(&theta;0) = (&lambda;/2)/D This section is shown on the compass with a darker background (C.1.4)
If D is larger than &lambda;/2 the possible values of cos(&theta;) do not cover the whole [-1:1] interval and thus there is a blind sector at the front of antenna 2 and the back of antenna 1 which is shown onthe compass as a darker area (C.1.4). However signals coming from this blind sector will fold into the valid sector. Putting antennas further apart than &lambda;/2 can give more accurate measurements inside the valid sector at the condition you already validated the assunption that the incoming wave angle is insde the valid sector and that no significant signal from the blind sector can influence the masurement. One can imagine having a pair of directive antennas placed at a distance for which the valid sector matches the antenna system lobe for final accurate measurement.
If D is smaller than half the wavelength for the larger values of &phi; the resulting cos(&theta;) will lie outside the [-1:1] interval. In order to compute the acos the value is clamped to -1 or 1. Therefore some angles are inaccessible. Half the sector angle is given by cos(&theta;0) = D/(&lambda;/2).
If D is smaller than &lambda;/2 extreme incoming angles (0 or &pi;) yield smaller &phi; which will be compensated by the (&lambda;/2) / D factor however with less accuracy.
There are two possible angles for the incoming wave leading to the same phase difference. One from the port side of the antenna system (positive) and the other from the starboard side (negative).

View File

@ -4543,6 +4543,10 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "Calculated starboard side (negative) arrival angle in degrees from 0 to 180"
},
"blindAngle" : {
"type" : "integer",
"description" : "Blind angle (half sector)"
},
"fftSize" : {
"type" : "integer",
"description" : "Size of FFT used in correlation"
@ -56157,7 +56161,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-05-28T12:29:36.569+02:00
Generated 2022-05-31T23:33:55.570+02:00
</div>
</div>
</div>

View File

@ -57,6 +57,9 @@ DOA2Report:
negAz:
type: integer
description: Calculated starboard side (negative) arrival angle in degrees from 0 to 180
blindAngle:
type: integer
description: Blind angle (half sector)
fftSize:
type: integer
description: Size of FFT used in correlation

View File

@ -57,6 +57,9 @@ DOA2Report:
negAz:
type: integer
description: Calculated starboard side (negative) arrival angle in degrees from 0 to 180
blindAngle:
type: integer
description: Blind angle (half sector)
fftSize:
type: integer
description: Size of FFT used in correlation

View File

@ -4543,6 +4543,10 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "Calculated starboard side (negative) arrival angle in degrees from 0 to 180"
},
"blindAngle" : {
"type" : "integer",
"description" : "Blind angle (half sector)"
},
"fftSize" : {
"type" : "integer",
"description" : "Size of FFT used in correlation"
@ -56157,7 +56161,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2022-05-28T12:29:36.569+02:00
Generated 2022-05-31T23:33:55.570+02:00
</div>
</div>
</div>

View File

@ -34,6 +34,8 @@ SWGDOA2Report::SWGDOA2Report() {
m_pos_az_isSet = false;
neg_az = 0;
m_neg_az_isSet = false;
blind_angle = 0;
m_blind_angle_isSet = false;
fft_size = 0;
m_fft_size_isSet = false;
channel_sample_rate = 0;
@ -52,6 +54,8 @@ SWGDOA2Report::init() {
m_pos_az_isSet = false;
neg_az = 0;
m_neg_az_isSet = false;
blind_angle = 0;
m_blind_angle_isSet = false;
fft_size = 0;
m_fft_size_isSet = false;
channel_sample_rate = 0;
@ -65,6 +69,7 @@ SWGDOA2Report::cleanup() {
}
SWGDOA2Report*
@ -84,6 +89,8 @@ SWGDOA2Report::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&neg_az, pJson["negAz"], "qint32", "");
::SWGSDRangel::setValue(&blind_angle, pJson["blindAngle"], "qint32", "");
::SWGSDRangel::setValue(&fft_size, pJson["fftSize"], "qint32", "");
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
@ -113,6 +120,9 @@ SWGDOA2Report::asJsonObject() {
if(m_neg_az_isSet){
obj->insert("negAz", QJsonValue(neg_az));
}
if(m_blind_angle_isSet){
obj->insert("blindAngle", QJsonValue(blind_angle));
}
if(m_fft_size_isSet){
obj->insert("fftSize", QJsonValue(fft_size));
}
@ -153,6 +163,16 @@ SWGDOA2Report::setNegAz(qint32 neg_az) {
this->m_neg_az_isSet = true;
}
qint32
SWGDOA2Report::getBlindAngle() {
return blind_angle;
}
void
SWGDOA2Report::setBlindAngle(qint32 blind_angle) {
this->blind_angle = blind_angle;
this->m_blind_angle_isSet = true;
}
qint32
SWGDOA2Report::getFftSize() {
return fft_size;
@ -187,6 +207,9 @@ SWGDOA2Report::isSet(){
if(m_neg_az_isSet){
isObjectUpdated = true; break;
}
if(m_blind_angle_isSet){
isObjectUpdated = true; break;
}
if(m_fft_size_isSet){
isObjectUpdated = true; break;
}

View File

@ -50,6 +50,9 @@ public:
qint32 getNegAz();
void setNegAz(qint32 neg_az);
qint32 getBlindAngle();
void setBlindAngle(qint32 blind_angle);
qint32 getFftSize();
void setFftSize(qint32 fft_size);
@ -69,6 +72,9 @@ private:
qint32 neg_az;
bool m_neg_az_isSet;
qint32 blind_angle;
bool m_blind_angle_isSet;
qint32 fft_size;
bool m_fft_size_isSet;