Part of a program that estimates the direction of arrival of a signal

Dependencies:   mbed dsp

Revision:
7:25dacf35f4c7
Parent:
6:697b75e941a7
Child:
8:aaf5cde0aa0a
--- a/AoA_Est.h	Tue Apr 26 02:52:02 2016 +0000
+++ b/AoA_Est.h	Wed Apr 27 17:11:16 2016 +0000
@@ -110,12 +110,12 @@
     bool flag = false;
     confidence = 0;
     for (short i = 1; i <= sensors-1; i++) {
-        if (abs(angle - ambigAngles[0][i]) < abs(angle-ambigAngles[1][i]) && abs(angle-ambigAngles[0][i]) < 30) {
+        if (abs(angle - ambigAngles[0][i]) < abs(angle-ambigAngles[1][i]) && abs(angle-ambigAngles[0][i]) < 40) {
             angle = ambigAngles[0][i];
             avg += ambigAngles[0][i];
             confidence++;
         }
-        else if (abs(angle - ambigAngles[1][i]) < abs(angle-ambigAngles[0][i]) && abs(angle - ambigAngles[1][i]) < 30) {
+        else if (abs(angle - ambigAngles[1][i]) < abs(angle-ambigAngles[0][i]) && abs(angle - ambigAngles[1][i]) < 40) {
             angle = ambigAngles[1][i];
             avg += ambigAngles[1][i];
             confidence++;
@@ -129,7 +129,7 @@
 
     }
 
-    return avg / (confidence+1);//change when comute the other way
+    return avg / (confidence+1);//change when compute the other way
 }
 
 void AoA_Est :: comparative_Phases(float phas[]) {