Beispiel #1
0
            micC = micList[idxC - 1]
            micD = micList[idxD - 1]
            signalA = data[idxA]
            signalB = data[idxB]
            signalC = data[idxC]
            signalD = data[idxD]
            signalAF = butterWorthFilter(signalA, meta_data["sampling_rate"],
                                         2000)
            signalBF = butterWorthFilter(signalB, meta_data["sampling_rate"],
                                         2000)
            signalCF = butterWorthFilter(signalC, meta_data["sampling_rate"],
                                         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
Beispiel #2
0
                                  dis * np.cos(angle_radians(ang)))
            config = updateConfig(config, micA, micB, noise_microphone,
                                  noise_environment, noise_source, source_pos)

            # Starte Simulation
            loaded = simulate(config, config["source_position"],
                              signal_function)
            signals = loaded.get_measurements()
            meta = loaded.get_meta_data()
            signalA = signals[0]
            signalB = signals[1]
            signalAF = butterWorthFilter(signalA, meta["sampling_rate"], 1500)
            signalBF = butterWorthFilter(signalB, meta["sampling_rate"], 1500)

            TDOA_CSOM, t, csom = tdoa_csom(signalAF,
                                           signalBF,
                                           fs=meta["sampling_rate"],
                                           window=1000)
            TDOA_real = getRealTDOA(source_pos, micA, micB)
            a, b, c, SNR = getSNR(signalAF)

            SNRls.append(SNR)
            TDOA_realls.append(TDOA_real)
            TDOA_csomls.append(TDOA_CSOM)

        print(dis, ";", ang, ";", source_pos, ";", np.average(SNRls), ";",
              np.std(SNRls), ";", np.average(TDOA_realls), ";",
              np.std(TDOA_realls), ";", np.average(TDOA_csomls), ";",
              np.std(TDOA_csomls))
        print(dis,
              ";",
              ang,