コード例 #1
0
def perform_estimation(residuals, residuals_posterior, tracker, H_arr, Ks):
    cor = Correlator(residuals)
    correlation = cor.autocorrelation(used_taps)
    R_mehra = estimate_noise_mehra(correlation, Ks[-1], tracker.F, H_arr[-1])
    R_extended = estimate_noise_extended(correlation, Ks, tracker.F, H_arr)
    R_approx = estimate_noise_approx(correlation[0], H_arr[-1], tracker.P)
    cor_posterior = Correlator(residuals_posterior)
    correlation_posterior = cor_posterior.autocorrelation(used_taps)
    R_approx_posterior = estimate_noise_approx(correlation_posterior[0],
                                               H_arr[-1], tracker.P,
                                               "posterior")

    truth = R_proto * measurement_var
    error_extended = matrix_error(R_extended, truth)
    error_mehra = matrix_error(R_mehra, truth)
    error_approx = matrix_error(R_approx, truth)
    error_approx_posterior = matrix_error(R_approx_posterior, truth)

    print("Extended estimation:")
    print("\tEstimated R:", R_extended)
    print("\tError: %.6f" % error_extended)
    print("Mehra estimation:")
    print("\tEstimated R:", R_mehra)
    print("\tError: %.6f" % error_mehra)
    print("Approximate estimation:")
    print("\tEstimated R:", R_approx)
    print("\tError: %.6f" % error_approx)
    print("Approximate estimation (posterior):")
    print("\tEstimated R:", R_approx_posterior)
    print("\tError: %.6f" % error_approx_posterior)

    return (error_extended, error_mehra, error_approx, error_approx_posterior)
コード例 #2
0
def perform_estimation(residuals, tracker, F_arr, K_arr):
    residuals = residuals - np.average(residuals, axis=0)
    cor = Correlator(residuals)
    C_arr = cor.autocorrelation(used_taps)
    R = estimate_noise_mehra(C_arr, tracker.K, tracker.F, tracker.H)
    R_approx = estimate_noise_approx(C_arr[0], tracker.H, tracker.P)
    R_extended = estimate_noise_extended(C_arr, K_arr, F_arr, tracker.H)
    return R_approx
コード例 #3
0
def perform_estimation(residuals, tracker, F_arr, K_arr):
    cor = Correlator(residuals)
    C_arr = cor.autocorrelation(used_taps)
    print("Simulated:\n", R_proto * sim_var)
    R = estimate_noise_mehra(C_arr, tracker.K, tracker.F, tracker.H)
    print("Mehra:\n", R)
    R_approx = estimate_noise_approx(C_arr[0], tracker.H, tracker.P)
    print("Approximation:\n", R_approx)
    R_extended = estimate_noise_extended(C_arr, K_arr, F_arr, tracker.H)
    print("Extended:\n", R_extended)
コード例 #4
0
 def test_extended_estimate(self):
     C_arr = np.asarray([[[31.371682426081264]], [[-6.9977524908455147]],
                         [[0.70876720569959328]], [[-7.1734736799032239]],
                         [[6.8883804618764914]], [[-2.6670500807302022]]])
     K = np.asarray([[0.32765478], [0.64824051]])
     F = np.array([[1, 0.1], [0, 1]])
     H_arr = np.array([[[1, 0]], [[0.9, 0]], [[1.1, 0]], [[1, 0]],
                       [[1, 1.1]]])
     R = estimate_noise_extended(C_arr, K, F, H_arr)
     assert R.shape == (1, 1)
コード例 #5
0
ファイル: compare.py プロジェクト: gumpfly/noiseestimation
def perform_estimation(residuals, tracker, H, F_arr, K_arr):
    cor = Correlator(residuals)
    correlation = cor.autocorrelation(used_taps)
    R_extended = estimate_noise_extended(correlation, K_arr, F_arr, H)
    R_mehra = estimate_noise_mehra(correlation, K_arr[-1], F_arr[-1], H)
    R_approx = estimate_noise_approx(correlation[0], H, tracker.P)
    truth = R_proto * measurement_var
    error_extended = matrix_error(R_extended, truth)
    error_mehra = matrix_error(R_mehra, truth)
    error_approx = matrix_error(R_approx, truth)
    return (error_extended, error_mehra, error_approx)
コード例 #6
0
def perform_estimation(residuals, tracker, F_arr, Ks):
    residuals = residuals - np.average(residuals, axis=0)
    cor = Correlator(residuals)
    C_arr = cor.autocorrelation(used_taps)
    truth = R_proto * (sim_var + measurement_var)
    R = estimate_noise_mehra(C_arr, tracker.K, tracker.F, tracker.H)
    error_mehra = matrix_error(R, truth)
    R_approx = estimate_noise_approx(C_arr[0], tracker.H, tracker.P)
    error_approx = matrix_error(R_approx, truth)
    R_extended = estimate_noise_extended(C_arr, Ks, F_arr, tracker.H)
    error_extended = matrix_error(R_extended, truth)
    return (error_mehra, error_approx, error_extended)
コード例 #7
0
ファイル: estimate.py プロジェクト: gumpfly/noiseestimation
def perform_estimation(residuals, tracker, F_arr, K_arr):
    cor = Correlator(residuals)
    correlation = cor.autocorrelation(used_taps)
    R_extended = estimate_noise_extended(correlation, K_arr, F_arr, tracker.H)
    R_mehra = estimate_noise_mehra(correlation, K_arr[-1], F_arr[-1],
                                   tracker.H)
    R_approx = estimate_noise_approx(correlation[0], tracker.H, tracker.P)
    truth = R_proto * measurement_var
    print("Truth:\n", truth)
    print("Extended Estimation:\n", R_extended)
    print("Error:\n", matrix_error(R_extended, truth))
    print("Mehra estimation:\n", R_mehra)
    print("Error:\n", matrix_error(R_mehra, truth))
    print("Approximated estimation:\n", R_approx)
    print("Error:\n", matrix_error(R_approx, truth))
    print("-" * 15)
    error = matrix_error(R_extended, truth)
    return error
コード例 #8
0
def perform_estimation(residuals, tracker, F_arr, K_arr):
    residuals = residuals - np.average(residuals, axis=0)
    cor = Correlator(residuals)
    C_arr = cor.autocorrelation(used_taps)
    truth = R_proto * sim_var
    matrix_size = matrix_error(truth, 0)
    print("Truth:\n", truth)
    R = estimate_noise_mehra(C_arr, tracker.K, tracker.F, tracker.H)
    error_R = matrix_error(R, truth)
    print("Mehra:\n", R)
    print("\t Relative error: %.6f" % (error_R / matrix_size))
    R_extended = estimate_noise_extended(C_arr, K_arr, F_arr, tracker.H)
    error_R_extended = matrix_error(R_extended, truth)
    print("Extended:\n", R_extended)
    print("\t Relative error: %.6f" % (error_R_extended / matrix_size))
    R_approx = estimate_noise_approx(C_arr[0], tracker.H, tracker.P)
    error_R_approx = matrix_error(R_approx, truth)
    print("Approximation:\n", R_approx)
    print("\t Relative error: %.6f" % (error_R_approx / matrix_size))