From 74a838339305c534d307face37d8115e34a12793 Mon Sep 17 00:00:00 2001 From: miguekf Date: Sat, 10 Dec 2022 22:01:29 +0100 Subject: [PATCH] MOD: matlab utils --- src/utils/matlab/vtl/kf_prototype.m | 166 ++++++--- .../vtl/pvt_raw_plotting_SPIRENT_GnssSDR.m | 321 +++++++++--------- src/utils/matlab/vtl/vtl_general_plot.m | 160 ++++----- src/utils/matlab/vtl/vtl_prototype.m | 128 ++++--- 4 files changed, 416 insertions(+), 359 deletions(-) diff --git a/src/utils/matlab/vtl/kf_prototype.m b/src/utils/matlab/vtl/kf_prototype.m index 78bed097d..806c2139b 100644 --- a/src/utils/matlab/vtl/kf_prototype.m +++ b/src/utils/matlab/vtl/kf_prototype.m @@ -29,14 +29,14 @@ kf_yerr = zeros(2*sat_number, 1); kf_S = zeros(2*sat_number, 2*sat_number); % kf_P_y innovation covariance matrix %% State error Covariance Matrix Q (PVT) -kf_Q = [ 1 0 0 0 0 0 0 0 - 0 1 0 0 0 0 0 0 - 0 0 1 0 0 0 0 0 - 0 0 0 1 0 0 0 0 - 0 0 0 0 1 0 0 0 - 0 0 0 0 0 1 0 0 - 0 0 0 0 0 0 1e-9 0 - 0 0 0 0 0 0 0 1e-7];%new_data.rx_pvt_var(i); %careful, values for V and T could not be adecuate. +kf_Q = [ 100 0 0 0 0 0 0 0 + 0 100 0 0 0 0 0 0 + 0 0 100 0 0 0 0 0 + 0 0 0 10 0 0 0 0 + 0 0 0 0 10 0 0 0 + 0 0 0 0 0 10 0 0 + 0 0 0 0 0 0 500 0 + 0 0 0 0 0 0 0 1500];%careful, values for V and T could not be adecuate. %% % % Measurement error Covariance Matrix R assembling @@ -57,17 +57,24 @@ kf_R=[ 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 30]; - d = zeros(sat_number, 1); - rho_pri = zeros(sat_number, 1); - rhoDot_pri = zeros(sat_number, 1); - a_x = zeros(sat_number, 1); - a_y = zeros(sat_number, 1); - a_z = zeros(sat_number, 1); - c_pr_m=zeros(sat_number,length(navSolution.RX_time)); +% pre-allocate for speed +d = zeros(sat_number, 1); +rho_pri = zeros(sat_number, 1); +rhoDot_pri = zeros(sat_number, 1); +a_x = zeros(sat_number, 1); +a_y = zeros(sat_number, 1); +a_z = zeros(sat_number, 1); +c_pr_m=zeros(sat_number,length(navSolution.RX_time)); + +pr_m_filt=zeros(sat_number,length(navSolution.RX_time)); +rhoDot_pri_filt=zeros(sat_number,length(navSolution.RX_time)); +sat_dopp_hz_filt=zeros(sat_number,length(navSolution.RX_time)); + %% ################## Kalman Tracking ###################################### % receiver solution from rtklib_solver -for t=1:length(navSolution.RX_time) - +for t=2:length(navSolution.RX_time) + + clear x_u y_u z_u xDot_u yDot_u zDot_u cdeltatDot_u cdeltatDot_u_g cdeltat_u_g if (t