mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-11-15 06:14:58 +00:00
MOD: matlab trk_cmd files updated
This commit is contained in:
parent
4d5a92b5ad
commit
f466687b23
@ -23,6 +23,7 @@ clearvars
|
|||||||
% end
|
% end
|
||||||
SPEED_OF_LIGHT_M_S=299792458.0;
|
SPEED_OF_LIGHT_M_S=299792458.0;
|
||||||
Lambda_GPS_L1=0.1902937;
|
Lambda_GPS_L1=0.1902937;
|
||||||
|
GPS_L1_freq_hz=1575.42e6;
|
||||||
%%
|
%%
|
||||||
samplingFreq=5000000;
|
samplingFreq=5000000;
|
||||||
channels=6;
|
channels=6;
|
||||||
@ -34,12 +35,13 @@ plot_reference=1;
|
|||||||
load_observables=1;
|
load_observables=1;
|
||||||
advance_vtl_data_available=1;
|
advance_vtl_data_available=1;
|
||||||
load_vtl=1;
|
load_vtl=1;
|
||||||
|
load_tfk_cmd=1;
|
||||||
|
|
||||||
navSolution = GnssSDR2struct('PVT_raw.mat');
|
navSolution = GnssSDR2struct('PVT_raw.mat');
|
||||||
refSolution = SpirentMotion2struct('..\log_spirent\motion_V1_SPF_LD_05.csv');
|
refSolution = SpirentMotion2struct('..\log_spirent\motion_V1_SPF_LD_05.csv');
|
||||||
%%
|
%%
|
||||||
if(load_observables)
|
if(load_observables)
|
||||||
load observables\observable_raw.mat
|
load observables\observables_raw.mat
|
||||||
refSatData = SpirentSatData2struct('..\log_spirent\sat_data_V1A1_SPF_LD_05.csv');
|
refSatData = SpirentSatData2struct('..\log_spirent\sat_data_V1A1_SPF_LD_05.csv');
|
||||||
rx_PRN=[28 4 17 15 27 9]; % for SPF_LD_05.
|
rx_PRN=[28 4 17 15 27 9]; % for SPF_LD_05.
|
||||||
end
|
end
|
||||||
@ -53,6 +55,25 @@ if(load_vtl)
|
|||||||
vtlSolution = Vtl2struct('dump_vtl_file.csv');
|
vtlSolution = Vtl2struct('dump_vtl_file.csv');
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if(load_tfk_cmd)
|
||||||
|
trkSolution=trk2struct('dump_trk_file.csv');
|
||||||
|
|
||||||
|
%% split by solution type
|
||||||
|
figure;sgtitle('real doppler')
|
||||||
|
for chan=0:4
|
||||||
|
eval(['[indCH' num2str(chan) ',~]= find(trkSolution.dopp.real==chan);'])
|
||||||
|
eval(['Dopp_real_CH' num2str(chan) '=trkSolution.dopp.real(indCH' num2str(chan) ',2);'])
|
||||||
|
eval(['subplot(2,3,' num2str(chan+1) ');plot(Dopp_real_CH' num2str(chan) ')'])
|
||||||
|
end
|
||||||
|
figure;sgtitle('cmd doppler')
|
||||||
|
for chan=0:4
|
||||||
|
eval(['[indCH' num2str(chan) ',~]= find(trkSolution.dopp.cmd==chan);'])
|
||||||
|
eval(['Dopp_cmd_CH' num2str(chan) '=trkSolution.dopp.cmd(indCH' num2str(chan) ',2);'])
|
||||||
|
eval(['subplot(2,3,' num2str(chan+1) ');plot(Dopp_cmd_CH' num2str(chan) ')'])
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
%% calculate LOS Rx-sat if advance_vtl_data_available=1
|
%% calculate LOS Rx-sat if advance_vtl_data_available=1
|
||||||
|
|
||||||
if(advance_vtl_data_available)
|
if(advance_vtl_data_available)
|
||||||
|
56
src/utils/matlab/vtl/trk2struct.m
Normal file
56
src/utils/matlab/vtl/trk2struct.m
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
%% Import data from text file
|
||||||
|
% Script for importing data from the following text file:
|
||||||
|
%
|
||||||
|
% filename: D:\virtualBOX_VM\ubuntu20\ubuntu20\shareFolder\myWork\results\spirent_usrp_airing\dump_vtl_file.csv
|
||||||
|
%
|
||||||
|
% %
|
||||||
|
% -------------------------------------------------------------------------
|
||||||
|
% USE EXAMPLE: vtlSolution = Vtl2struct('dump_vtl_file.csv')
|
||||||
|
% -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% Auto-generated by MATLAB on 24-Nov-2022 17:34:27
|
||||||
|
function [trkSolution] = trk2struct(path_to_trk_csv)
|
||||||
|
%% Set up the Import Options and import the data
|
||||||
|
opts = delimitedTextImportOptions("NumVariables", 4);
|
||||||
|
|
||||||
|
% Specify range and delimiter
|
||||||
|
opts.DataLines = [1, Inf];
|
||||||
|
opts.Delimiter = ",";
|
||||||
|
|
||||||
|
% Specify column names and types
|
||||||
|
opts.VariableNames = ["doppler_corr", "VarName2", "VarName3", "VarName4"];
|
||||||
|
opts.VariableTypes = ["char", "double", "double", "double"];
|
||||||
|
|
||||||
|
% Specify file level properties
|
||||||
|
opts.ExtraColumnsRule = "ignore";
|
||||||
|
opts.EmptyLineRule = "read";
|
||||||
|
|
||||||
|
% Specify variable properties
|
||||||
|
opts = setvaropts(opts, "doppler_corr", "WhitespaceRule", "preserve");
|
||||||
|
opts = setvaropts(opts, "doppler_corr", "EmptyFieldRule", "auto");
|
||||||
|
|
||||||
|
% Import the data
|
||||||
|
dumptrackingfile = readtable(path_to_trk_csv, opts);
|
||||||
|
|
||||||
|
%% Convert to output type
|
||||||
|
dumptrackingfile = table2cell(dumptrackingfile);
|
||||||
|
numIdx = cellfun(@(x) ~isnan(str2double(x)), dumptrackingfile);
|
||||||
|
dumptrackingfile(numIdx) = cellfun(@(x) {str2double(x)}, dumptrackingfile(numIdx));
|
||||||
|
|
||||||
|
%% Clear temporary variables
|
||||||
|
clear numIdx opts
|
||||||
|
|
||||||
|
trkSolution.dopp=[];
|
||||||
|
|
||||||
|
%% split by solution type
|
||||||
|
[indDopp,~]= find(strcmp(dumptrackingfile, 'doppler_corr'));
|
||||||
|
|
||||||
|
trk_dopp=dumptrackingfile(indDopp,:);trk_dopp(:,1)=[];
|
||||||
|
|
||||||
|
trk_dopp=cell2mat(trk_dopp);
|
||||||
|
|
||||||
|
for i=1:length(trk_dopp)
|
||||||
|
trkSolution.dopp.real=[trk_dopp(:,1) trk_dopp(:,3)];
|
||||||
|
trkSolution.dopp.cmd=[trk_dopp(:,1) trk_dopp(:,2)];
|
||||||
|
end
|
||||||
|
end
|
@ -23,15 +23,16 @@ clearvars
|
|||||||
% end
|
% end
|
||||||
SPEED_OF_LIGHT_M_S=299792458.0;
|
SPEED_OF_LIGHT_M_S=299792458.0;
|
||||||
Lambda_GPS_L1=0.1902937;
|
Lambda_GPS_L1=0.1902937;
|
||||||
point_of_closure=6000;
|
GPS_L1_freq_hz=1575.42e6;
|
||||||
|
point_of_closure=3400;
|
||||||
|
|
||||||
%% ==================== VARIANCES =============================
|
%% ==================== VARIANCES =============================
|
||||||
pos_var=100;%m^2
|
pos_var=100;%m^2
|
||||||
vel_var=10;%m^2/s^2
|
vel_var=10;%m^2/s^2
|
||||||
clk_bias_var=40;%m^2
|
clk_bias_var=40;%m^2
|
||||||
clk_drift_var=1500;%m^2/s^2
|
clk_drift_var=1500;%m^2/s^2
|
||||||
pr_var=10;%m^2
|
pr_var=20;%m^2
|
||||||
pr_dot_var=30;%m^2/s^2
|
pr_dot_var=2;%m^2/s^2
|
||||||
|
|
||||||
% CARLES PAPER LTE GNSS VTL
|
% CARLES PAPER LTE GNSS VTL
|
||||||
% pos_var=2;%m^2
|
% pos_var=2;%m^2
|
||||||
@ -55,14 +56,14 @@ load_observables=1;
|
|||||||
navSolution = GnssSDR2struct('PVT_raw.mat');
|
navSolution = GnssSDR2struct('PVT_raw.mat');
|
||||||
refSolution = SpirentMotion2struct('..\log_spirent\motion_V1_SPF_LD_05.csv');
|
refSolution = SpirentMotion2struct('..\log_spirent\motion_V1_SPF_LD_05.csv');
|
||||||
%
|
%
|
||||||
load observables\observable_raw.mat
|
load observables\observables_raw.mat
|
||||||
% refSatData = SpirentSatData2struct('..\log_spirent\sat_data_V1A1_SPF_LD_05.csv');
|
% refSatData = SpirentSatData2struct('..\log_spirent\sat_data_V1A1_SPF_LD_05.csv');
|
||||||
rx_PRN=[28 4 17 15 27 9]; % for SPF_LD_05.
|
rx_PRN=[28 4 17 15 27 9]; % for SPF_LD_05.
|
||||||
load('PVT_raw.mat','sat_posX_m','sat_posY_m','sat_posZ_m','sat_velX','sat_velY'...
|
load('PVT_raw.mat','sat_posX_m','sat_posY_m','sat_posZ_m','sat_velX','sat_velY'...
|
||||||
,'sat_velZ','sat_prg_m','clk_bias_s','clk_drift','sat_dopp_hz','user_clk_offset')
|
,'sat_velZ','sat_prg_m','clk_bias_s','clk_drift','sat_dopp_hz','user_clk_offset')
|
||||||
|
|
||||||
if(load_observables)
|
if(load_observables)
|
||||||
load observables\observable_raw.mat
|
load observables\observables_raw.mat
|
||||||
refSatData = SpirentSatData2struct('..\log_spirent\sat_data_V1A1_SPF_LD_05.csv');
|
refSatData = SpirentSatData2struct('..\log_spirent\sat_data_V1A1_SPF_LD_05.csv');
|
||||||
end
|
end
|
||||||
%%
|
%%
|
||||||
|
@ -23,42 +23,58 @@ clearvars
|
|||||||
SPEED_OF_LIGHT_M_S=299792458.0;
|
SPEED_OF_LIGHT_M_S=299792458.0;
|
||||||
Lambda_GPS_L1=0.1902937;
|
Lambda_GPS_L1=0.1902937;
|
||||||
%%
|
%%
|
||||||
|
trkSolution=trk2struct('dump_trk_file.csv');
|
||||||
|
|
||||||
|
%% split by solution type
|
||||||
|
figure;sgtitle('real doppler')
|
||||||
for chan=0:4
|
for chan=0:4
|
||||||
load(['tracking\tracking_raw' num2str(chan) '.mat']);
|
eval(['[indCH' num2str(chan) ',~]= find(trkSolution.dopp.real==chan);'])
|
||||||
tracking_channel(chan+1).PRN=PRN;
|
eval(['Dopp_real_CH' num2str(chan) '=trkSolution.dopp.real(indCH' num2str(chan) ',2);'])
|
||||||
tracking_channel(chan+1).CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
|
eval(['subplot(2,3,' num2str(chan+1) ');plot(Dopp_real_CH' num2str(chan) ')'])
|
||||||
tracking_channel(chan+1).carrier_doppler_hz=carrier_doppler_hz;
|
|
||||||
tracking_channel(chan+1).carrier_doppler_rate_hz=carrier_doppler_rate_hz;
|
|
||||||
tracking_channel(chan+1).code_error_chips=code_error_chips;
|
|
||||||
tracking_channel(chan+1).code_freq_chips=code_freq_chips;
|
|
||||||
tracking_channel(chan+1).code_freq_rate_chips=code_freq_rate_chips;
|
|
||||||
tracking_channel(chan+1).acc_carrier_phase_rad=acc_carrier_phase_rad;
|
|
||||||
|
|
||||||
clearvars -except tracking_channel chan
|
|
||||||
end
|
end
|
||||||
%%
|
figure;sgtitle('cmd doppler')
|
||||||
figure
|
for chan=0:4
|
||||||
for chan=1:5
|
eval(['[indCH' num2str(chan) ',~]= find(trkSolution.dopp.cmd==chan);'])
|
||||||
subplot(2,3,chan);
|
eval(['Dopp_cmd_CH' num2str(chan) '=trkSolution.dopp.cmd(indCH' num2str(chan) ',2);'])
|
||||||
plot(tracking_channel(chan).carrier_doppler_hz);
|
eval(['subplot(2,3,' num2str(chan+1) ');plot(Dopp_cmd_CH' num2str(chan) ')'])
|
||||||
grid minor
|
|
||||||
end
|
end
|
||||||
sgtitle('carrier doppler hz channel')
|
|
||||||
%%
|
|
||||||
figure
|
|
||||||
for chan=1:5
|
|
||||||
subplot(2,3,chan);
|
|
||||||
plot(tracking_channel(chan).CN0_SNV_dB_Hz);
|
|
||||||
grid minor
|
|
||||||
end
|
|
||||||
sgtitle('CN0 SNV dB Hz channel')
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
figure
|
% for chan=0:4
|
||||||
for chan=1:5
|
% load(['tracking\tracking_raw' num2str(chan) '.mat']);
|
||||||
subplot(2,3,chan);
|
% tracking_channel(chan+1).PRN=PRN;
|
||||||
plot(tracking_channel(chan).acc_carrier_phase_rad);
|
% tracking_channel(chan+1).CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
|
||||||
grid minor
|
% tracking_channel(chan+1).carrier_doppler_hz=carrier_doppler_hz;
|
||||||
end
|
% tracking_channel(chan+1).carrier_doppler_rate_hz=carrier_doppler_rate_hz;
|
||||||
sgtitle('acc carrier phase rad')
|
% tracking_channel(chan+1).code_error_chips=code_error_chips;
|
||||||
|
% tracking_channel(chan+1).code_freq_chips=code_freq_chips;
|
||||||
|
% tracking_channel(chan+1).code_freq_rate_chips=code_freq_rate_chips;
|
||||||
|
% tracking_channel(chan+1).acc_carrier_phase_rad=acc_carrier_phase_rad;
|
||||||
|
%
|
||||||
|
% clearvars -except tracking_channel chan
|
||||||
|
% end
|
||||||
|
% %%
|
||||||
|
% figure
|
||||||
|
% for chan=1:5
|
||||||
|
% subplot(2,3,chan);
|
||||||
|
% plot(tracking_channel(chan).carrier_doppler_hz);
|
||||||
|
% grid minor
|
||||||
|
% end
|
||||||
|
% sgtitle('carrier doppler hz channel')
|
||||||
|
% %%
|
||||||
|
% figure
|
||||||
|
% for chan=1:5
|
||||||
|
% subplot(2,3,chan);
|
||||||
|
% plot(tracking_channel(chan).CN0_SNV_dB_Hz);
|
||||||
|
% grid minor
|
||||||
|
% end
|
||||||
|
% sgtitle('CN0 SNV dB Hz channel')
|
||||||
|
%
|
||||||
|
% %%
|
||||||
|
% figure
|
||||||
|
% for chan=1:5
|
||||||
|
% subplot(2,3,chan);
|
||||||
|
% plot(tracking_channel(chan).acc_carrier_phase_rad);
|
||||||
|
% grid minor
|
||||||
|
% end
|
||||||
|
% sgtitle('acc carrier phase rad')
|
Loading…
Reference in New Issue
Block a user