Ejemplo n.º 1
0
                                         2000)
            signalDF = butterWorthFilter(signalD, meta_data["sampling_rate"],
                                         2000)
            TDOA_CSOM1, t, csom = tdoa_csom(signalAF,
                                            signalBF,
                                            fs=meta_data["sampling_rate"],
                                            window=200)
            TDOA_CSOM2, t, csom = tdoa_csom(signalCF,
                                            signalDF,
                                            fs=meta_data["sampling_rate"],
                                            window=200)
            TDOA_real1 = getRealTDOA(source_pos, micA, micB)
            TDOA_real2 = getRealTDOA(source_pos, micC, micD)

            # Get Real Data
            angleReal = 90 - angle_degree(
                getAngle_angle1(getPoint(0, 0), source_pos))
            distanceReal = distance(source_pos, getPoint(0, 0))

            # Calculate True K
            K_true = 0
            for k in range(0, len(micList)):
                K_true += signalsPower[k] * distance(
                    micList[k], source_pos) * distance(micList[k], source_pos)
            K_true /= len(micList)

            # Calculate K estimation
            K_estim_exakt = list()
            K_estim_noise = list()
            for i in range(0, len(micList)):
                for j in range(0, len(micList)):
                    if (i != j):
                                            fs=meta["sampling_rate"],
                                            window=2000)
            TDOA_real1 = getRealTDOA(source_pos, micA, micB)
            TDOA_real2 = getRealTDOA(source_pos, micC, micD)

            # SSL - TDOA_LIN
            estimationLIN = SSL_TDOA_LIN(TDOA_CSOM1, TDOA_CSOM2, micA, micB,
                                         micC, micD)

            # SSL - TDOA_NOL
            estimationNOL = SSL_TDOA_NOL(TDOA_CSOM1, TDOA_CSOM2, micA, micB,
                                         micC, micD, estimationLIN)

            # Distance
            distanceReal = distance(source_pos, getPoint(0, 0))
            angleReal = 90 - angle_degree(
                getAngle_angle1(getPoint(0, 0), source_pos))

            distanceLIN = distance(source_pos, estimationLIN)
            distanceNOL = distance(source_pos, estimationNOL)
            angleLIN = 90 - angle_degree(
                getAngle_angle1(getPoint(0, 0), estimationLIN))
            angleNOL = 90 - angle_degree(
                getAngle_angle1(getPoint(0, 0), estimationNOL))

            #            print("angles ° ",angleReal,angleLIN,angleNOL)
            #            print("distances m ",distanceReal,distanceLIN, distanceNOL)

            TDOA_error1 = np.sqrt(
                (TDOA_real1 - TDOA_CSOM1) * (TDOA_real1 - TDOA_CSOM1))
            TDOA_error2 = np.sqrt(
                (TDOA_real2 - TDOA_CSOM2) * (TDOA_real2 - TDOA_CSOM2))