|
@@ -9,6 +9,7 @@
|
|
|
extern COORD_T gLct_astLocationRefPoint[LCT_REF_POINT_MATRIX_LEN * LCT_REF_POINT_MATRIX_LEN];
|
|
|
extern flt32 gLct_fDelayDeviationMatrix[LCT_REF_POINT_MATRIX_LEN * LCT_REF_POINT_MATRIX_LEN];
|
|
|
extern LCT_COORDCAL_PARAM_T gg_stLctCoordcalParam;
|
|
|
+extern uint32 gLct_dwFpBaseOffset;
|
|
|
|
|
|
|
|
|
|
|
@@ -234,10 +235,22 @@ void lct_coordcal_gen_location_ref_point(COORD_T stLeftBottom, COORD_T stRightTo
|
|
|
|
|
|
void lct_coordcal_cal_coord_points(LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, COORD_T *pstLocationRefPoint, uint16 wMatrixRow, uint16 wMatrixCol, uint8 byFirstPathFlag, LCT_MINIMUM_VALUE_GROUP_T *pstMinmumValueGroup)
|
|
|
{
|
|
|
-
|
|
|
- lct_coordcal_cal_ref_point_delay(pstLocationRefPoint, wMatrixRow, wMatrixCol, pstFirstPathList, byFirstPathListLen, byFirstPathFlag, (flt32 *)gLct_fDelayDeviationMatrix);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ lct_coordcal_cal_ref_point_delay_deviation_with_tdoa(pstLocationRefPoint, wMatrixRow, wMatrixCol, pstFirstPathList, byFirstPathListLen, byFirstPathFlag, (flt32 *)gLct_fDelayDeviationMatrix);
|
|
|
+
|
|
|
+
|
|
|
lct_coordcal_sel_minimum_value((flt32 *)gLct_fDelayDeviationMatrix, wMatrixRow, wMatrixCol, pstLocationRefPoint, byFirstPathFlag, pstMinmumValueGroup);
|
|
|
|
|
|
return;
|
|
@@ -252,7 +265,7 @@ void lct_coordcal_cal_coord_points(LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFi
|
|
|
|
|
|
|
|
|
|
|
|
-void lct_coordcal_cal_ref_point_delay(COORD_T *pstRefPointMatrix, uint16 wMatrixRow, uint16 wMatrixCol, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, uint8 byFirstPathFlag, flt32 *pfDelayDeviationMatrix)
|
|
|
+void lct_coordcal_cal_ref_point_delay_deviation_with_tdoa(COORD_T *pstRefPointMatrix, uint16 wMatrixRow, uint16 wMatrixCol, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, uint8 byFirstPathFlag, flt32 *pfDelayDeviationMatrix)
|
|
|
{
|
|
|
LCT_FIRSTPATH_T stMainBts;
|
|
|
uint8 byExistFlag = 0;
|
|
@@ -367,6 +380,77 @@ void lct_coordcal_cal_ref_point_delay(COORD_T *pstRefPointMatrix, uint16 wMatrix
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+void lct_coordcal_cal_ref_point_distance_deviation_with_toa(COORD_T *pstRefPointMatrix, uint16 wMatrixRow, uint16 wMatrixCol, LCT_FIRSTPATH_T *pstFirstPathList, uint8 byFirstPathListLen, uint8 byFirstPathFlag, flt32 *pfDelayDeviationMatrix)
|
|
|
+{
|
|
|
+ COORD_T stLctRefPointCoord;
|
|
|
+ uint16 wIndex = 0;
|
|
|
+
|
|
|
+ COORD_T stSlaveBtsCoord;
|
|
|
+ uint32 dwSlaveBtsIndex = 0;
|
|
|
+ flt32 fSlaveSnr = 0;
|
|
|
+
|
|
|
+ flt32 fSlaveBtsDistance = 0;
|
|
|
+ flt32 fSlaveBtsSignalDistance = 0;
|
|
|
+
|
|
|
+ flt32 fDelayDeviation = 0;
|
|
|
+ flt32 fDelayDeviationSum = 0;
|
|
|
+
|
|
|
+
|
|
|
+ for (uint16 y = 0; y < wMatrixRow; y++)
|
|
|
+ {
|
|
|
+ for (uint16 x = 0; x < wMatrixCol; x++)
|
|
|
+ {
|
|
|
+ wIndex = y * wMatrixCol + x;
|
|
|
+ stLctRefPointCoord = pstRefPointMatrix[wIndex];
|
|
|
+
|
|
|
+
|
|
|
+ for (uint8 i = 0; i < byFirstPathListLen; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ stSlaveBtsCoord.dwX = pstFirstPathList[i].dwCoordX;
|
|
|
+ stSlaveBtsCoord.dwY = pstFirstPathList[i].dwCoordY;
|
|
|
+ stSlaveBtsCoord.dwZ = pstFirstPathList[i].dwCoordZ;
|
|
|
+
|
|
|
+
|
|
|
+ if (byFirstPathFlag <= 0)
|
|
|
+ {
|
|
|
+ dwSlaveBtsIndex = pstFirstPathList[i].dwCalPathIndex;
|
|
|
+ fSlaveSnr = pstFirstPathList[i].fCalPathIndexSnr;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dwSlaveBtsIndex = pstFirstPathList[i].dwTrackPathIndex;
|
|
|
+ fSlaveSnr = pstFirstPathList[i].fTrackPathIndexSnr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ fSlaveBtsDistance = util_distance_cal_p2p_space_distance(stLctRefPointCoord.dwX, stLctRefPointCoord.dwY, stLctRefPointCoord.dwZ, stSlaveBtsCoord.dwX, stSlaveBtsCoord.dwY, stSlaveBtsCoord.dwZ);
|
|
|
+ lct_coordcal_cal_distance_by_toa(dwSlaveBtsIndex, &fSlaveBtsSignalDistance);
|
|
|
+
|
|
|
+
|
|
|
+ fDelayDeviation = fSlaveBtsDistance - fSlaveBtsSignalDistance;
|
|
|
+
|
|
|
+ fDelayDeviationSum += fDelayDeviation * fDelayDeviation;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ pfDelayDeviationMatrix[wIndex] = fDelayDeviationSum;
|
|
|
+ fDelayDeviationSum = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -405,6 +489,18 @@ void lct_coordcal_cal_delay_by_first_path_index(uint32 dwMainBtsIndex, uint32 dw
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+void lct_coordcal_cal_distance_by_toa(uint32 dwBtsIndex, flt32 *pfTwoBtsDistance)
|
|
|
+{
|
|
|
+ int32 dwIndexGap = dwBtsIndex - gLct_dwFpBaseOffset;
|
|
|
+ *pfTwoBtsDistance = (dwIndexGap * PUB_AUDIO_SPEED) / (flt32)48000;
|
|
|
+
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -653,6 +749,7 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, PUB_LCT_BTS_LIST_
|
|
|
{
|
|
|
uint8 byMinimumNum = 0;
|
|
|
LCT_MINIMUM_VALUE_T *pstMiminumValueData = NULL;
|
|
|
+ uint32 dwCoordExpendLen = gg_stLctCoordcalParam.dwCoordExpendLen;
|
|
|
|
|
|
int32 dwTemp = 0;
|
|
|
int32 dwMinValueX = 2147483647;
|
|
@@ -742,7 +839,7 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, PUB_LCT_BTS_LIST_
|
|
|
dwY = pstMiminumValueData->stCoord.dwY;
|
|
|
if (dwGapY < 350)
|
|
|
{
|
|
|
- dwY = util_distance_gen_rand_num((dwMaxValueY + dwMinValueY) / 2, dwGapY / 10);
|
|
|
+ dwY = util_distance_gen_rand_num((dwMaxValueY + dwMinValueY) / 2, dwGapY / 2);
|
|
|
}
|
|
|
else if (dwGapY >= 350 && dwGapY < 900)
|
|
|
{
|
|
@@ -754,11 +851,11 @@ void lct_coordcal_dbcheck_minimum_value(uint8 byFirstPathFlag, PUB_LCT_BTS_LIST_
|
|
|
}
|
|
|
pstMiminumValueData->stCoord.dwY = dwY;
|
|
|
|
|
|
-
|
|
|
- dwMinValueX -= 300;
|
|
|
- dwMaxValueX += 300;
|
|
|
- dwMinValueY -= 300;
|
|
|
- dwMaxValueY += 300;
|
|
|
+
|
|
|
+ dwMinValueX -= dwCoordExpendLen;
|
|
|
+ dwMaxValueX += dwCoordExpendLen;
|
|
|
+ dwMinValueY -= dwCoordExpendLen;
|
|
|
+ dwMaxValueY += dwCoordExpendLen;
|
|
|
if ((dwX >= dwMinValueX) && (dwX <= dwMaxValueX) && (dwY >= dwMinValueY) && (dwY <= dwMaxValueY))
|
|
|
{
|
|
|
if (byFirstPathFlag == CAL_PATH)
|