1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-06 01:56:25 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2018-03-30 11:44:31 +02:00
commit 4cd3721a10
65 changed files with 1990 additions and 5640 deletions

View File

@ -1,41 +0,0 @@
#set terminal pdf color font "Bold,14"
#set output "IFEN_accuracy.pdf"
set terminal jpeg font "Helvetica, 14"
set output "4_GPS_3_GAL_accuracy_precision.jpeg"
set grid
set xrange [-10:10]
set yrange [-5:15]
set ylabel "North [m]"
set xlabel "East [m]"
set key Left left
set title "IFEN simulated data, 4 GPS, 8 Gal - Accuracy and Precision"
#file1="8_GPS_GNSS_SDR_solutions.txt"
#file2="8_GAL_GNSS_SDR_solutions.txt"
file3="4_GPS_3_GAL_GNSS_SDR_solutions.txt"
#values to copy from statistic file
DRMS= 3.077806456
DUE_DRMS= 6.155612912
CEP= 2.565164055
#difference with respect to the reference position
#values to copy from statistic file
delta_E= -1.812 # combined
delta_N= 3.596 # combined
set parametric
#dummy variable is t for curves, u/v for surfaces
set size square
set angle degree
set trange [0:360]
#radius_6_GPS=6
plot file3 u 9:10 with points pointsize 0.3 lc rgb "green" notitle,\
DRMS*sin(t)+delta_E,DRMS*cos(t)+delta_N lw 3 lc rgb "black" title "DRMS",\
DUE_DRMS*sin(t)+delta_E,DUE_DRMS*cos(t)+delta_N lw 2 lc rgb "gray" title "2DRMS",\
CEP*sin(t)+delta_E,CEP*cos(t)+delta_N lw 1 lc rgb "black" title "CEP"

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
#set terminal pdf color font "Bold,14"
#set output "IFEN_accuracy.pdf"
set terminal jpeg font "Helvetica, 14"
set output "8_GPS_accuracy_precision.jpeg"
set grid
set xrange [-8:8]
set yrange [-8:8]
set ylabel "North [m]"
set xlabel "East [m]"
set key Left left
set title "IFEN simulated data, 8 GPS - Accuracy and Precision"
file1="8_GPS_GNSS_SDR_solutions.txt"
#file2="8_GAL_GNSS_SDR_solutions.txt"
#file3="8_GPS_GNSS_SDR_solutions.txt"
#values to copy from statistic file
DRMS= 2.034509899
DUE_DRMS= 4.069019799
CEP= 1.678044871
#difference with respect to the reference position
#values to copy from statistic file
delta_E=-0.560 #gps
delta_N=1.323 #gps
set parametric
#dummy variable is t for curves, u/v for surfaces
set size square
set angle degree
set trange [0:360]
#radius_6_GPS=6
plot file1 u 9:10 with points pointsize 0.3 lc rgb "red" notitle,\
DRMS*sin(t)+delta_E,DRMS*cos(t)+delta_N lw 3 lc rgb "black" title "DRMS",\
DUE_DRMS*sin(t)+delta_E,DUE_DRMS*cos(t)+delta_N lw 2 lc rgb "gray" title "2DRMS",\
CEP*sin(t)+delta_E,CEP*cos(t)+delta_N lw 1 lc rgb "black" title "CEP"

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,40 +0,0 @@
#set terminal pdf color font "Bold,14"
#set output "IFEN_accuracy.pdf"
set terminal jpeg font "Helvetica, 14"
set output "8_GALILEO_accuracy_precision.jpeg"
set grid
set xrange [-8:8]
set yrange [-8:8]
set ylabel "North [m]"
set xlabel "East [m]"
set key Left left
set title "IFEN simulated data, 8 Galileo - Accuracy and Precision"
#file1="8_GPS_GNSS_SDR_solutions.txt"
file2="8_GAL_GNSS_SDR_solutions.txt"
#file3="8_GPS_GNSS_SDR_solutions.txt"
#values to copy from statistic file
DRMS= 1.870121081
DUE_DRMS= 3.740242162
CEP= 1.556390643
#difference with respect to the reference position
#values to copy from statistic file
delta_E=1.191 #galileo
delta_N=1.923 #galileo
set parametric
#dummy variable is t for curves, u/v for surfaces
set size square
set angle degree
set trange [0:360]
#radius_6_GPS=6
plot file2 u 9:10 with points pointsize 0.3 lc rgb "blue" notitle,\
DRMS*sin(t)+delta_E,DRMS*cos(t)+delta_N lw 3 lc rgb "black" title "DRMS",\
DUE_DRMS*sin(t)+delta_E,DUE_DRMS*cos(t)+delta_N lw 2 lc rgb "gray" title "2DRMS",\
CEP*sin(t)+delta_E,CEP*cos(t)+delta_N lw 1 lc rgb "black" title "CEP"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File

@ -1,50 +0,0 @@
#to load the file digit from terminal:
#> gnuplot 8_sat_IFEN_accuracy_precision.plt
#set terminal pdf color font "Bold,14"
#set output "IFEN_solutions_pdf"
set terminal jpeg font "Helvetica, 14"
set output "8_sat_accuracy_precision.jpeg"
set grid
set xrange [-15:15]
set yrange [-10:20]
set ylabel "North [m]"
set xlabel "East [m]"
set key Left left
set title "Accuracy-Precision (with respect to CORRECT coordinates)- 2DRMS"
file1="4_GPS_3_GAL_GNSS_SDR_solutions.txt"
file2="8_GAL_GNSS_SDR_solutions.txt"
file3="8_GPS_GNSS_SDR_solutions.txt"
#values to copy from statistic file
DRMS_1=2*3.077 #it is 2*DRMS combined
DRMS_2=2*1.87 # gal
DRMS_3=2*2.034 # gps
#difference with respect to the reference position
#values to copy from statistic file
delta_E_1=-1.812 #combined
delta_N_1= 3.596 #combined
delta_E_2= 1.191 #gal
delta_N_2= 1.923 #gal
delta_E_3= -0.560 #gps
delta_N_3= 1.323 #gps
set parametric
#dummy variable is t for curves, u/v for surfaces
set size square
set angle degree
set trange [0:360]
plot file1 u 9:10 with points pointsize 0.3 lc rgb "green" title "4 GPS-3 GAL",\
file3 u 9:10 with points pointsize 0.3 lc rgb "red" title "8 GPS",\
file2 u 9:10 with points pointsize 0.3 lc rgb "blue" title "8 GAL",\
DRMS_1*sin(t)+delta_E_1,DRMS_1*cos(t)+delta_N_1 lw 2 lc rgb "green" notitle,\
DRMS_3*sin(t)+delta_E_3,DRMS_3*cos(t)+delta_N_3 lw 2 lc rgb "red" notitle,\
DRMS_2*sin(t)+delta_E_2,DRMS_2*cos(t)+delta_N_2 lw 2 lc rgb "blue" notitle

View File

@ -1,23 +0,0 @@
Num of GPS observation 4
Num of GALILEO observation 3
GDOP mean= 2.380532594
ENU computed at (IFEN true coordinates): ref Longitude = 11.808005630, Ref Latitude = 48.171497670 for Accuracy
ENU computed at (average coordinates) mean Longitude = 11.807981252, mean Latitude = 48.171530020 for Precision
ACCURACY (respect true position)
East offset [m] = -1.812959237, East st. dev = 1.899085141
Nord offset [m] = 3.596061973,Noth st. dev = 2.422058671
Up offset [m] = 8.995532878, Up st. dev = 3.881428324
DRMS= 3.077806456
DUE_DRMS= 6.155612912
CEP= 2.565164055
MRSE= 4.953622757
SEP= 12.514572993
PRECISION (respect average solution)
East offset [m] = 0.000000000, East st. dev = 1.899086239
Nord offset [m] = -0.000000001, ,Noth st. dev = 2.422059160
Up offset [m]= -0.000000003, Up st. dev = 3.881427482
----------------------------------------------------------------------------------------------

View File

@ -1,23 +0,0 @@
Num of GPS observation 0
Num of GALILEO observation 8
GDOP mean= 1.769225604
ENU computed at (IFEN true coordinates): ref Longitude = 11.808005630, Ref Latitude = 48.171497670 for Accuracy
ENU computed at (average coordinates) mean Longitude = 11.808021645, mean Latitude = 48.171514975 for Precision
ACCURACY (respect true position)
East offset [m] = 1.191616778, East st. dev = 1.370472661
Nord offset [m] = 1.923075914,Noth st. dev = 1.272461214
Up offset [m] = 13.774563698, Up st. dev = 3.492269580
DRMS= 1.870121081
DUE_DRMS= 3.740242162
CEP= 1.556390643
MRSE= 3.961476957
SEP= 8.003582836
PRECISION (respect average solution)
East offset [m] = -0.000000002, East st. dev = 1.370472897
Nord offset [m] = -0.000000001, ,Noth st. dev = 1.272461012
Up offset [m]= 0.000000002, Up st. dev = 3.492269562
----------------------------------------------------------------------------------------------

View File

@ -1,23 +0,0 @@
Num of GPS observation 8
Num of GALILEO observation 0
GDOP mean= 2.002216944
ENU computed at (IFEN true coordinates): ref Longitude = 11.808005630, Ref Latitude = 48.171497670 for Accuracy
ENU computed at (average coordinates) mean Longitude = 11.807998091, mean Latitude = 48.171509585 for Precision
ACCURACY (respect true position)
East offset [m] = -0.560396234, East st. dev = 1.105718017
Nord offset [m] = 1.323685667,Noth st. dev = 1.707810937
Up offset [m] = 10.792857384, Up st. dev = 3.121160956
DRMS= 2.034509899
DUE_DRMS= 4.069019799
CEP= 1.678044871
MRSE= 3.725704798
SEP= 7.079246885
PRECISION (respect average solution)
East offset [m] = 0.000000000, East st. dev = 1.105718027
Nord offset [m] = -0.000000005, ,Noth st. dev = 1.707811217
Up offset [m]= -0.000000005, Up st. dev = 3.121160800
----------------------------------------------------------------------------------------------

View File

@ -1,37 +1,36 @@
% /*! % Reads GNSS-SDR Tracking dump binary file using the provided
% * \file dll_pll_vml_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR Tracking dump binary file using the provided % Javier Arribas, 2011. jarribas(at)cttc.es
% function and plot some internal variables % Antonio Ramos, 2018. antonio.ramos(at)cttc.es
% * \author Javier Arribas, 2011. jarribas(at)cttc.es % -------------------------------------------------------------------------
% * \author Antonio Ramos, 2018. antonio.ramos(at)cttc.es %
% * ------------------------------------------------------------------------- % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) % GNSS-SDR is a software defined Global Navigation
% * % Satellite Systems receiver
% * GNSS-SDR is a software defined Global Navigation %
% * Satellite Systems receiver % This file is part of GNSS-SDR.
% * %
% * This file is part of GNSS-SDR. % GNSS-SDR is free software: you can redistribute it and/or modify
% * % it under the terms of the GNU General Public License as published by
% * GNSS-SDR is free software: you can redistribute it and/or modify % the Free Software Foundation, either version 3 of the License, or
% * it under the terms of the GNU General Public License as published by % at your option) any later version.
% * the Free Software Foundation, either version 3 of the License, or %
% * at your option) any later version. % GNSS-SDR is distributed in the hope that it will be useful,
% * % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * GNSS-SDR is distributed in the hope that it will be useful, % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % GNU General Public License for more details.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % You should have received a copy of the GNU General Public License
% * % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * You should have received a copy of the GNU General Public License %
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % -------------------------------------------------------------------------
% * %
% * -------------------------------------------------------------------------
% */
close all; close all;
clear all; clear all;
if ~exist('dll_pll_veml_read_tracking_dump.m','file') if ~exist('dll_pll_veml_read_tracking_dump.m', 'file')
addpath('./libs') addpath('./libs')
end end
@ -43,8 +42,8 @@ first_channel = 0; % Number of the first channel
path = '/dump_dir/'; %% CHANGE THIS PATH path = '/dump_dir/'; %% CHANGE THIS PATH
for N=1:1:channels for N=1:1:channels
tracking_log_path = [path 'track_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch BY YOUR dump_filename tracking_log_path = [path 'track_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch_ BY YOUR dump_filename
GNSS_tracking(N)= dll_pll_veml_read_tracking_dump(tracking_log_path); GNSS_tracking(N) = dll_pll_veml_read_tracking_dump(tracking_log_path);
end end
% GNSS-SDR format conversion to MATLAB GPS receiver % GNSS-SDR format conversion to MATLAB GPS receiver
@ -76,8 +75,8 @@ for N=1:1:channels
% Use original MATLAB tracking plot function % Use original MATLAB tracking plot function
settings.numberOfChannels = channels; settings.numberOfChannels = channels;
settings.msToProcess = length(GNSS_tracking(N).E)*coherent_integration_time_ms; settings.msToProcess = length(GNSS_tracking(N).E) * coherent_integration_time_ms;
plotVEMLTracking(N,trackResults,settings) plotVEMLTracking(N, trackResults, settings)
end end

View File

@ -1,36 +1,35 @@
% /*! % Reads GNSS-SDR Tracking dump binary file using the provided
% * \file galileo_l1_ca_dll_pll_vml_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR Tracking dump binary file using the provided % Javier Arribas, 2011. jarribas(at)cttc.es
% function and plot some internal variables % -------------------------------------------------------------------------
% * \author Javier Arribas, 2011. jarribas(at)cttc.es %
% * ------------------------------------------------------------------------- % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % GNSS-SDR is a software defined Global Navigation
% * % Satellite Systems receiver
% * GNSS-SDR is a software defined Global Navigation %
% * Satellite Systems receiver % This file is part of GNSS-SDR.
% * %
% * This file is part of GNSS-SDR. % GNSS-SDR is free software: you can redistribute it and/or modify
% * % it under the terms of the GNU General Public License as published by
% * GNSS-SDR is free software: you can redistribute it and/or modify % the Free Software Foundation, either version 3 of the License, or
% * it under the terms of the GNU General Public License as published by % at your option) any later version.
% * the Free Software Foundation, either version 3 of the License, or %
% * at your option) any later version. % GNSS-SDR is distributed in the hope that it will be useful,
% * % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * GNSS-SDR is distributed in the hope that it will be useful, % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % GNU General Public License for more details.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % You should have received a copy of the GNU General Public License
% * % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * You should have received a copy of the GNU General Public License %
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % -------------------------------------------------------------------------
% * %
% * -------------------------------------------------------------------------
% */
close all; close all;
clear all; clear all;
if ~exist('galileo_e1_dll_pll_veml_read_tracking_dump.m','file') if ~exist('dll_pll_veml_read_tracking_dump.m', 'file')
addpath('./libs') addpath('./libs')
end end
@ -42,7 +41,7 @@ path = '/Users/carlesfernandez/git/cttc/build/'; %% CHANGE THIS PATH
for N=1:1:channels for N=1:1:channels
tracking_log_path = [path 'track_ch' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch BY YOUR dump_filename tracking_log_path = [path 'track_ch' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch BY YOUR dump_filename
GNSS_tracking(N)= galileo_e1_dll_pll_veml_read_tracking_dump(tracking_log_path); GNSS_tracking(N) = dll_pll_veml_read_tracking_dump(tracking_log_path);
end end
% GNSS-SDR format conversion to MATLAB GPS receiver % GNSS-SDR format conversion to MATLAB GPS receiver
@ -73,7 +72,7 @@ for N=1:1:channels
% Use original MATLAB tracking plot function % Use original MATLAB tracking plot function
settings.numberOfChannels = channels; settings.numberOfChannels = channels;
settings.msToProcess = length(GNSS_tracking(N).E)*4; settings.msToProcess = length(GNSS_tracking(N).E)*4;
plotVEMLTracking(N,trackResults,settings) plotVEMLTracking(N, trackResults, settings)
end end

View File

@ -1,33 +1,31 @@
% /*! % Reads GNSS-SDR Tracking dump binary file using the provided
% * \file galileo_e5a_dll_pll_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR Tracking dump binary file using the provided % Javier Arribas, Marc Sales 2014. jarribas(at)cttc.es, marcsales92@gmail.com
% function and plot some internal variables % -------------------------------------------------------------------------
% * \author Javier Arribas, Marc Sales 2014. jarribas(at)cttc.es %
% marcsales92@gmail.com % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * ------------------------------------------------------------------------- %
% * % GNSS-SDR is a software defined Global Navigation
% * Copyright (C) 2010-2014 (see AUTHORS file for a list of contributors) % Satellite Systems receiver
% * %
% * GNSS-SDR is a software defined Global Navigation % This file is part of GNSS-SDR.
% * Satellite Systems receiver %
% * % GNSS-SDR is free software: you can redistribute it and/or modify
% * This file is part of GNSS-SDR. % it under the terms of the GNU General Public License as published by
% * % the Free Software Foundation, either version 3 of the License, or
% * GNSS-SDR is free software: you can redistribute it and/or modify % at your option) any later version.
% * it under the terms of the GNU General Public License as published by %
% * the Free Software Foundation, either version 3 of the License, or % GNSS-SDR is distributed in the hope that it will be useful,
% * at your option) any later version. % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNSS-SDR is distributed in the hope that it will be useful, % GNU General Public License for more details.
% * but WITHOUT ANY WARRANTY; without even the implied warranty of %
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % You should have received a copy of the GNU General Public License
% * GNU General Public License for more details. % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * %
% * You should have received a copy of the GNU General Public License % -------------------------------------------------------------------------
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. %
% *
% * -------------------------------------------------------------------------
% */
close all; close all;
clear all; clear all;
@ -44,7 +42,7 @@ path = '/Users/carlesfernandez/git/cttc/build/'; %% CHANGE THIS PATH
for N=1:1:channels for N=1:1:channels
tracking_log_path = [path 'tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE tracking_ch_ BY YOUR dump_filename tracking_log_path = [path 'tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE tracking_ch_ BY YOUR dump_filename
GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path); GNSS_tracking(N) = gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path);
end end
% GNSS-SDR format conversion to MATLAB GPS receiver % GNSS-SDR format conversion to MATLAB GPS receiver
@ -72,26 +70,26 @@ for N=1:1:channels
% Use original MATLAB tracking plot function % Use original MATLAB tracking plot function
settings.numberOfChannels = channels; settings.numberOfChannels = channels;
settings.msToProcess = length(GNSS_tracking(N).E); settings.msToProcess = length(GNSS_tracking(N).E);
plotTrackingE5a(N,trackResults,settings) plotTrackingE5a(N, trackResults, settings)
end end
for N=1:1:channels for N=1:1:channels
% figure; % figure;
% plot([GNSS_tracking(N).E,GNSS_tracking(N).P,GNSS_tracking(N).L],'-*'); % plot([GNSS_tracking(N).E, GNSS_tracking(N).P, GNSS_tracking(N).L],'-*');
% title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']); % title(['Early, Prompt, and Late correlator absolute value output for channel ' num2str(N)']);
% figure; % figure;
% plot(GNSS_tracking(N).prompt_I,GNSS_tracking(N).prompt_Q,'+'); % plot(GNSS_tracking(N).prompt_I, GNSS_tracking(N).prompt_Q, '+');
% title(['Navigation constellation plot for channel ' num2str(N)]); % title(['Navigation constellation plot for channel ' num2str(N)]);
% figure; % figure;
% %
% plot(GNSS_tracking(N).prompt_Q,'r'); % plot(GNSS_tracking(N).prompt_Q,'r');
% hold on; % hold on;
% plot(GNSS_tracking(N).prompt_I); % plot(GNSS_tracking(N).prompt_I);
% title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]); % title(['Navigation symbols I(red) Q(blue) for channel ' num2str(N)]);
% %
figure; figure;
t=0:length(GNSS_tracking(N).carrier_doppler_hz)-1; t = 0:length(GNSS_tracking(N).carrier_doppler_hz)-1;
t=t/1000; t = t/1000;
plot(t,GNSS_tracking(N).carrier_doppler_hz/1000); plot(t, GNSS_tracking(N).carrier_doppler_hz / 1000);
xlabel('Time(s)');ylabel('Doppler(KHz)');title(['Doppler frequency channel ' num2str(N)]); xlabel('Time(s)'); ylabel('Doppler(KHz)'); title(['Doppler frequency channel ' num2str(N)]);
end end

View File

@ -1,36 +1,35 @@
% /*! % Reads GNSS-SDR Tracking dump binary file using the provided
% * \file glonass_ca_dll_pll_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR Tracking dump binary file using the provided % Damian Miralles, 2017. dmiralles2009(at)gmail.com
% function and plot some internal variables % -------------------------------------------------------------------------
% * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com %
% * ------------------------------------------------------------------------- % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % GNSS-SDR is a software defined Global Navigation
% * % Satellite Systems receiver
% * GNSS-SDR is a software defined Global Navigation %
% * Satellite Systems receiver % This file is part of GNSS-SDR.
% * %
% * This file is part of GNSS-SDR. % GNSS-SDR is free software: you can redistribute it and/or modify
% * % it under the terms of the GNU General Public License as published by
% * GNSS-SDR is free software: you can redistribute it and/or modify % the Free Software Foundation, either version 3 of the License, or
% * it under the terms of the GNU General Public License as published by % at your option) any later version.
% * the Free Software Foundation, either version 3 of the License, or %
% * at your option) any later version. % GNSS-SDR is distributed in the hope that it will be useful,
% * % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * GNSS-SDR is distributed in the hope that it will be useful, % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % GNU General Public License for more details.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % You should have received a copy of the GNU General Public License
% * % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * You should have received a copy of the GNU General Public License %
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % -------------------------------------------------------------------------
% * %
% * -------------------------------------------------------------------------
% */
close all; close all;
clear all; clear all;
if ~exist('glonass_ca_dll_pll_read_tracking_dump.m','file') if ~exist('dll_pll_veml_read_tracking_dump.m', 'file')
addpath('./libs') addpath('./libs')
end end
@ -42,8 +41,8 @@ first_channel = 0;
path = '/archive/'; %% CHANGE THIS PATH path = '/archive/'; %% CHANGE THIS PATH
for N=1:1:channels for N=1:1:channels
tracking_log_path = [path 'glo_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE epl_tracking_ch_ BY YOUR dump_filename tracking_log_path = [path 'glo_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE glo_tracking_ch_ BY YOUR dump_filename
GNSS_tracking(N)= glonass_ca_dll_pll_read_tracking_dump(tracking_log_path); GNSS_tracking(N) = dll_pll_veml_read_tracking_dump(tracking_log_path);
end end
% GNSS-SDR format conversion to MATLAB GPS receiver % GNSS-SDR format conversion to MATLAB GPS receiver
@ -70,5 +69,5 @@ for N=1:1:channels
% Use original MATLAB tracking plot function % Use original MATLAB tracking plot function
settings.numberOfChannels = channels; settings.numberOfChannels = channels;
settings.msToProcess = length(GNSS_tracking(N).E); settings.msToProcess = length(GNSS_tracking(N).E);
plotTracking(N,trackResults,settings); plotTracking(N, trackResults, settings)
end end

View File

@ -1,36 +1,35 @@
% /*! % Reads GNSS-SDR Tracking dump binary file using the provided
% * \file gps_l1_ca_dll_pll_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR Tracking dump binary file using the provided % Javier Arribas, 2011. jarribas(at)cttc.es
% function and plot some internal variables % -------------------------------------------------------------------------
% * \author Javier Arribas, 2011. jarribas(at)cttc.es %
% * ------------------------------------------------------------------------- % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % GNSS-SDR is a software defined Global Navigation
% * % Satellite Systems receiver
% * GNSS-SDR is a software defined Global Navigation %
% * Satellite Systems receiver % This file is part of GNSS-SDR.
% * %
% * This file is part of GNSS-SDR. % GNSS-SDR is free software: you can redistribute it and/or modify
% * % it under the terms of the GNU General Public License as published by
% * GNSS-SDR is free software: you can redistribute it and/or modify % the Free Software Foundation, either version 3 of the License, or
% * it under the terms of the GNU General Public License as published by % at your option) any later version.
% * the Free Software Foundation, either version 3 of the License, or %
% * at your option) any later version. % GNSS-SDR is distributed in the hope that it will be useful,
% * % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * GNSS-SDR is distributed in the hope that it will be useful, % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % GNU General Public License for more details.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % You should have received a copy of the GNU General Public License
% * % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * You should have received a copy of the GNU General Public License %
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % -------------------------------------------------------------------------
% * %
% * -------------------------------------------------------------------------
% */
close all; close all;
clear all; clear all;
if ~exist('gps_l1_ca_dll_pll_read_tracking_dump.m','file') if ~exist('dll_pll_veml_read_tracking_dump.m', 'file')
addpath('./libs') addpath('./libs')
end end
@ -42,8 +41,8 @@ first_channel = 0;
path = '/archive/'; %% CHANGE THIS PATH path = '/archive/'; %% CHANGE THIS PATH
for N=1:1:channels for N=1:1:channels
tracking_log_path = [path 'glo_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE epl_tracking_ch_ BY YOUR dump_filename tracking_log_path = [path 'epl_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE epl_tracking_ch_ BY YOUR dump_filename
GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path); GNSS_tracking(N) = dll_pll_veml_read_tracking_dump(tracking_log_path);
end end
% GNSS-SDR format conversion to MATLAB GPS receiver % GNSS-SDR format conversion to MATLAB GPS receiver
@ -70,7 +69,7 @@ for N=1:1:channels
% Use original MATLAB tracking plot function % Use original MATLAB tracking plot function
settings.numberOfChannels = channels; settings.numberOfChannels = channels;
settings.msToProcess = length(GNSS_tracking(N).E); settings.msToProcess = length(GNSS_tracking(N).E);
plotTracking(N,trackResults,settings) plotTracking(N, trackResults, settings)
end end

View File

@ -1,32 +1,30 @@
% /*! % Reads GNSS-SDR PVT dump binary file using the provided
% * \file gps_l1_ca_pvt_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR PVT dump binary file using the provided % Javier Arribas, 2011. jarribas(at)cttc.es
% function and plot some internal variables % -------------------------------------------------------------------------
% * \author Javier Arribas, 2011. jarribas(at)cttc.es %
% * ------------------------------------------------------------------------- % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % GNSS-SDR is a software defined Global Navigation
% * % Satellite Systems receiver
% * GNSS-SDR is a software defined Global Navigation %
% * Satellite Systems receiver % This file is part of GNSS-SDR.
% * %
% * This file is part of GNSS-SDR. % GNSS-SDR is free software: you can redistribute it and/or modify
% * % it under the terms of the GNU General Public License as published by
% * GNSS-SDR is free software: you can redistribute it and/or modify % the Free Software Foundation, either version 3 of the License, or
% * it under the terms of the GNU General Public License as published by % at your option) any later version.
% * the Free Software Foundation, either version 3 of the License, or %
% * at your option) any later version. % GNSS-SDR is distributed in the hope that it will be useful,
% * % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * GNSS-SDR is distributed in the hope that it will be useful, % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % GNU General Public License for more details.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % You should have received a copy of the GNU General Public License
% * % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * You should have received a copy of the GNU General Public License %
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % -------------------------------------------------------------------------
% * %
% * -------------------------------------------------------------------------
% */
close all; close all;
clear all; clear all;
@ -65,7 +63,7 @@ h=35;
%=== Convert to UTM coordinate system ============================= %=== Convert to UTM coordinate system =============================
utmZone = findUtmZone(lat_deg, long_deg); utmZone = findUtmZone(lat_deg, long_deg);
[settings.truePosition.E, ... [settings.truePosition.E, ...
settings.truePosition.N, ... settings.truePosition.N, ...
settings.truePosition.U] = cart2utm(X, Y, Z, utmZone); settings.truePosition.U] = cart2utm(X, Y, Z, utmZone);

View File

@ -1,4 +1,28 @@
% Read PVG raw dump % Read PVG raw dump
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
%clear all; %clear all;

View File

@ -1,32 +1,31 @@
% /*! % Reads GNSS-SDR Tracking dump binary file using the provided
% * \file gps_l1_ca_dll_fll_pll_plot_sample.m % function and plots some internal variables
% * \brief Read GNSS-SDR Tracking dump binary file using the provided % Javier Arribas, 2011. jarribas(at)cttc.es
% function and plot some internal variables % -------------------------------------------------------------------------
% * \author Javier Arribas, 2011. jarribas(at)cttc.es %
% * ------------------------------------------------------------------------- % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % GNSS-SDR is a software defined Global Navigation
% * % Satellite Systems receiver
% * GNSS-SDR is a software defined Global Navigation %
% * Satellite Systems receiver % This file is part of GNSS-SDR.
% * %
% * This file is part of GNSS-SDR. % GNSS-SDR is free software: you can redistribute it and/or modify
% * % it under the terms of the GNU General Public License as published by
% * GNSS-SDR is free software: you can redistribute it and/or modify % the Free Software Foundation, either version 3 of the License, or
% * it under the terms of the GNU General Public License as published by % at your option) any later version.
% * the Free Software Foundation, either version 3 of the License, or %
% * at your option) any later version. % GNSS-SDR is distributed in the hope that it will be useful,
% * % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * GNSS-SDR is distributed in the hope that it will be useful, % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % GNU General Public License for more details.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % You should have received a copy of the GNU General Public License
% * % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * You should have received a copy of the GNU General Public License %
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % -------------------------------------------------------------------------
% * %
% * -------------------------------------------------------------------------
% */
%close all; %close all;
%clear all; %clear all;
samplingFreq = 64e6/16; %[Hz] samplingFreq = 64e6/16; %[Hz]

View File

@ -1,3 +1,28 @@
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
%help script to compare GNSS-SDR Preambles starts %help script to compare GNSS-SDR Preambles starts
channel=3; channel=3;
% From GNSS_SDR telemetry decoder % From GNSS_SDR telemetry decoder

View File

@ -1,3 +1,28 @@
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
% compare pseudoranges % compare pseudoranges
close all; close all;

View File

@ -1,3 +1,28 @@
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
% Read observables dump % Read observables dump
%clear all; %clear all;

View File

@ -1,74 +1,72 @@
% /*! % Usage: dll_pll_veml_read_tracking_dump (filename, [count])
% * \file dll_pll_veml_read_tracking_dump.m %
% * \brief Read GNSS-SDR Tracking dump binary file into MATLAB. % Opens GNSS-SDR tracking binary log file .dat and returns the contents
% * \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
% * ------------------------------------------------------------------------- % Read GNSS-SDR Tracking dump binary file into MATLAB.
% * % Luis Esteve, 2012. luis(at)epsilon-formacion.com
% * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors) % -------------------------------------------------------------------------
% * %
% * GNSS-SDR is a software defined Global Navigation % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * Satellite Systems receiver %
% * % GNSS-SDR is a software defined Global Navigation
% * This file is part of GNSS-SDR. % Satellite Systems receiver
% * %
% * GNSS-SDR is free software: you can redistribute it and/or modify % This file is part of GNSS-SDR.
% * it under the terms of the GNU General Public License as published by %
% * the Free Software Foundation, either version 3 of the License, or % GNSS-SDR is free software: you can redistribute it and/or modify
% * at your option) any later version. % it under the terms of the GNU General Public License as published by
% * % the Free Software Foundation, either version 3 of the License, or
% * GNSS-SDR is distributed in the hope that it will be useful, % at your option) any later version.
% * but WITHOUT ANY WARRANTY; without even the implied warranty of %
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNSS-SDR is distributed in the hope that it will be useful,
% * GNU General Public License for more details. % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * You should have received a copy of the GNU General Public License % GNU General Public License for more details.
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. %
% * % You should have received a copy of the GNU General Public License
% * ------------------------------------------------------------------------- % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% */ %
% -------------------------------------------------------------------------
%
function [GNSS_tracking] = dll_pll_veml_read_tracking_dump (filename, count) function [GNSS_tracking] = dll_pll_veml_read_tracking_dump (filename, count)
%% usage: dll_pll_veml_read_tracking_dump (filename, [count])
%%
%% open GNSS-SDR tracking binary log file .dat and return the contents
%%
m = nargchk (1,2,nargin); m = nargchk (1,2,nargin);
num_float_vars = 17; num_float_vars = 17;
num_unsigned_long_int_vars = 1; num_unsigned_long_int_vars = 1;
num_double_vars = 1; num_double_vars = 1;
num_unsigned_int_vars = 1; num_unsigned_int_vars = 1;
if(~isempty(strfind(computer('arch'), '64'))) if(~isempty(strfind(computer('arch'), '64')))
% 64-bit computer % 64-bit computer
double_size_bytes = 8; double_size_bytes = 8;
unsigned_long_int_size_bytes = 8; unsigned_long_int_size_bytes = 8;
float_size_bytes = 4; float_size_bytes = 4;
unsigned_int_size_bytes = 4; unsigned_int_size_bytes = 4;
else else
double_size_bytes = 8; double_size_bytes = 8;
unsigned_long_int_size_bytes = 4; unsigned_long_int_size_bytes = 4;
float_size_bytes = 4; float_size_bytes = 4;
unsigned_int_size_bytes = 4; unsigned_int_size_bytes = 4;
end end
skip_bytes_each_read = float_size_bytes * num_float_vars + unsigned_long_int_size_bytes * num_unsigned_long_int_vars + ... skip_bytes_each_read = float_size_bytes * num_float_vars + unsigned_long_int_size_bytes * num_unsigned_long_int_vars + ...
double_size_bytes * num_double_vars + num_unsigned_int_vars*unsigned_int_size_bytes; double_size_bytes * num_double_vars + num_unsigned_int_vars*unsigned_int_size_bytes;
bytes_shift = 0; bytes_shift = 0;
if (m) if (m)
usage (m); usage (m);
end end
if (nargin < 2) if (nargin < 2)
count = Inf; count = Inf;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
v1 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v1 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes; bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float fseek(f,bytes_shift,'bof'); % move to next float
@ -149,5 +147,5 @@ function [GNSS_tracking] = dll_pll_veml_read_tracking_dump (filename, count)
GNSS_tracking.var1 = v18; GNSS_tracking.var1 = v18;
GNSS_tracking.var2 = v19; GNSS_tracking.var2 = v19;
GNSS_tracking.PRN = v20; GNSS_tracking.PRN = v20;
end end

View File

@ -1,153 +0,0 @@
% /*!
% * \file galileo_e1_dll_pll_veml_read_tracking_dump.m
% * \brief Read GNSS-SDR Tracking dump binary file into MATLAB.
% * \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function [GNSS_tracking] = galileo_e1_dll_pll_veml_read_tracking_dump (filename, count)
%% usage: galileo_e1_dll_pll_veml_read_tracking_dump (filename, [count])
%%
%% open GNSS-SDR tracking binary log file .dat and return the contents
%%
m = nargchk (1,2,nargin);
num_float_vars = 17;
num_unsigned_long_int_vars = 1;
num_double_vars = 1;
num_unsigned_int_vars = 1;
if(~isempty(strfind(computer('arch'), '64')))
% 64-bit computer
double_size_bytes = 8;
unsigned_long_int_size_bytes = 8;
float_size_bytes = 4;
unsigned_int_size_bytes = 4;
else
double_size_bytes = 8;
unsigned_long_int_size_bytes = 4;
float_size_bytes = 4;
unsigned_int_size_bytes = 4;
end
skip_bytes_each_read = float_size_bytes * num_float_vars + unsigned_long_int_size_bytes * num_unsigned_long_int_vars + ...
double_size_bytes * num_double_vars + num_unsigned_int_vars*unsigned_int_size_bytes;
bytes_shift = 0;
if (m)
usage (m);
end
if (nargin < 2)
count = Inf;
end
%loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb');
if (f < 0)
else
v1 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v2 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v3 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v4 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v5 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v6 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v7 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v8 = fread (f, count, 'long', skip_bytes_each_read - unsigned_long_int_size_bytes);
bytes_shift = bytes_shift + unsigned_long_int_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v9 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v10 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v11 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v12 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v13 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v14 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v15 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v16 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v17 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v18 = fread (f, count, 'float', skip_bytes_each_read-float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next double
v19 = fread (f, count, 'double', skip_bytes_each_read - double_size_bytes);
bytes_shift = bytes_shift + double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next unsigned int
v20 = fread (f, count, 'uint', skip_bytes_each_read - unsigned_int_size_bytes);
fclose (f);
GNSS_tracking.VE = v1;
GNSS_tracking.E = v2;
GNSS_tracking.P = v3;
GNSS_tracking.L = v4;
GNSS_tracking.VL = v5;
GNSS_tracking.prompt_I = v6;
GNSS_tracking.prompt_Q = v7;
GNSS_tracking.PRN_start_sample = v8;
GNSS_tracking.acc_carrier_phase_rad = v9;
GNSS_tracking.carrier_doppler_hz = v10;
GNSS_tracking.code_freq_hz = v11;
GNSS_tracking.carr_error = v12;
GNSS_tracking.carr_nco = v13;
GNSS_tracking.code_error = v14;
GNSS_tracking.code_nco = v15;
GNSS_tracking.CN0_SNV_dB_Hz = v16;
GNSS_tracking.carrier_lock_test = v17;
GNSS_tracking.var1 = v18;
GNSS_tracking.var2 = v19;
GNSS_tracking.PRN = v20;
end

View File

@ -1,8 +1,8 @@
function [phi, lambda, h] = cart2geo(X, Y, Z, i) function [phi, lambda, h] = cart2geo(X, Y, Z, i)
%CART2GEO Conversion of Cartesian coordinates (X,Y,Z) to geographical % CART2GEO Conversion of Cartesian coordinates (X,Y,Z) to geographical
%coordinates (phi, lambda, h) on a selected reference ellipsoid. % coordinates (phi, lambda, h) on a selected reference ellipsoid.
% %
%[phi, lambda, h] = cart2geo(X, Y, Z, i); % [phi, lambda, h] = cart2geo(X, Y, Z, i);
% %
% Choices i of Reference Ellipsoid for Geographical Coordinates % Choices i of Reference Ellipsoid for Geographical Coordinates
% 1. International Ellipsoid 1924 % 1. International Ellipsoid 1924
@ -11,12 +11,9 @@ function [phi, lambda, h] = cart2geo(X, Y, Z, i)
% 4. Geodetic Reference System 1980 % 4. Geodetic Reference System 1980
% 5. World Geodetic System 1984 % 5. World Geodetic System 1984
%Kai Borre 10-13-98 % Kai Borre 10-13-98
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%Revision: 1.0 Date: 1998/10/23 % Revision: 1.0 Date: 1998/10/23
%
% CVS record:
% $Id: cart2geo.m,v 1.1.2.3 2007/01/29 15:22:49 dpl Exp $
%========================================================================== %==========================================================================
a = [6378388 6378160 6378135 6378137 6378137]; a = [6378388 6378160 6378135 6378137 6378137];
@ -57,4 +54,5 @@ lambda = lambda*180/pi;
%fprintf('\n phi =%3.0f %3.0f %8.5f',b(1),b(2),b(3)) %fprintf('\n phi =%3.0f %3.0f %8.5f',b(1),b(2),b(3))
%fprintf('\n lambda =%3.0f %3.0f %8.5f',l(1),l(2),l(3)) %fprintf('\n lambda =%3.0f %3.0f %8.5f',l(1),l(2),l(3))
%fprintf('\n h =%14.3f\n',h) %fprintf('\n h =%14.3f\n',h)
%%%%%%%%%%%%%% end cart2geo.m %%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% end cart2geo.m %%%%%%%%%%%%%%%%%%%

View File

@ -1,7 +1,7 @@
function [E, N, U] = cart2utm(X, Y, Z, zone) function [E, N, U] = cart2utm(X, Y, Z, zone)
%CART2UTM Transformation of (X,Y,Z) to (N,E,U) in UTM, zone 'zone'. % CART2UTM Transformation of (X,Y,Z) to (N,E,U) in UTM, zone 'zone'.
% %
%[E, N, U] = cart2utm(X, Y, Z, zone); % [E, N, U] = cart2utm(X, Y, Z, zone);
% %
% Inputs: % Inputs:
% X,Y,Z - Cartesian coordinates. Coordinates are referenced % X,Y,Z - Cartesian coordinates. Coordinates are referenced
@ -12,19 +12,16 @@ function [E, N, U] = cart2utm(X, Y, Z, zone)
% Outputs: % Outputs:
% E, N, U - UTM coordinates (Easting, Northing, Uping) % E, N, U - UTM coordinates (Easting, Northing, Uping)
%Kai Borre -11-1994 % Kai Borre -11-1994
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%
% CVS record:
% $Id: cart2utm.m,v 1.1.1.1.2.6 2007/01/30 09:45:12 dpl Exp $
%This implementation is based upon % This implementation is based upon
%O. Andersson & K. Poder (1981) Koordinattransformationer % O. Andersson & K. Poder (1981) Koordinattransformationer
% ved Geod\ae{}tisk Institut. Landinspekt\oe{}ren % ved Geod\ae{}tisk Institut. Landinspekt\oe{}ren
% Vol. 30: 552--571 and Vol. 31: 76 % Vol. 30: 552--571 and Vol. 31: 76
% %
%An excellent, general reference (KW) is % An excellent, general reference (KW) is
%R. Koenig & K.H. Weise (1951) Mathematische Grundlagen der % R. Koenig & K.H. Weise (1951) Mathematische Grundlagen der
% h\"oheren Geod\"asie und Kartographie. % h\"oheren Geod\"asie und Kartographie.
% Erster Band, Springer Verlag % Erster Band, Springer Verlag
@ -76,48 +73,48 @@ while abs(U-oldU) > 1.e-4
end end
end end
%Normalized meridian quadrant, KW p. 50 (96), p. 19 (38b), p. 5 (21) % Normalized meridian quadrant, KW p. 50 (96), p. 19 (38b), p. 5 (21)
m0 = 0.0004; m0 = 0.0004;
n = f / (2-f); n = f / (2-f);
m = n^2 * (1/4 + n*n/64); m = n^2 * (1/4 + n*n/64);
w = (a*(-n-m0+m*(1-m0))) / (1+n); w = (a*(-n-m0+m*(1-m0))) / (1+n);
Q_n = a + w; Q_n = a + w;
%Easting and longitude of central meridian % Easting and longitude of central meridian
E0 = 500000; E0 = 500000;
L0 = (zone-30)*6 - 3; L0 = (zone-30)*6 - 3;
%Check tolerance for reverse transformation % Check tolerance for reverse transformation
tolutm = pi/2 * 1.2e-10 * Q_n; tolutm = pi/2 * 1.2e-10 * Q_n;
tolgeo = 0.000040; tolgeo = 0.000040;
%Coefficients of trigonometric series % Coefficients of trigonometric series
%ellipsoidal to spherical geographical, KW p. 186--187, (51)-(52) % ellipsoidal to spherical geographical, KW p. 186--187, (51)-(52)
% bg[1] = n*(-2 + n*(2/3 + n*(4/3 + n*(-82/45)))); % bg[1] = n*(-2 + n*(2/3 + n*(4/3 + n*(-82/45))));
% bg[2] = n^2*(5/3 + n*(-16/15 + n*(-13/9))); % bg[2] = n^2*(5/3 + n*(-16/15 + n*(-13/9)));
% bg[3] = n^3*(-26/15 + n*34/21); % bg[3] = n^3*(-26/15 + n*34/21);
% bg[4] = n^4*1237/630; % bg[4] = n^4*1237/630;
%spherical to ellipsoidal geographical, KW p. 190--191, (61)-(62) % spherical to ellipsoidal geographical, KW p. 190--191, (61)-(62)
% gb[1] = n*(2 + n*(-2/3 + n*(-2 + n*116/45))); % gb[1] = n*(2 + n*(-2/3 + n*(-2 + n*116/45)));
% gb[2] = n^2*(7/3 + n*(-8/5 + n*(-227/45))); % gb[2] = n^2*(7/3 + n*(-8/5 + n*(-227/45)));
% gb[3] = n^3*(56/15 + n*(-136/35)); % gb[3] = n^3*(56/15 + n*(-136/35));
% gb[4] = n^4*4279/630; % gb[4] = n^4*4279/630;
%spherical to ellipsoidal N, E, KW p. 196, (69) % spherical to ellipsoidal N, E, KW p. 196, (69)
% gtu[1] = n*(1/2 + n*(-2/3 + n*(5/16 + n*41/180))); % gtu[1] = n*(1/2 + n*(-2/3 + n*(5/16 + n*41/180)));
% gtu[2] = n^2*(13/48 + n*(-3/5 + n*557/1440)); % gtu[2] = n^2*(13/48 + n*(-3/5 + n*557/1440));
% gtu[3] = n^3*(61/240 + n*(-103/140)); % gtu[3] = n^3*(61/240 + n*(-103/140));
% gtu[4] = n^4*49561/161280; % gtu[4] = n^4*49561/161280;
%ellipsoidal to spherical N, E, KW p. 194, (65) % ellipsoidal to spherical N, E, KW p. 194, (65)
% utg[1] = n*(-1/2 + n*(2/3 + n*(-37/96 + n*1/360))); % utg[1] = n*(-1/2 + n*(2/3 + n*(-37/96 + n*1/360)));
% utg[2] = n^2*(-1/48 + n*(-1/15 + n*437/1440)); % utg[2] = n^2*(-1/48 + n*(-1/15 + n*437/1440));
% utg[3] = n^3*(-17/480 + n*37/840); % utg[3] = n^3*(-17/480 + n*37/840);
% utg[4] = n^4*(-4397/161280); % utg[4] = n^4*(-4397/161280);
%With f = 1/297 we get % With f = 1/297 we get
bg = [-3.37077907e-3; bg = [-3.37077907e-3;
4.73444769e-6; 4.73444769e-6;
@ -139,7 +136,7 @@ utg = [-8.41276339e-4;
-1.69485209e-10; -1.69485209e-10;
-2.20473896e-13]; -2.20473896e-13];
%Ellipsoidal latitude, longitude to spherical latitude, longitude % Ellipsoidal latitude, longitude to spherical latitude, longitude
neg_geo = 'FALSE'; neg_geo = 'FALSE';
if B < 0 if B < 0
@ -152,7 +149,7 @@ Bg_r = Bg_r + res_clensin;
L0 = L0*pi / 180; L0 = L0*pi / 180;
Lg_r = L - L0; Lg_r = L - L0;
%Spherical latitude, longitude to complementary spherical latitude % Spherical latitude, longitude to complementary spherical latitude
% i.e. spherical N, E % i.e. spherical N, E
cos_BN = cos(Bg_r); cos_BN = cos(Bg_r);
Np = atan2(sin(Bg_r), cos(Lg_r)*cos_BN); Np = atan2(sin(Bg_r), cos(Lg_r)*cos_BN);

View File

@ -1,7 +1,7 @@
function corrTime = check_t(time) function corrTime = check_t(time)
%CHECK_T accounting for beginning or end of week crossover. % CHECK_T accounting for beginning or end of week crossover.
% %
%corrTime = check_t(time); % corrTime = check_t(time);
% %
% Inputs: % Inputs:
% time - time in seconds % time - time in seconds
@ -9,11 +9,8 @@ function corrTime = check_t(time)
% Outputs: % Outputs:
% corrTime - corrected time (seconds) % corrTime - corrected time (seconds)
%Kai Borre 04-01-96 % Kai Borre 04-01-96
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%
% CVS record:
% $Id: check_t.m,v 1.1.1.1.2.4 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
half_week = 302400; % seconds half_week = 302400; % seconds
@ -25,4 +22,5 @@ if time > half_week
elseif time < -half_week elseif time < -half_week
corrTime = time + 2*half_week; corrTime = time + 2*half_week;
end end
%%%%%%% end check_t.m %%%%%%%%%%%%%%%%% %%%%%%% end check_t.m %%%%%%%%%%%%%%%%%

View File

@ -1,14 +1,12 @@
function [re, im] = clksin(ar, degree, arg_real, arg_imag) function [re, im] = clksin(ar, degree, arg_real, arg_imag)
%Clenshaw summation of sinus with complex argument % Clenshaw summation of sinus with complex argument
%[re, im] = clksin(ar, degree, arg_real, arg_imag); % [re, im] = clksin(ar, degree, arg_real, arg_imag);
% Written by Kai Borre % Written by Kai Borre
% December 20, 1995 % December 20, 1995
% %
% See also WGS2UTM or CART2UTM % See also WGS2UTM or CART2UTM
% %
% CVS record:
% $Id: clksin.m,v 1.1.1.1.2.4 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
sin_arg_r = sin(arg_real); sin_arg_r = sin(arg_real);

View File

@ -1,15 +1,12 @@
function result = clsin(ar, degree, argument) function result = clsin(ar, degree, argument)
%Clenshaw summation of sinus of argument. % Clenshaw summation of sinus of argument.
% %
%result = clsin(ar, degree, argument); % result = clsin(ar, degree, argument);
% Written by Kai Borre % Written by Kai Borre
% December 20, 1995 % December 20, 1995
% %
% See also WGS2UTM or CART2UTM % See also WGS2UTM or CART2UTM
%
% CVS record:
% $Id: clsin.m,v 1.1.1.1.2.4 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
cos_arg = 2 * cos(argument); cos_arg = 2 * cos(argument);
@ -23,4 +20,5 @@ for t = degree : -1 : 1
end end
result = hr * sin(argument); result = hr * sin(argument);
%%%%%%%%%%%%%%%%%%%%%%% end clsin.m %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%% end clsin.m %%%%%%%%%%%%%%%%%%%%%

View File

@ -1,6 +1,6 @@
function dmsOutput = deg2dms(deg) function dmsOutput = deg2dms(deg)
%DEG2DMS Conversion of degrees to degrees, minutes, and seconds. % DEG2DMS Conversion of degrees to degrees, minutes, and seconds.
%The output format (dms format) is: (degrees*100 + minutes + seconds/100) % The output format (dms format) is: (degrees*100 + minutes + seconds/100)
% Written by Kai Borre % Written by Kai Borre
% February 7, 2001 % February 7, 2001

View File

@ -1,12 +1,12 @@
function deg = dms2deg(dms) function deg = dms2deg(dms)
%DMS2DEG Conversion of degrees, minutes, and seconds to degrees. % DMS2DEG Conversion of degrees, minutes, and seconds to degrees.
% Written by Javier Arribas 2011 % Written by Javier Arribas 2011
% December 7, 2011 % December 7, 2011
%if (dms(1)>=0) %if (dms(1)>=0)
deg=dms(1)+dms(2)/60+dms(3)/3600; deg=dms(1)+dms(2)/60+dms(3)/3600;
%else %else
%deg=dms(1)-dms(2)/60-dms(3)/3600; %deg=dms(1)-dms(2)/60-dms(3)/3600;
%end %end

View File

@ -1,6 +1,6 @@
function [dout,mout,sout] = dms2mat(dms,n) function [dout,mout,sout] = dms2mat(dms,n)
%DMS2MAT Converts a dms vector format to a [deg min sec] matrix % DMS2MAT Converts a dms vector format to a [deg min sec] matrix
% %
% [d,m,s] = DMS2MAT(dms) converts a dms vector format to a % [d,m,s] = DMS2MAT(dms) converts a dms vector format to a
% deg:min:sec matrix. The vector format is dms = 100*deg + min + sec/100. % deg:min:sec matrix. The vector format is dms = 100*deg + min + sec/100.
@ -19,7 +19,7 @@ function [dout,mout,sout] = dms2mat(dms,n)
% Copyright 1996-2002 Systems Planning and Analysis, Inc. and The MathWorks, Inc. % Copyright 1996-2002 Systems Planning and Analysis, Inc. and The MathWorks, Inc.
% Written by: E. Byrns, E. Brown % Written by: E. Byrns, E. Brown
% $Revision: 1.10 $ $Date: 2002/03/20 21:25:06 $ % Revision: 1.10 $Date: 2002/03/20 21:25:06
if nargin == 0 if nargin == 0

View File

@ -1,8 +1,8 @@
function X_sat_rot = e_r_corr(traveltime, X_sat) function X_sat_rot = e_r_corr(traveltime, X_sat)
%E_R_CORR Returns rotated satellite ECEF coordinates due to Earth % E_R_CORR Returns rotated satellite ECEF coordinates due to Earth
%rotation during signal travel time % rotation during signal travel time
% %
%X_sat_rot = e_r_corr(traveltime, X_sat); % X_sat_rot = e_r_corr(traveltime, X_sat);
% %
% Inputs: % Inputs:
% travelTime - signal travel time % travelTime - signal travel time
@ -11,11 +11,8 @@ function X_sat_rot = e_r_corr(traveltime, X_sat)
% Outputs: % Outputs:
% X_sat_rot - rotated satellite's coordinates (ECEF) % X_sat_rot - rotated satellite's coordinates (ECEF)
%Written by Kai Borre % Written by Kai Borre
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%
% CVS record:
% $Id: e_r_corr.m,v 1.1.1.1.2.6 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
Omegae_dot = 7.292115147e-5; % rad/sec Omegae_dot = 7.292115147e-5; % rad/sec

View File

@ -1,13 +1,13 @@
function utmZone = findUtmZone(latitude, longitude) function utmZone = findUtmZone(latitude, longitude)
%Function finds the UTM zone number for given longitude and latitude. % Function finds the UTM zone number for given longitude and latitude.
%The longitude value must be between -180 (180 degree West) and 180 (180 % The longitude value must be between -180 (180 degree West) and 180 (180
%degree East) degree. The latitude must be within -80 (80 degree South) and % degree East) degree. The latitude must be within -80 (80 degree South) and
%84 (84 degree North). % 84 (84 degree North).
% %
%utmZone = findUtmZone(latitude, longitude); % utmZone = findUtmZone(latitude, longitude);
% %
%Latitude and longitude must be in decimal degrees (e.g. 15.5 degrees not % Latitude and longitude must be in decimal degrees (e.g. 15.5 degrees not
%15 deg 30 min). % 15 deg 30 min).
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
% SoftGNSS v3.0 % SoftGNSS v3.0
@ -31,9 +31,6 @@ function utmZone = findUtmZone(latitude, longitude)
%USA. %USA.
%========================================================================== %==========================================================================
%CVS record:
%$Id: findUtmZone.m,v 1.1.2.2 2006/08/22 13:45:59 dpl Exp $
%% Check value bounds ===================================================== %% Check value bounds =====================================================
if ((longitude > 180) || (longitude < -180)) if ((longitude > 180) || (longitude < -180))

View File

@ -1,13 +1,13 @@
function [X, Y, Z] = geo2cart(phi, lambda, h, i) function [X, Y, Z] = geo2cart(phi, lambda, h, i)
%GEO2CART Conversion of geographical coordinates (phi, lambda, h) to % GEO2CART Conversion of geographical coordinates (phi, lambda, h) to
%Cartesian coordinates (X, Y, Z). % Cartesian coordinates (X, Y, Z).
% %
%[X, Y, Z] = geo2cart(phi, lambda, h, i); % [X, Y, Z] = geo2cart(phi, lambda, h, i);
% %
%Format for phi and lambda: [degrees minutes seconds]. % Format for phi and lambda: [degrees minutes seconds].
%h, X, Y, and Z are in meters. % h, X, Y, and Z are in meters.
% %
%Choices i of Reference Ellipsoid % Choices i of Reference Ellipsoid
% 1. International Ellipsoid 1924 % 1. International Ellipsoid 1924
% 2. International Ellipsoid 1967 % 2. International Ellipsoid 1967
% 3. World Geodetic System 1972 % 3. World Geodetic System 1972
@ -23,11 +23,8 @@ function [X, Y, Z] = geo2cart(phi, lambda, h, i)
% Outputs: % Outputs:
% X, Y, Z - Cartesian coordinates (meters) % X, Y, Z - Cartesian coordinates (meters)
%Kai Borre 10-13-98 % Kai Borre 10-13-98
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%
% CVS record:
% $Id: geo2cart.m,v 1.1.2.7 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
b = phi(1) + phi(2)/60 + phi(3)/3600; b = phi(1) + phi(2)/60 + phi(3)/3600;
@ -45,4 +42,5 @@ N = c / sqrt(1 + ex2*cos(b)^2);
X = (N+h) * cos(b) * cos(l); X = (N+h) * cos(b) * cos(l);
Y = (N+h) * cos(b) * sin(l); Y = (N+h) * cos(b) * sin(l);
Z = ((1-f(i))^2*N + h) * sin(b); Z = ((1-f(i))^2*N + h) * sin(b);
%%%%%%%%%%%%%% end geo2cart.m %%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% end geo2cart.m %%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -1,7 +1,7 @@
function [pos, el, az, dop] = leastSquarePos(satpos, obs, settings) function [pos, el, az, dop] = leastSquarePos(satpos, obs, settings)
%Function calculates the Least Square Solution. % Function calculates the Least Square Solution.
% %
%[pos, el, az, dop] = leastSquarePos(satpos, obs, settings); % [pos, el, az, dop] = leastSquarePos(satpos, obs, settings);
% %
% Inputs: % Inputs:
% satpos - Satellites positions (in ECEF system: [X; Y; Z;] - % satpos - Satellites positions (in ECEF system: [X; Y; Z;] -
@ -24,9 +24,6 @@ function [pos, el, az, dop] = leastSquarePos(satpos, obs, settings)
%Based on Kai Borre %Based on Kai Borre
%Copyright (c) by Kai Borre %Copyright (c) by Kai Borre
%Updated by Darius Plausinaitis, Peter Rinder and Nicolaj Bertelsen %Updated by Darius Plausinaitis, Peter Rinder and Nicolaj Bertelsen
%
% CVS record:
% $Id: leastSquarePos.m,v 1.1.2.12 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
%=== Initialization ======================================================= %=== Initialization =======================================================

View File

@ -1,6 +1,5 @@
function dmsvec = mat2dms(d,m,s,n) function dmsvec = mat2dms(d,m,s,n)
% MAT2DMS Converts a [deg min sec] matrix to vector format
%MAT2DMS Converts a [deg min sec] matrix to vector format
% %
% dms = MAT2DMS(d,m,s) converts a deg:min:sec matrix into a vector % dms = MAT2DMS(d,m,s) converts a deg:min:sec matrix into a vector
% format. The vector format is dms = 100*deg + min + sec/100. % format. The vector format is dms = 100*deg + min + sec/100.
@ -24,7 +23,7 @@ function dmsvec = mat2dms(d,m,s,n)
% Copyright 1996-2002 Systems Planning and Analysis, Inc. and The MathWorks, Inc. % Copyright 1996-2002 Systems Planning and Analysis, Inc. and The MathWorks, Inc.
% Written by: E. Byrns, E. Brown % Written by: E. Byrns, E. Brown
% $Revision: 1.10 $ $Date: 2002/03/20 21:25:51 $ % Revision: 1.10 Date: 2002/03/20 21:25:51
if nargin == 0 if nargin == 0

View File

@ -1,6 +1,6 @@
function [x,msg] = roundn(x,n) function [x,msg] = roundn(x,n)
%ROUNDN Rounds input data at specified power of 10 % ROUNDN Rounds input data at specified power of 10
% %
% y = ROUNDN(x) rounds the input data x to the nearest hundredth. % y = ROUNDN(x) rounds the input data x to the nearest hundredth.
% %
@ -15,7 +15,7 @@ function [x,msg] = roundn(x,n)
% Copyright 1996-2002 Systems Planning and Analysis, Inc. and The MathWorks, Inc. % Copyright 1996-2002 Systems Planning and Analysis, Inc. and The MathWorks, Inc.
% Written by: E. Byrns, E. Brown % Written by: E. Byrns, E. Brown
% $Revision: 1.9 $ $Date: 2002/03/20 21:26:19 $ % Revision: 1.9 Date: 2002/03/20 21:26:19
msg = []; % Initialize output msg = []; % Initialize output

View File

@ -1,9 +1,9 @@
function [satPositions, satClkCorr] = satpos(transmitTime, prnList, ... function [satPositions, satClkCorr] = satpos(transmitTime, prnList, ...
eph, settings) eph, settings)
%SATPOS Computation of satellite coordinates X,Y,Z at TRANSMITTIME for % SATPOS Computation of satellite coordinates X,Y,Z at TRANSMITTIME for
%given ephemeris EPH. Coordinates are computed for each satellite in the % given ephemeris EPH. Coordinates are computed for each satellite in the
%list PRNLIST. % list PRNLIST.
%[satPositions, satClkCorr] = satpos(transmitTime, prnList, eph, settings); %[ satPositions, satClkCorr] = satpos(transmitTime, prnList, eph, settings);
% %
% Inputs: % Inputs:
% transmitTime - transmission time % transmitTime - transmission time
@ -18,12 +18,9 @@ function [satPositions, satClkCorr] = satpos(transmitTime, prnList, ...
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
% SoftGNSS v3.0 % SoftGNSS v3.0
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
%Based on Kai Borre 04-09-96 % Based on Kai Borre 04-09-96
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%Updated by Darius Plausinaitis, Peter Rinder and Nicolaj Bertelsen % Updated by Darius Plausinaitis, Peter Rinder and Nicolaj Bertelsen
%
% CVS record:
% $Id: satpos.m,v 1.1.2.17 2007/01/30 09:45:12 dpl Exp $
%% Initialize constants =================================================== %% Initialize constants ===================================================
numOfSatellites = size(prnList, 2); numOfSatellites = size(prnList, 2);
@ -31,12 +28,12 @@ numOfSatellites = size(prnList, 2);
% GPS constatns % GPS constatns
gpsPi = 3.1415926535898; % Pi used in the GPS coordinate gpsPi = 3.1415926535898; % Pi used in the GPS coordinate
% system % system
%--- Constants for satellite position calculation ------------------------- %--- Constants for satellite position calculation -------------------------
Omegae_dot = 7.2921151467e-5; % Earth rotation rate, [rad/s] Omegae_dot = 7.2921151467e-5; % Earth rotation rate, [rad/s]
GM = 3.986005e14; % Universal gravitational constant times GM = 3.986005e14; % Universal gravitational constant times
% the mass of the Earth, [m^3/s^2] % the mass of the Earth, [m^3/s^2]
F = -4.442807633e-10; % Constant, [sec/(meter)^(1/2)] F = -4.442807633e-10; % Constant, [sec/(meter)^(1/2)]
%% Initialize results ===================================================== %% Initialize results =====================================================
@ -49,7 +46,7 @@ for satNr = 1 : numOfSatellites
prn = prnList(satNr); prn = prnList(satNr);
%% Find initial satellite clock correction -------------------------------- %% Find initial satellite clock correction --------------------------------
%--- Find time difference --------------------------------------------- %--- Find time difference ---------------------------------------------
dt = check_t(transmitTime - eph(prn).t_oc); dt = check_t(transmitTime - eph(prn).t_oc);
@ -61,7 +58,7 @@ for satNr = 1 : numOfSatellites
time = transmitTime - satClkCorr(satNr); time = transmitTime - satClkCorr(satNr);
%% Find satellite's position ---------------------------------------------- %% Find satellite's position ----------------------------------------------
%Restore semi-major axis %Restore semi-major axis
a = eph(prn).sqrtA * eph(prn).sqrtA; a = eph(prn).sqrtA * eph(prn).sqrtA;
@ -133,7 +130,7 @@ for satNr = 1 : numOfSatellites
satPositions(3, satNr) = sin(u)*r * sin(i); satPositions(3, satNr) = sin(u)*r * sin(i);
%% Include relativistic correction in clock correction -------------------- %% Include relativistic correction in clock correction --------------------
satClkCorr(satNr) = (eph(prn).a_f2 * dt + eph(prn).a_f1) * dt + ... satClkCorr(satNr) = (eph(prn).a_f2 * dt + eph(prn).a_f1) * dt + ...
eph(prn).a_f0 - ... eph(prn).a_f0 - ...
eph(prn).T_GD + dtr; eph(prn).T_GD + dtr;

View File

@ -1,9 +1,9 @@
function [dphi, dlambda, h] = togeod(a, finv, X, Y, Z) function [dphi, dlambda, h] = togeod(a, finv, X, Y, Z)
%TOGEOD Subroutine to calculate geodetic coordinates latitude, longitude, % TOGEOD Subroutine to calculate geodetic coordinates latitude, longitude,
% height given Cartesian coordinates X,Y,Z, and reference ellipsoid % height given Cartesian coordinates X,Y,Z, and reference ellipsoid
% values semi-major axis (a) and the inverse of flattening (finv). % values semi-major axis (a) and the inverse of flattening (finv).
% %
%[dphi, dlambda, h] = togeod(a, finv, X, Y, Z); % [dphi, dlambda, h] = togeod(a, finv, X, Y, Z);
% %
% The units of linear parameters X,Y,Z,a must all agree (m,km,mi,ft,..etc) % The units of linear parameters X,Y,Z,a must all agree (m,km,mi,ft,..etc)
% The output units of angular quantities will be in decimal degrees % The output units of angular quantities will be in decimal degrees
@ -24,9 +24,6 @@ function [dphi, dlambda, h] = togeod(a, finv, X, Y, Z)
% Reprinted with permission of author, 1996 % Reprinted with permission of author, 1996
% Fortran code translated into MATLAB % Fortran code translated into MATLAB
% Kai Borre 03-30-96 % Kai Borre 03-30-96
%
% CVS record:
% $Id: togeod.m,v 1.1.1.1.2.4 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
h = 0; h = 0;

View File

@ -1,9 +1,9 @@
function [Az, El, D] = topocent(X, dx) function [Az, El, D] = topocent(X, dx)
%TOPOCENT Transformation of vector dx into topocentric coordinate % TOPOCENT Transformation of vector dx into topocentric coordinate
% system with origin at X. % system with origin at X.
% Both parameters are 3 by 1 vectors. % Both parameters are 3 by 1 vectors.
% %
%[Az, El, D] = topocent(X, dx); % [Az, El, D] = topocent(X, dx);
% %
% Inputs: % Inputs:
% X - vector origin corrdinates (in ECEF system [X; Y; Z;]) % X - vector origin corrdinates (in ECEF system [X; Y; Z;])
@ -14,11 +14,8 @@ function [Az, El, D] = topocent(X, dx)
% Az - azimuth from north positive clockwise, degrees % Az - azimuth from north positive clockwise, degrees
% El - elevation angle, degrees % El - elevation angle, degrees
%Kai Borre 11-24-96 % Kai Borre 11-24-96
%Copyright (c) by Kai Borre % Copyright (c) by Kai Borre
%
% CVS record:
% $Id: topocent.m,v 1.1.1.1.2.4 2006/08/22 13:45:59 dpl Exp $
%========================================================================== %==========================================================================
dtr = pi/180; dtr = pi/180;

View File

@ -1,9 +1,9 @@
function ddr = tropo(sinel, hsta, p, tkel, hum, hp, htkel, hhum) function ddr = tropo(sinel, hsta, p, tkel, hum, hp, htkel, hhum)
%TROPO Calculation of tropospheric correction. % TROPO Calculation of tropospheric correction.
% The range correction ddr in m is to be subtracted from % The range correction ddr in m is to be subtracted from
% pseudo-ranges and carrier phases % pseudo-ranges and carrier phases
% %
%ddr = tropo(sinel, hsta, p, tkel, hum, hp, htkel, hhum); % ddr = tropo(sinel, hsta, p, tkel, hum, hp, htkel, hhum);
% %
% Inputs: % Inputs:
% sinel - sin of elevation angle of satellite % sinel - sin of elevation angle of satellite
@ -26,9 +26,6 @@ function ddr = tropo(sinel, hsta, p, tkel, hum, hp, htkel, hhum)
% A Matlab reimplementation of a C code from driver. % A Matlab reimplementation of a C code from driver.
% Kai Borre 06-28-95 % Kai Borre 06-28-95
%
% CVS record:
% $Id: tropo.m,v 1.1.1.1.2.4 2006/08/22 13:46:00 dpl Exp $
%========================================================================== %==========================================================================
a_e = 6378.137; % semi-major axis of earth ellipsoid a_e = 6378.137; % semi-major axis of earth ellipsoid

View File

@ -1,191 +0,0 @@
% /*!
% * \file glonass_ca_dll_pll_read_tracking_dump.m
% * \brief Read GNSS-SDR Tracking dump binary file into MATLAB.
% * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function [GNSS_tracking] = glonass_ca_dll_pll_read_tracking_dump (filename, count)
%% usage: gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, [count])
%%
%% open GNSS-SDR tracking binary log file .dat and return the contents
%%
narginchk (1,2);
num_float_vars=5;
num_unsigned_long_int_vars=1;
num_double_vars=11;
num_unsigned_int_vars=1;
double_size_bytes=8;
unsigned_long_int_size_bytes=8;
float_size_bytes=4;
long_int_size_bytes=4;
skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars+long_int_size_bytes*num_unsigned_int_vars;
bytes_shift=0;
if (nargin < 2)
%count = Inf;
file_stats = dir(filename);
%round num bytes to read to integer number of samples (to protect the script from binary
%dump end file transitory)
count = (file_stats.bytes - mod(file_stats.bytes,skip_bytes_each_read))/skip_bytes_each_read;
end
%loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb');
if (f < 0)
else
v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved unsigned_long_int
v6 = fread (f, count, 'uint64',skip_bytes_each_read-unsigned_long_int_size_bytes);
bytes_shift=bytes_shift+unsigned_long_int_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v7 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v8 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v9 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v10 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v11 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v12 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v13 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v14 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v15 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v16 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v17 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double
v18 = fread (f, count, 'uint32',skip_bytes_each_read-double_size_bytes);
fclose (f);
%%%%%%%% output vars %%%%%%%%
% // EPR
% d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
% d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
% d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
% // PROMPT I and Q (to analyze navigation symbols)
% d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
% d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
% // PRN start sample stamp
% //tmp_float=(float)d_sample_counter;
% d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
% // accumulated carrier phase
% d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
%
% // carrier and code frequency
% d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
%
% //PLL commands
% d_dump_file.write(reinterpret_cast<char*>(&carr_phase_error_secs_Ti), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
%
% //DLL commands
% d_dump_file.write(reinterpret_cast<char*>(&code_error_chips_Ti), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
%
% // CN0 and carrier lock test
% d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
%
% // AUX vars (for debug purposes)
% tmp_double = d_rem_code_phase_samples;
% d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
% tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
% d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
% // PRN
% unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
% d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
E=v1;
P=v2;
L=v3;
prompt_I=v4;
prompt_Q=v5;
PRN_start_sample=v6;
acc_carrier_phase_rad=v7;
carrier_freq_hz=v8;
code_freq_hz=v9;
carr_error=v10;
carr_nco=v11;
code_error=v12;
code_nco=v13;
CN0_SNV_dB_Hz=v14;
carrier_lock_test=v15;
var1=v16;
var2=v17;
PRN=v18;
GNSS_tracking.E=E;
GNSS_tracking.P=P;
GNSS_tracking.L=L;
GNSS_tracking.prompt_I=prompt_I;
GNSS_tracking.prompt_Q=prompt_Q;
GNSS_tracking.PRN_start_sample=PRN_start_sample;
GNSS_tracking.acc_carrier_phase_rad=acc_carrier_phase_rad;
GNSS_tracking.carrier_freq_hz=carrier_freq_hz;
GNSS_tracking.code_freq_hz=code_freq_hz;
GNSS_tracking.carr_error=carr_error;
GNSS_tracking.carr_nco=carr_nco;
GNSS_tracking.code_error=code_error;
GNSS_tracking.code_nco=code_nco;
GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
GNSS_tracking.carrier_lock_test=carrier_lock_test;
GNSS_tracking.d_rem_code_phase_samples=var1;
GNSS_tracking.var2=var2;
GNSS_tracking.PRN=PRN;
end

View File

@ -1,178 +0,0 @@
% /*!
% * \file gps_l1_ca_dll_fll_pll_read_tracking_dump.m
% * \brief Read GNSS-SDR Tracking dump binary file into MATLAB.
% * \author Javier Arribas, 2011. jarribas(at)cttc.es
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function [GNSS_tracking] = gps_l1_ca_dll_fll_pll_read_tracking_dump (filename, samplingFreq, count)
%% usage: gps_l1_ca_dll_fll_pll_read_tracking_dump (filename, [count])
%%
%% open GNSS-SDR tracking binary log file .dat and return the contents
%%
m = nargchk (1,3,nargin);
num_float_vars=16;
num_double_vars=1;
double_size_bytes=8;
float_size_bytes=4;
skip_bytes_each_read=float_size_bytes*num_float_vars+double_size_bytes*num_double_vars;
bytes_shift=0;
if (m)
usage (m);
end
if (nargin < 3)
count = Inf;
end
%loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb');
if (f < 0)
else
v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v6 = fread (f, count, 'uint32',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v7 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v8 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v9 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v10 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v11 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v12 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v13 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v14 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v15 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v16 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v17 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
fclose (f);
%%%%%%%% output vars %%%%%%%%
% // EPR
% d_dump_file.write((char*)&tmp_E, sizeof(float));
% d_dump_file.write((char*)&tmp_P, sizeof(float));
% d_dump_file.write((char*)&tmp_L, sizeof(float));
% // PROMPT I and Q (to analyze navigation symbols)
% d_dump_file.write((char*)&prompt_I, sizeof(float));
% d_dump_file.write((char*)&prompt_Q, sizeof(float));
% // PRN start sample stamp
% //tmp_float=(float)d_sample_counter;
% d_dump_file.write((char*)&d_sample_counter, sizeof(unsigned long int));
% // accumulated carrier phase
% d_dump_file.write((char*)&d_acc_carrier_phase_rad, sizeof(float));
%
% // carrier and code frequency
% d_dump_file.write((char*)&d_carrier_doppler_hz, sizeof(float));
% d_dump_file.write((char*)&d_code_freq_hz, sizeof(float));
%
% //PLL commands
% d_dump_file.write((char*)&PLL_discriminator_hz, sizeof(float));
% d_dump_file.write((char*)&carr_nco_hz, sizeof(float));
%
% //DLL commands
% d_dump_file.write((char*)&code_error_chips, sizeof(float));
% d_dump_file.write((char*)&d_code_phase_samples, sizeof(float));
%
% // CN0 and carrier lock test
% d_dump_file.write((char*)&d_CN0_SNV_dB_Hz, sizeof(float));
% d_dump_file.write((char*)&d_carrier_lock_test, sizeof(float));
%
% // AUX vars (for debug purposes)
% tmp_float=0;
% d_dump_file.write((char*)&tmp_float, sizeof(float));
% d_dump_file.write((char*)&d_sample_counter_seconds, sizeof(double));
E=v1;
P=v2;
L=v3;
prompt_I=v4;
prompt_Q=v5;
PRN_start_sample=v6;
acc_carrier_phase_rad=v7;
carrier_doppler_hz=v8;
code_freq_hz=v9;
PLL_discriminator_hz=v10;
carr_nco_hz=v11;
code_error_chips=v12;
code_phase_samples=v13;
CN0_SNV_dB_Hz=v14;
carrier_lock_test=v15;
var1=v16;
var2=v17;
GNSS_tracking.E=E;
GNSS_tracking.P=P;
GNSS_tracking.L=L;
GNSS_tracking.prompt_I=prompt_I;
GNSS_tracking.prompt_Q=prompt_Q;
GNSS_tracking.PRN_start_sample=PRN_start_sample;
GNSS_tracking.acc_carrier_phase_rad=acc_carrier_phase_rad;
GNSS_tracking.carrier_doppler_hz=carrier_doppler_hz;
GNSS_tracking.code_freq_hz=code_freq_hz;
GNSS_tracking.PLL_discriminator_hz=PLL_discriminator_hz;
GNSS_tracking.carr_nco=carr_nco_hz;
GNSS_tracking.code_error_chips=code_error_chips;
GNSS_tracking.code_phase_samples=code_phase_samples;
GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz;
GNSS_tracking.carrier_lock_test=carrier_lock_test;
GNSS_tracking.var1=var1;
GNSS_tracking.var2=var2;
GNSS_tracking.prn_delay_ms=1000*(GNSS_tracking.var2+GNSS_tracking.var1)./samplingFreq;
end

View File

@ -1,65 +1,63 @@
% /*! % Usage: gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, [count])
% * \file gps_l1_ca_dll_pll_read_tracking_dump.m %
% * \brief Read GNSS-SDR Tracking dump binary file into MATLAB. % Opens GNSS-SDR tracking binary log file .dat and returns the contents
% * \author Javier Arribas, 2011. jarribas(at)cttc.es
% * ------------------------------------------------------------------------- % Read GNSS-SDR Tracking dump binary file into MATLAB.
% * % Javier Arribas, 2011. jarribas(at)cttc.es
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % -------------------------------------------------------------------------
% * %
% * GNSS-SDR is a software defined Global Navigation % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * Satellite Systems receiver %
% * % GNSS-SDR is a software defined Global Navigation
% * This file is part of GNSS-SDR. % Satellite Systems receiver
% * %
% * GNSS-SDR is free software: you can redistribute it and/or modify % This file is part of GNSS-SDR.
% * it under the terms of the GNU General Public License as published by %
% * the Free Software Foundation, either version 3 of the License, or % GNSS-SDR is free software: you can redistribute it and/or modify
% * at your option) any later version. % it under the terms of the GNU General Public License as published by
% * % the Free Software Foundation, either version 3 of the License, or
% * GNSS-SDR is distributed in the hope that it will be useful, % at your option) any later version.
% * but WITHOUT ANY WARRANTY; without even the implied warranty of %
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNSS-SDR is distributed in the hope that it will be useful,
% * GNU General Public License for more details. % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * You should have received a copy of the GNU General Public License % GNU General Public License for more details.
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. %
% * % You should have received a copy of the GNU General Public License
% * ------------------------------------------------------------------------- % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% */ %
% -------------------------------------------------------------------------
%
function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count) function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count)
%% usage: gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, [count]) m = nargchk (1,2,nargin);
%% num_float_vars=5;
%% open GNSS-SDR tracking binary log file .dat and return the contents num_unsigned_long_int_vars=1;
%% num_double_vars=11;
num_unsigned_int_vars=1;
double_size_bytes=8;
unsigned_long_int_size_bytes=8;
float_size_bytes=4;
long_int_size_bytes=4;
m = nargchk (1,2,nargin); skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars+long_int_size_bytes*num_unsigned_int_vars;
num_float_vars=5; bytes_shift=0;
num_unsigned_long_int_vars=1; if (m)
num_double_vars=11;
num_unsigned_int_vars=1;
double_size_bytes=8;
unsigned_long_int_size_bytes=8;
float_size_bytes=4;
long_int_size_bytes=4;
skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars+long_int_size_bytes*num_unsigned_int_vars;
bytes_shift=0;
if (m)
usage (m); usage (m);
end end
if (nargin < 2) if (nargin < 2)
%count = Inf; %count = Inf;
file_stats = dir(filename); file_stats = dir(filename);
%round num bytes to read to integer number of samples (to protect the script from binary %round num bytes to read to integer number of samples (to protect the script from binary
%dump end file transitory) %dump end file transitory)
count = (file_stats.bytes - mod(file_stats.bytes,skip_bytes_each_read))/skip_bytes_each_read; count = (file_stats.bytes - mod(file_stats.bytes,skip_bytes_each_read))/skip_bytes_each_read;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes);
bytes_shift=bytes_shift+float_size_bytes; bytes_shift=bytes_shift+float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float fseek(f,bytes_shift,'bof'); % move to next interleaved float
@ -116,43 +114,43 @@ function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count
%%%%%%%% output vars %%%%%%%% %%%%%%%% output vars %%%%%%%%
% // EPR % // EPR
% d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float)); % d_dump_file.write(reinterpret_cast<char*>(&tmp_E), sizeof(float));
% d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float)); % d_dump_file.write(reinterpret_cast<char*>(&tmp_P), sizeof(float));
% d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float)); % d_dump_file.write(reinterpret_cast<char*>(&tmp_L), sizeof(float));
% // PROMPT I and Q (to analyze navigation symbols) % // PROMPT I and Q (to analyze navigation symbols)
% d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float)); % d_dump_file.write(reinterpret_cast<char*>(&prompt_I), sizeof(float));
% d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float)); % d_dump_file.write(reinterpret_cast<char*>(&prompt_Q), sizeof(float));
% // PRN start sample stamp % // PRN start sample stamp
% //tmp_float=(float)d_sample_counter; % //tmp_float=(float)d_sample_counter;
% d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int)); % d_dump_file.write(reinterpret_cast<char*>(&d_sample_counter), sizeof(unsigned long int));
% // accumulated carrier phase % // accumulated carrier phase
% d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_rad), sizeof(double));
% %
% // carrier and code frequency % // carrier and code frequency
% d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
% %
% //PLL commands % //PLL commands
% d_dump_file.write(reinterpret_cast<char*>(&carr_phase_error_secs_Ti), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&carr_phase_error_secs_Ti), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
% %
% //DLL commands % //DLL commands
% d_dump_file.write(reinterpret_cast<char*>(&code_error_chips_Ti), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&code_error_chips_Ti), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&code_error_filt_chips), sizeof(double));
% %
% // CN0 and carrier lock test % // CN0 and carrier lock test
% d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&d_CN0_SNV_dB_Hz), sizeof(double));
% d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&d_carrier_lock_test), sizeof(double));
% %
% // AUX vars (for debug purposes) % // AUX vars (for debug purposes)
% tmp_double = d_rem_code_phase_samples; % tmp_double = d_rem_code_phase_samples;
% d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
% tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples); % tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
% d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double)); % d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
% // PRN % // PRN
% unsigned int prn_ = d_acquisition_gnss_synchro->PRN; % unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
% d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int)); % d_dump_file.write(reinterpret_cast<char*>(&prn_), sizeof(unsigned int));
E=v1; E=v1;
P=v2; P=v2;
L=v3; L=v3;
@ -190,5 +188,5 @@ function [GNSS_tracking] = gps_l1_ca_dll_pll_read_tracking_dump (filename, count
GNSS_tracking.d_rem_code_phase_samples=var1; GNSS_tracking.d_rem_code_phase_samples=var1;
GNSS_tracking.var2=var2; GNSS_tracking.var2=var2;
GNSS_tracking.PRN=PRN; GNSS_tracking.PRN=PRN;
end end

View File

@ -1,38 +1,39 @@
% /*! %
% * \file gps_l1_ca_pvt_read_pvt_dump.m % \file gps_l1_ca_pvt_read_pvt_dump.m
% * \brief Read GNSS-SDR PVT lib dump binary file into MATLAB. The resulting % \brief Read GNSS-SDR PVT lib dump binary file into MATLAB. The resulting
% structure is compatible with the K.Borre MATLAB-based receiver. % structure is compatible with the K.Borre MATLAB-based receiver.
% * \author Javier Arribas, 2011. jarribas(at)cttc.es % \author Javier Arribas, 2011. jarribas(at)cttc.es
% * ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% * %
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors) % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% * %
% * GNSS-SDR is a software defined Global Navigation % GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver % Satellite Systems receiver
% * %
% * This file is part of GNSS-SDR. % This file is part of GNSS-SDR.
% * %
% * GNSS-SDR is free software: you can redistribute it and/or modify % GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by % it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or % the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version. % at your option) any later version.
% * %
% * GNSS-SDR is distributed in the hope that it will be useful, % GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details. % GNU General Public License for more details.
% * %
% * You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * %
% * ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% */ %
function [navSolutions] = gps_l1_ca_pvt_read_pvt_dump (filename, count) function [navSolutions] = gps_l1_ca_pvt_read_pvt_dump (filename, count)
%% usage: gps_l1_ca_pvt_read_pvt_dump (filename, [count]) %% usage: gps_l1_ca_pvt_read_pvt_dump (filename, [count])
%% %%
%% open GNSS-SDR PVT binary log file .dat and return the contents %% open GNSS-SDR PVT binary log file .dat and return the contents
%% %%
% %
% // PVT GPS time % // PVT GPS time
% tmp_double=GPS_current_time; % tmp_double=GPS_current_time;
@ -59,22 +60,22 @@ function [navSolutions] = gps_l1_ca_pvt_read_pvt_dump (filename, count)
% tmp_double=d_height_m; % tmp_double=d_height_m;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
m = nargchk (1,2,nargin); m = nargchk (1,2,nargin);
num_double_vars=8; num_double_vars=8;
double_size_bytes=8; double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars; skip_bytes_each_read=double_size_bytes*num_double_vars;
bytes_shift=0; bytes_shift=0;
if (m) if (m)
usage (m); usage (m);
end end
if (nargin < 3) if (nargin < 3)
count = Inf; count = Inf;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
GPS_current_time = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); GPS_current_time = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes; bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved fseek(f,bytes_shift,'bof'); % move to next interleaved
@ -100,15 +101,14 @@ function [navSolutions] = gps_l1_ca_pvt_read_pvt_dump (filename, count)
bytes_shift=bytes_shift+double_size_bytes; bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved fseek(f,bytes_shift,'bof'); % move to next interleaved
fclose (f); fclose (f);
end end
navSolutions.X=ECEF_X.';
navSolutions.Y=ECEF_Y.';
navSolutions.Z=ECEF_Z.';
navSolutions.dt=Clock_Offset.';
navSolutions.latitude=Lat.';
navSolutions.longitude=Long.';
navSolutions.height=Height.';
navSolutions.TransmitTime=GPS_current_time.';
navSolutions.X=ECEF_X.';
navSolutions.Y=ECEF_Y.';
navSolutions.Z=ECEF_Z.';
navSolutions.dt=Clock_Offset.';
navSolutions.latitude=Lat.';
navSolutions.longitude=Long.';
navSolutions.height=Height.';
navSolutions.TransmitTime=GPS_current_time.';

View File

@ -1,27 +1,52 @@
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
% Javier Arribas 2011 % Javier Arribas 2011
function [pvt_raw] = gps_l1_ca_read_pvt_raw_dump (channels, filename, count) function [pvt_raw] = gps_l1_ca_read_pvt_raw_dump (channels, filename, count)
%% usage: read_tracking_dat (filename, [count]) %% usage: read_tracking_dat (filename, [count])
%% %%
%% open GNSS-SDR pvt binary log file .dat and return the contents %% open GNSS-SDR pvt binary log file .dat and return the contents
%% %%
m = nargchk (1,2,nargin); m = nargchk (1,2,nargin);
num_double_vars=3; num_double_vars=3;
double_size_bytes=8; double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars*channels; skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
bytes_shift=0; bytes_shift=0;
if (m) if (m)
usage (m); usage (m);
end end
if (nargin < 3) if (nargin < 3)
count = Inf; count = Inf;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
for N=1:1:channels for N=1:1:channels
pvt_raw.Pseudorange_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); pvt_raw.Pseudorange_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes; bytes_shift=bytes_shift+double_size_bytes;
@ -37,13 +62,13 @@ function [pvt_raw] = gps_l1_ca_read_pvt_raw_dump (channels, filename, count)
fclose (f); fclose (f);
%%%%%%%% output vars %%%%%%%% %%%%%%%% output vars %%%%%%%%
% for (unsigned int i=0; i<d_nchannels ; i++) % for (unsigned int i=0; i<d_nchannels ; i++)
% { % {
% tmp_double = in[i][0].Pseudorange_m; % tmp_double = in[i][0].Pseudorange_m;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = in[i][0].Pseudorange_symbol_shift; % tmp_double = in[i][0].Pseudorange_symbol_shift;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% d_dump_file.write((char*)&d_tx_time, sizeof(double)); % d_dump_file.write((char*)&d_tx_time, sizeof(double));
% } % }
end end

View File

@ -1,27 +1,52 @@
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
% Javier Arribas 2011 % Javier Arribas 2011
function [telemetry] = gps_l1_ca_read_telemetry_dump (filename, count) function [telemetry] = gps_l1_ca_read_telemetry_dump (filename, count)
%% usage: read_tracking_dat (filename, [count]) %% usage: read_tracking_dat (filename, [count])
%% %%
%% open GNSS-SDR tracking binary log file .dat and return the contents %% open GNSS-SDR tracking binary log file .dat and return the contents
%% %%
m = nargchk (1,2,nargin); m = nargchk (1,2,nargin);
num_double_vars=3; num_double_vars=3;
double_size_bytes=8; double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars; skip_bytes_each_read=double_size_bytes*num_double_vars;
bytes_shift=0; bytes_shift=0;
if (m) if (m)
usage (m); usage (m);
end end
if (nargin < 3) if (nargin < 3)
count = Inf; count = Inf;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
telemetry.preamble_delay_ms = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); telemetry.preamble_delay_ms = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes; bytes_shift=bytes_shift+double_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved fseek(f,bytes_shift,'bof'); % move to next interleaved
@ -35,14 +60,14 @@ function [telemetry] = gps_l1_ca_read_telemetry_dump (filename, count)
fclose (f); fclose (f);
%%%%%%%% output vars %%%%%%%% %%%%%%%% output vars %%%%%%%%
% { % {
% double tmp_double; % double tmp_double;
% tmp_double = current_synchro_data.Preamble_delay_ms; % tmp_double = current_synchro_data.Preamble_delay_ms;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_synchro_data.Prn_delay_ms; % tmp_double = current_synchro_data.Prn_delay_ms;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_synchro_data.Preamble_symbol_counter; % tmp_double = current_synchro_data.Preamble_symbol_counter;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% } % }
end end

View File

@ -1,42 +1,8 @@
% /*! % Function plots variations of coordinates over time and a 3D position
% * \file plotNavigation.m
% * \brief
% Functions plots variations of coordinates over time and a 3D position
% plot. It plots receiver coordinates in UTM system or coordinate offsets if % plot. It plots receiver coordinates in UTM system or coordinate offsets if
% the true UTM receiver coordinates are provided. % the true UTM receiver coordinates are provided.
% * \author Darius Plausinaitis
% * Modified by Javier Arribas, 2011. jarribas(at)cttc.es
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function plotNavigation(navSolutions, settings,plot_skyplot)
%Functions plots variations of coordinates over time and a 3D position
%plot. It plots receiver coordinates in UTM system or coordinate offsets if
%the true UTM receiver coordinates are provided.
% %
%plotNavigation(navSolutions, settings) % plotNavigation(navSolutions, settings)
% %
% Inputs: % Inputs:
% navSolutions - Results from navigation solution function. It % navSolutions - Results from navigation solution function. It
@ -47,6 +13,36 @@ function plotNavigation(navSolutions, settings,plot_skyplot)
% plot_skyplot - If ==1 then use satellite coordinates to plot the % plot_skyplot - If ==1 then use satellite coordinates to plot the
% the satellite positions % the satellite positions
% Darius Plausinaitis
% Modified by Javier Arribas, 2011. jarribas(at)cttc.es
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
function plotNavigation(navSolutions, settings,plot_skyplot)
%% Plot results in the necessary data exists ============================== %% Plot results in the necessary data exists ==============================
if (~isempty(navSolutions)) if (~isempty(navSolutions))
@ -67,11 +63,11 @@ if (~isempty(navSolutions))
meanLatitude = dms2mat(deg2dms(... meanLatitude = dms2mat(deg2dms(...
mean(navSolutions.latitude(~isnan(navSolutions.latitude)))), -5); mean(navSolutions.latitude(~isnan(navSolutions.latitude)))), -5);
LatLong_str=[num2str(meanLatitude(1)), 'º', ... LatLong_str=[num2str(meanLatitude(1)), '??', ...
num2str(meanLatitude(2)), '''', ... num2str(meanLatitude(2)), '''', ...
num2str(meanLatitude(3)), '''''', ... num2str(meanLatitude(3)), '''''', ...
',', ... ',', ...
num2str(meanLongitude(1)), 'º', ... num2str(meanLongitude(1)), '??', ...
num2str(meanLongitude(2)), '''', ... num2str(meanLongitude(2)), '''', ...
num2str(meanLongitude(3)), ''''''] num2str(meanLongitude(3)), '''''']
@ -118,7 +114,7 @@ if (~isempty(navSolutions))
handles(3, 1) = subplot(4, 2, [5, 7]); handles(3, 1) = subplot(4, 2, [5, 7]);
handles(3, 2) = subplot(4, 2, [6, 8]); handles(3, 2) = subplot(4, 2, [6, 8]);
%% Plot all figures ======================================================= %% Plot all figures =======================================================
%--- Coordinate differences in UTM system ----------------------------- %--- Coordinate differences in UTM system -----------------------------
plot(handles(1, 1), [(navSolutions.E - refCoord.E)', ... plot(handles(1, 1), [(navSolutions.E - refCoord.E)', ...

View File

@ -1,7 +1,7 @@
function plotTracking(channelList, trackResults, settings) function plotTracking(channelList, trackResults, settings)
%This function plots the tracking results for the given channel list. % This function plots the tracking results for the given channel list.
% %
%plotTracking(channelList, trackResults, settings) % plotTracking(channelList, trackResults, settings)
% %
% Inputs: % Inputs:
% channelList - list of channels to be plotted. % channelList - list of channels to be plotted.
@ -30,8 +30,6 @@ function plotTracking(channelList, trackResults, settings)
%USA. %USA.
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
%CVS record:
%$Id: plotTracking.m,v 1.5.2.23 2006/08/14 14:45:14 dpl Exp $
% Protection - if the list contains incorrect channel numbers % Protection - if the list contains incorrect channel numbers
channelList = intersect(channelList, 1:settings.numberOfChannels); channelList = intersect(channelList, 1:settings.numberOfChannels);
@ -39,7 +37,7 @@ channelList = intersect(channelList, 1:settings.numberOfChannels);
%=== For all listed channels ============================================== %=== For all listed channels ==============================================
for channelNr = channelList for channelNr = channelList
%% Select (or create) and clear the figure ================================ %% Select (or create) and clear the figure ================================
% The number 200 is added just for more convenient handling of the open % The number 200 is added just for more convenient handling of the open
% figure windows, when many figures are closed and reopened. % figure windows, when many figures are closed and reopened.
% Figures drawn or opened by the user, will not be "overwritten" by % Figures drawn or opened by the user, will not be "overwritten" by
@ -52,7 +50,7 @@ for channelNr = channelList
num2str(trackResults(channelNr).PRN(end-1)), ... num2str(trackResults(channelNr).PRN(end-1)), ...
') results']); ') results']);
%% Draw axes ============================================================== %% Draw axes ==============================================================
% Row 1 % Row 1
handles(1, 1) = subplot(4, 3, 1); handles(1, 1) = subplot(4, 3, 1);
handles(1, 2) = subplot(4, 3, [2 3]); handles(1, 2) = subplot(4, 3, [2 3]);
@ -69,7 +67,7 @@ for channelNr = channelList
handles(4, 3) = subplot(4, 3, 12); handles(4, 3) = subplot(4, 3, 12);
%% Plot all figures ======================================================= %% Plot all figures =======================================================
timeAxisInSeconds = (1:settings.msToProcess)/1000; timeAxisInSeconds = (1:settings.msToProcess)/1000;

View File

@ -1,7 +1,7 @@
function plotVEMLTracking(channelList, trackResults, settings) function plotVEMLTracking(channelList, trackResults, settings)
%This function plots the tracking results for the given channel list. % This function plots the tracking results for the given channel list.
% %
%plotTracking(channelList, trackResults, settings) % plotTracking(channelList, trackResults, settings)
% %
% Inputs: % Inputs:
% channelList - list of channels to be plotted. % channelList - list of channels to be plotted.
@ -30,16 +30,13 @@ function plotVEMLTracking(channelList, trackResults, settings)
%USA. %USA.
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
%CVS record:
%$Id: plotTracking.m,v 1.5.2.23 2006/08/14 14:45:14 dpl Exp $
% Protection - if the list contains incorrect channel numbers % Protection - if the list contains incorrect channel numbers
channelList = intersect(channelList, 1:settings.numberOfChannels); channelList = intersect(channelList, 1:settings.numberOfChannels);
%=== For all listed channels ============================================== %=== For all listed channels ==============================================
for channelNr = channelList for channelNr = channelList
%% Select (or create) and clear the figure ================================ %% Select (or create) and clear the figure ================================
% The number 200 is added just for more convenient handling of the open % The number 200 is added just for more convenient handling of the open
% figure windows, when many figures are closed and reopened. % figure windows, when many figures are closed and reopened.
% Figures drawn or opened by the user, will not be "overwritten" by % Figures drawn or opened by the user, will not be "overwritten" by
@ -52,7 +49,7 @@ for channelNr = channelList
num2str(trackResults(channelNr).PRN(end-1)), ... num2str(trackResults(channelNr).PRN(end-1)), ...
') results']); ') results']);
%% Draw axes ============================================================== %% Draw axes ==============================================================
% Row 1 % Row 1
handles(1, 1) = subplot(3, 3, 1); handles(1, 1) = subplot(3, 3, 1);
handles(1, 2) = subplot(3, 3, [2 3]); handles(1, 2) = subplot(3, 3, [2 3]);
@ -64,7 +61,7 @@ for channelNr = channelList
handles(3, 2) = subplot(3, 3, 8); handles(3, 2) = subplot(3, 3, 8);
handles(3, 3) = subplot(3, 3, 9); handles(3, 3) = subplot(3, 3, 9);
%% Plot all figures ======================================================= %% Plot all figures =======================================================
timeAxisInSeconds = (1:4:settings.msToProcess)/1000; timeAxisInSeconds = (1:4:settings.msToProcess)/1000;

View File

@ -1,50 +1,54 @@
% Usage: read_complex_binary (filename, [count], [start_sample])
% %
% Copyright 2001 Free Software Foundation, Inc. % Opens filename and returns the contents as a column vector,
% treating them as 32 bit complex numbers
% %
% This file is part of GNU Radio
% -------------------------------------------------------------------------
% %
% GNU Radio is free software; you can redistribute it and/or modify % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by % it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3, or (at your option) % the Free Software Foundation, either version 3 of the License, or
% any later version. % at your option) any later version.
% %
% GNU Radio is distributed in the hope that it will be useful, % GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of % but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details. % GNU General Public License for more details.
% %
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with GNU Radio; see the file COPYING. If not, write to % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% the Free Software Foundation, Inc., 51 Franklin Street, %
% Boston, MA 02110-1301, USA. % -------------------------------------------------------------------------
% %
function v = read_complex_binary (filename, count, start_sample) function v = read_complex_binary (filename, count, start_sample)
%% usage: read_complex_binary (filename, [count], [start_sample]) m = nargchk (1,2,nargin);
%% if (m)
%% open filename and return the contents as a column vector,
%% treating them as 32 bit complex numbers
%%
m = nargchk (1,2,nargin);
if (m)
%usage (m); %usage (m);
end end
if (nargin < 2) if (nargin < 2)
count = Inf; count = Inf;
start_sample=0; start_sample=0;
end end
if (nargin < 3) if (nargin < 3)
start_sample=0; start_sample=0;
end end
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
v = 0; v = 0;
else else
if (start_sample>0) if (start_sample>0)
bytes_per_sample=4; bytes_per_sample=4;
fseek(f,start_sample*bytes_per_sample,'bof'); fseek(f,start_sample*bytes_per_sample,'bof');
@ -54,4 +58,4 @@ function v = read_complex_binary (filename, count, start_sample)
v = t(1,:) + t(2,:)*i; v = t(1,:) + t(2,:)*i;
[r, c] = size (v); [r, c] = size (v);
v = reshape (v, c, r); v = reshape (v, c, r);
end end

View File

@ -1,48 +1,52 @@
% Usage: read_complex_binary (filename, [count])
% %
% Copyright 2001 Free Software Foundation, Inc. % Opens filename and returns the contents as a column vector,
% treating them as 32 bit complex numbers
% %
% This file is part of GNU Radio
% -------------------------------------------------------------------------
% %
% GNU Radio is free software; you can redistribute it and/or modify % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by % it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3, or (at your option) % the Free Software Foundation, either version 3 of the License, or
% any later version. % at your option) any later version.
% %
% GNU Radio is distributed in the hope that it will be useful, % GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of % but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details. % GNU General Public License for more details.
% %
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with GNU Radio; see the file COPYING. If not, write to % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% the Free Software Foundation, Inc., 51 Franklin Street, %
% Boston, MA 02110-1301, USA. % -------------------------------------------------------------------------
% %
function v = read_complex_char_binary (filename, count) function v = read_complex_char_binary (filename, count)
%% usage: read_complex_binary (filename, [count]) m = nargchk (1,2,nargin);
%% if (m)
%% open filename and return the contents as a column vector,
%% treating them as 32 bit complex numbers
%%
m = nargchk (1,2,nargin);
if (m)
usage (m); usage (m);
end end
if (nargin < 2) if (nargin < 2)
count = Inf; count = Inf;
end end
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
v = 0; v = 0;
else else
t = fread (f, [2, count], 'int8'); t = fread (f, [2, count], 'int8');
fclose (f); fclose (f);
v = t(1,:) + t(2,:)*i; v = t(1,:) + t(2,:)*i;
[r, c] = size (v); [r, c] = size (v);
v = reshape (v, c, r); v = reshape (v, c, r);
end end

View File

@ -1,48 +1,52 @@
% Usage: read_complex_binary (filename, [count])
% %
% Copyright 2001 Free Software Foundation, Inc. % Opens filename and returns the contents as a column vector,
% treating them as 32 bit complex numbers
% %
% This file is part of GNU Radio
% -------------------------------------------------------------------------
% %
% GNU Radio is free software; you can redistribute it and/or modify % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by % it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3, or (at your option) % the Free Software Foundation, either version 3 of the License, or
% any later version. % at your option) any later version.
% %
% GNU Radio is distributed in the hope that it will be useful, % GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of % but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details. % GNU General Public License for more details.
% %
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with GNU Radio; see the file COPYING. If not, write to % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% the Free Software Foundation, Inc., 51 Franklin Street, %
% Boston, MA 02110-1301, USA. % -------------------------------------------------------------------------
% %
function v = read_complex_short_binary (filename, count) function v = read_complex_short_binary (filename, count)
%% usage: read_complex_binary (filename, [count]) m = nargchk (1,2,nargin);
%% if (m)
%% open filename and return the contents as a column vector,
%% treating them as 32 bit complex numbers
%%
m = nargchk (1,2,nargin);
if (m)
usage (m); usage (m);
end end
if (nargin < 2) if (nargin < 2)
count = Inf; count = Inf;
end end
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
v = 0; v = 0;
else else
t = fread (f, [2, count], 'short'); t = fread (f, [2, count], 'short');
fclose (f); fclose (f);
v = t(1,:) + t(2,:)*i; v = t(1,:) + t(2,:)*i;
[r, c] = size (v); [r, c] = size (v);
v = reshape (v, c, r); v = reshape (v, c, r);
end end

View File

@ -1,27 +1,52 @@
% Usage: read_tracking_dat (filename, [count])
%
% Opens GNSS-SDR tracking binary log file .dat and returns the contents
%
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
% Javier Arribas 2011 % Javier Arribas 2011
function [observables] = read_hybrid_observables_dump (channels, filename, count) function [observables] = read_hybrid_observables_dump (channels, filename, count)
%% usage: read_tracking_dat (filename, [count]) m = nargchk (1,2,nargin);
%% num_double_vars=7;
%% open GNSS-SDR tracking binary log file .dat and return the contents double_size_bytes=8;
%% skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
bytes_shift=0;
m = nargchk (1,2,nargin); if (m)
num_double_vars=7;
double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
bytes_shift=0;
if (m)
usage (m); usage (m);
end end
if (nargin < 3) if (nargin < 3)
count = Inf; count = Inf;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
for N=1:1:channels for N=1:1:channels
observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes; bytes_shift=bytes_shift+double_size_bytes;
@ -49,23 +74,23 @@ function [observables] = read_hybrid_observables_dump (channels, filename, count
fclose (f); fclose (f);
%%%%%%%% output vars %%%%%%%% %%%%%%%% output vars %%%%%%%%
% double tmp_double; % double tmp_double;
% for (unsigned int i = 0; i < d_nchannels; i++) % for (unsigned int i = 0; i < d_nchannels; i++)
% { % {
% tmp_double = current_gnss_synchro[i].RX_time; % tmp_double = current_gnss_synchro[i].RX_time;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s; % tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_s;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz; % tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].Carrier_phase_rads/GPS_TWO_PI; % tmp_double = current_gnss_synchro[i].Carrier_phase_rads/GPS_TWO_PI;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].Pseudorange_m; % tmp_double = current_gnss_synchro[i].Pseudorange_m;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].PRN; % tmp_double = current_gnss_synchro[i].PRN;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% tmp_double = current_gnss_synchro[i].Flag_valid_pseudorange; % tmp_double = current_gnss_synchro[i].Flag_valid_pseudorange;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
% } % }
end end

View File

@ -1,29 +1,54 @@
% Usage: read_true_sim_observables_dump (filename, [count])
%
% Opens gnss-sdr-sim observables dump and reads all chennels
%
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
%
% Javier Arribas 2011 % Javier Arribas 2011
function [observables] = read_true_sim_observables_dump (filename, count) function [observables] = read_true_sim_observables_dump (filename, count)
%% usage: read_true_sim_observables_dump (filename, [count]) m = nargchk (1,2,nargin);
%% channels=12; %Simulator always use 12 channels
%% open gnss-sdr-sim observables dump and read all chennels num_double_vars=7;
%% double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
bytes_shift=0;
m = nargchk (1,2,nargin); if (m)
channels=12; %Simulator always use 12 channels
num_double_vars=7;
double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
bytes_shift=0;
if (m)
usage (m); usage (m);
end end
if (nargin < 2) if (nargin < 2)
count = Inf; count = Inf;
end end
%loops_counter = fread (f, count, 'uint32',4*12); %loops_counter = fread (f, count, 'uint32',4*12);
f = fopen (filename, 'rb'); f = fopen (filename, 'rb');
if (f < 0) if (f < 0)
else else
for N=1:1:channels for N=1:1:channels
observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
bytes_shift=bytes_shift+double_size_bytes; bytes_shift=bytes_shift+double_size_bytes;
@ -50,16 +75,16 @@ function [observables] = read_true_sim_observables_dump (filename, count)
fclose (f); fclose (f);
% %%%%%%%% output vars %%%%%%%% % %%%%%%%% output vars %%%%%%%%
% for(int i=0;i<12;i++) % for(int i=0;i<12;i++)
% { % {
% d_dump_file.read((char *) &gps_time_sec[i], sizeof(double)); % d_dump_file.read((char *) &gps_time_sec[i], sizeof(double));
% d_dump_file.read((char *) &doppler_l1_hz, sizeof(double)); % d_dump_file.read((char *) &doppler_l1_hz, sizeof(double));
% d_dump_file.read((char *) &acc_carrier_phase_l1_cycles[i], sizeof(double)); % d_dump_file.read((char *) &acc_carrier_phase_l1_cycles[i], sizeof(double));
% d_dump_file.read((char *) &dist_m[i], sizeof(double)); % d_dump_file.read((char *) &dist_m[i], sizeof(double));
% d_dump_file.read((char *) &true_dist_m[i], sizeof(double)); % d_dump_file.read((char *) &true_dist_m[i], sizeof(double));
% d_dump_file.read((char *) &carrier_phase_l1_cycles[i], sizeof(double)); % d_dump_file.read((char *) &carrier_phase_l1_cycles[i], sizeof(double));
% d_dump_file.read((char *) &prn[i], sizeof(double)); % d_dump_file.read((char *) &prn[i], sizeof(double));
% } % }
end end

View File

@ -1,7 +1,7 @@
function plotTracking(channelList, trackResults, settings) function plotTracking(channelList, trackResults, settings)
%This function plots the tracking results for the given channel list. % This function plots the tracking results for the given channel list.
% %
%plotTracking(channelList, trackResults, settings) % plotTracking(channelList, trackResults, settings)
% %
% Inputs: % Inputs:
% channelList - list of channels to be plotted. % channelList - list of channels to be plotted.
@ -14,32 +14,29 @@ function plotTracking(channelList, trackResults, settings)
% Copyright (C) Darius Plausinaitis % Copyright (C) Darius Plausinaitis
% Written by Darius Plausinaitis % Written by Darius Plausinaitis
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
%This program is free software; you can redistribute it and/or % This program is free software; you can redistribute it and/or
%modify it under the terms of the GNU General Public License % modify it under the terms of the GNU General Public License
%as published by the Free Software Foundation; either version 2 % as published by the Free Software Foundation; either version 2
%of the License, or (at your option) any later version. % of the License, or (at your option) any later version.
% %
%This program is distributed in the hope that it will be useful, % This program is distributed in the hope that it will be useful,
%but WITHOUT ANY WARRANTY; without even the implied warranty of % but WITHOUT ANY WARRANTY; without even the implied warranty of
%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%GNU General Public License for more details. % GNU General Public License for more details.
% %
%You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
%along with this program; if not, write to the Free Software % along with this program; if not, write to the Free Software
%Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
%USA. % USA.
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
%CVS record:
%$Id: plotTracking.m,v 1.5.2.23 2006/08/14 14:45:14 dpl Exp $
% Protection - if the list contains incorrect channel numbers % Protection - if the list contains incorrect channel numbers
channelList = intersect(channelList, 1:settings.numberOfChannels); channelList = intersect(channelList, 1:settings.numberOfChannels);
%=== For all listed channels ============================================== %=== For all listed channels ==============================================
for channelNr = channelList for channelNr = channelList
%% Select (or create) and clear the figure ================================ %% Select (or create) and clear the figure ================================
% The number 200 is added just for more convenient handling of the open % The number 200 is added just for more convenient handling of the open
% figure windows, when many figures are closed and reopened. % figure windows, when many figures are closed and reopened.
% Figures drawn or opened by the user, will not be "overwritten" by % Figures drawn or opened by the user, will not be "overwritten" by
@ -52,7 +49,7 @@ for channelNr = channelList
num2str(trackResults(channelNr).PRN), ... num2str(trackResults(channelNr).PRN), ...
') results']); ') results']);
%% Draw axes ============================================================== %% Draw axes ==============================================================
% Row 1 % Row 1
handles(1, 1) = subplot(3, 3, 1); handles(1, 1) = subplot(3, 3, 1);
handles(1, 2) = subplot(3, 3, [2 3]); handles(1, 2) = subplot(3, 3, [2 3]);
@ -64,7 +61,7 @@ for channelNr = channelList
handles(3, 2) = subplot(3, 3, 8); handles(3, 2) = subplot(3, 3, 8);
handles(3, 3) = subplot(3, 3, 9); handles(3, 3) = subplot(3, 3, 9);
%% Plot all figures ======================================================= %% Plot all figures =======================================================
timeAxisInSeconds = (1:settings.msToProcess-1)/1000; timeAxisInSeconds = (1:settings.msToProcess-1)/1000;

View File

@ -1,36 +1,32 @@
% /*! % Reads GNSS-SDR Acquisition dump .mat file using the provided
% * \file plot_acq_grid.m % function and plots acquisition grid of acquisition statistic of PRN sat
% * \brief Read GNSS-SDR Acquisition dump .mat file using the provided % Antonio Ramos, 2017. antonio.ramos(at)cttc.es
% function and plot acquisition grid of acquisition statistic of PRN sat % -------------------------------------------------------------------------
% %
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
% %
% * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
%%%%%%%%% ¡¡¡ CONFIGURE !!! %%%%%%%%%%%%% %%%%%%%%% ?????? CONFIGURE !!! %%%%%%%%%%%%%
path = '/archive/'; path = '/archive/';
file = 'acq'; file = 'acq';

View File

@ -1,37 +1,35 @@
% /*! % Reads GNSS-SDR Acquisition dump binary file using the provided
% * \file plot_acq_grid_gsoc.m % function and plots acquisition grid of acquisition statistic of PRN sat
% * \brief Read GNSS-SDR Acquisition dump binary file using the provided
% function and plot acquisition grid of acquisition statistic of PRN sat
% %
% This function analyzes a experiment performed by Luis Esteve in the framework % This function analyzes a experiment performed by Luis Esteve in the framework
% of the Google Summer of Code (GSoC) 2012, with the collaboration of Javier Arribas % of the Google Summer of Code (GSoC) 2012, with the collaboration of Javier Arribas
% and Carles Fernández, related to the extension of GNSS-SDR to Galileo. % and Carles Fern??ndez, related to the extension of GNSS-SDR to Galileo.
%
% Luis Esteve, 2012. luis(at)epsilon-formacion.com
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
% %
% * \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function plot_acq_grid_gsoc(sat) function plot_acq_grid_gsoc(sat)
@ -61,7 +59,7 @@ for k=Doppler_min_Hz:Doppler_step_Hz:Doppler_max_Hz
index=index+1; index=index+1;
filename=['test_statistics_E_1C_sat_' num2str(sat) '_doppler_' num2str(k) '.dat']; filename=['test_statistics_E_1C_sat_' num2str(sat) '_doppler_' num2str(k) '.dat'];
acq_grid(index,:)=abs(read_complex_binary (filename)); acq_grid(index,:)=abs(read_complex_binary (filename));
end end
maximum_correlation_peak = max(max(acq_grid)) maximum_correlation_peak = max(max(acq_grid))

View File

@ -1,39 +1,38 @@
% /*! % Reads GNSS-SDR Acquisition dump binary file using the provided
% * \file plot_acq_grid_gsoc_e5.m
% * \brief Read GNSS-SDR Acquisition dump binary file using the provided
% function and plot acquisition grid of acquisition statistic of PRN sat. % function and plot acquisition grid of acquisition statistic of PRN sat.
% CAF input must be 0 or 1 depending if the user desires to read the file % CAF input must be 0 or 1 depending if the user desires to read the file
% that resolves doppler ambiguity or not. % that resolves doppler ambiguity or not.
% %
% This function analyzes a experiment performed by Marc Sales in the framework % This function analyzes a experiment performed by Marc Sales in the framework
% of the Google Summer of Code (GSoC) 2014, with the collaboration of Luis Esteve, Javier Arribas % of the Google Summer of Code (GSoC) 2014, with the collaboration of Luis Esteve, Javier Arribas
% and Carles Fernández, related to the extension of GNSS-SDR to Galileo. % and Carles Fernandez, related to the extension of GNSS-SDR to Galileo.
%
% Marc Sales marcsales92(at)gmail.com,
% Luis Esteve, 2014. luis(at)epsilon-formacion.com
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
% %
% * \author Marc Sales marcsales92(at)gmail.com, Luis Esteve, 2014. luis(at)epsilon-formacion.com
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2014 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function plot_acq_grid_gsoc_e5(sat,CAF) function plot_acq_grid_gsoc_e5(sat,CAF)

View File

@ -1,37 +1,34 @@
% /*! % Reads GNSS-SDR Acquisition dump binary file using the provided
% * \file plot_acq_grid_gsoc.m % function and plots acquisition grid of acquisition statistic of PRN sat
% * \brief Read GNSS-SDR Acquisition dump binary file using the provided
% function and plot acquisition grid of acquisition statistic of PRN sat
% %
% This function analyzes a experiment performed by Luis Esteve in the framework % This function analyzes a experiment performed by Luis Esteve in the framework
% of the Google Summer of Code (GSoC) 2012, with the collaboration of Javier Arribas % of the Google Summer of Code (GSoC) 2012, with the collaboration of Javier Arribas
% and Carles Fernández, related to the extension of GNSS-SDR to Galileo. % and Carles Fernandez, related to the extension of GNSS-SDR to Galileo.
%
% -------------------------------------------------------------------------
%
% Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
%
% GNSS-SDR is a software defined Global Navigation
% Satellite Systems receiver
%
% This file is part of GNSS-SDR.
%
% GNSS-SDR is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% at your option) any later version.
%
% GNSS-SDR is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
%
% -------------------------------------------------------------------------
% %
% * \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
% * -------------------------------------------------------------------------
% *
% * Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
% *
% * GNSS-SDR is a software defined Global Navigation
% * Satellite Systems receiver
% *
% * This file is part of GNSS-SDR.
% *
% * GNSS-SDR is free software: you can redistribute it and/or modify
% * it under the terms of the GNU General Public License as published by
% * the Free Software Foundation, either version 3 of the License, or
% * at your option) any later version.
% *
% * GNSS-SDR is distributed in the hope that it will be useful,
% * but WITHOUT ANY WARRANTY; without even the implied warranty of
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * GNU General Public License for more details.
% *
% * You should have received a copy of the GNU General Public License
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
function plot_acq_grid_gsoc_glonass(sat) function plot_acq_grid_gsoc_glonass(sat)
@ -62,9 +59,9 @@ for k=Doppler_min_Hz:Doppler_step_Hz:Doppler_max_Hz
index=index+1; index=index+1;
filename=['acquisition_R_1G_sat_' num2str(sat) '_doppler_' num2str(k) '.dat']; filename=['acquisition_R_1G_sat_' num2str(sat) '_doppler_' num2str(k) '.dat'];
acq_grid(index,:)=abs(read_complex_binary (filename)); acq_grid(index,:)=abs(read_complex_binary (filename));
end end
acq_grid = acq_grid.^2; acq_grid = acq_grid.^2;
maximum_correlation_peak = max(max(acq_grid)) maximum_correlation_peak = max(max(acq_grid))

View File

@ -1,32 +1,28 @@
% /*! % -------------------------------------------------------------------------
% * \file plot_dump.m %
% * \brief Read GNSS-SDR Tracking dump binary file and plot some internal % Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
% variables %
% * \author Antonio Ramos, 2018. antonio.ramos(at)cttc.es % GNSS-SDR is a software defined Global Navigation
% * ------------------------------------------------------------------------- % Satellite Systems receiver
% * %
% * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) % This file is part of GNSS-SDR.
% * %
% * GNSS-SDR is a software defined Global Navigation % GNSS-SDR is free software: you can redistribute it and/or modify
% * Satellite Systems receiver % it under the terms of the GNU General Public License as published by
% * % the Free Software Foundation, either version 3 of the License, or
% * This file is part of GNSS-SDR. % at your option) any later version.
% * %
% * GNSS-SDR is free software: you can redistribute it and/or modify % GNSS-SDR is distributed in the hope that it will be useful,
% * it under the terms of the GNU General Public License as published by % but WITHOUT ANY WARRANTY; without even the implied warranty of
% * the Free Software Foundation, either version 3 of the License, or % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% * at your option) any later version. % GNU General Public License for more details.
% * %
% * GNSS-SDR is distributed in the hope that it will be useful, % You should have received a copy of the GNU General Public License
% * but WITHOUT ANY WARRANTY; without even the implied warranty of % along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% * GNU General Public License for more details. % -------------------------------------------------------------------------
% * %
% * You should have received a copy of the GNU General Public License % Antonio Ramos, 2018. antonio.ramos(at)cttc.es
% * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
% *
% * -------------------------------------------------------------------------
% */
clear all; clear all;
clc; clc;
@ -84,158 +80,136 @@ end
fclose(fileID); fclose(fileID);
mean_Latitude=mean(navsol.lat); mean_Latitude = mean(navsol.lat);
mean_Longitude=mean(navsol.long); mean_Longitude = mean(navsol.long);
mean_h=mean(navsol.height); mean_h = mean(navsol.height);
utmZone = findUtmZone(mean_Latitude,mean_Longitude); utmZone = findUtmZone(mean_Latitude, mean_Longitude);
[ref_X_cart,ref_Y_cart,ref_Z_cart]=geo2cart(dms2mat(deg2dms(mean_Latitude)), dms2mat(deg2dms(mean_Longitude)), mean_h, 5); [ref_X_cart, ref_Y_cart, ref_Z_cart] = geo2cart(dms2mat(deg2dms(mean_Latitude)), dms2mat(deg2dms(mean_Longitude)), mean_h, 5);
[mean_utm_X,mean_utm_Y,mean_utm_Z]=cart2utm(ref_X_cart,ref_Y_cart,ref_Z_cart,utmZone); [mean_utm_X, mean_utm_Y, mean_utm_Z] = cart2utm(ref_X_cart, ref_Y_cart, ref_Z_cart, utmZone);
numPoints=length(navsol.X); numPoints = length(navsol.X);
aux=0; aux = 0;
for n=1:numPoints for n = 1:numPoints
aux=aux+1; aux = aux+1;
[E(aux),N(aux),U(aux)]=cart2utm(navsol.X(n), navsol.Y(n), navsol.Z(n), utmZone); [E(aux), N(aux), U(aux)] = cart2utm(navsol.X(n), navsol.Y(n), navsol.Z(n), utmZone);
end end
v_2d=[E;N].'; %2D East Nort position vectors v_2d = [E;N].'; % 2D East Nort position vectors
v_3d=[E;N;U].'; %2D East Nort position vectors v_3d = [E;N;U].'; % 2D East Nort position vectors
%% ACCURACY %% ACCURACY
% 2D ------------------- % 2D -------------------
sigma_E_accuracy=sqrt((1/(numPoints-1))*sum((v_2d(:,1)-mean_utm_X).^2)); sigma_E_accuracy = sqrt((1/(numPoints-1)) * sum((v_2d(:,1) - mean_utm_X).^2));
sigma_N_accuracy=sqrt((1/(numPoints-1))*sum((v_2d(:,2)-mean_utm_Y).^2)); sigma_N_accuracy = sqrt((1/(numPoints-1)) * sum((v_2d(:,2) - mean_utm_Y).^2));
sigma_ratio_2d_accuracy = sigma_N_accuracy / sigma_E_accuracy
sigma_ratio_2d_accuracy=sigma_N_accuracy/sigma_E_accuracy
% if sigma_ratio=1 -> Prob in circle with r=DRMS -> 65% % if sigma_ratio=1 -> Prob in circle with r=DRMS -> 65%
DRMS_accuracy=sqrt(sigma_E_accuracy^2+sigma_N_accuracy^2) DRMS_accuracy = sqrt(sigma_E_accuracy^2 + sigma_N_accuracy^2)
% if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95% % if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95%
TWO_DRMS_accuracy=2*DRMS_accuracy TWO_DRMS_accuracy = 2 * DRMS_accuracy
% if sigma_ratio>0.3 -> Prob in circle with r=CEP -> 50% % if sigma_ratio>0.3 -> Prob in circle with r=CEP -> 50%
CEP_accuracy=0.62*sigma_E_accuracy+0.56*sigma_N_accuracy CEP_accuracy = 0.62 * sigma_E_accuracy + 0.56 * sigma_N_accuracy
% 3D ------------------- % 3D -------------------
sigma_U_accuracy=sqrt((1/(numPoints-1))*sum((v_3d(:,3)-mean_utm_Z).^2)); sigma_U_accuracy = sqrt((1/(numPoints-1)) * sum((v_3d(:,3) - mean_utm_Z).^2));
% if sigma_ratio=1 -> Prob in circle with r=DRMS -> 50% % if sigma_ratio=1 -> Prob in circle with r=DRMS -> 50%
SEP_accuracy=0.51*sqrt(sigma_E_accuracy^2+sigma_N_accuracy^2+sigma_U_accuracy^2) SEP_accuracy = 0.51 * sqrt(sigma_E_accuracy^2 + sigma_N_accuracy^2 + sigma_U_accuracy^2)
% if sigma_ratio=1 -> Prob in circle with r=DRMS -> 61% % if sigma_ratio=1 -> Prob in circle with r=DRMS -> 61%
MRSE_accuracy=sqrt(sigma_E_accuracy^2+sigma_N_accuracy^2+sigma_U_accuracy^2) MRSE_accuracy = sqrt(sigma_E_accuracy^2 + sigma_N_accuracy^2 + sigma_U_accuracy^2)
% if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95% % if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95%
TWO_MRSE_accuracy=2*MRSE_accuracy TWO_MRSE_accuracy=2 * MRSE_accuracy
%% PRECISION %% PRECISION
% 2D analysis
% Simulated X,Y measurements
%v1=randn(1000,2);
% 2D Mean and Variance % 2D Mean and Variance
mean_2d = [mean(v_2d(:,1)) ; mean(v_2d(:,2))]; mean_2d = [mean(v_2d(:,1)) ; mean(v_2d(:,2))];
sigma_2d = [sqrt(var(v_2d(:,1))) ; sqrt(var(v_2d(:,2)))]; sigma_2d = [sqrt(var(v_2d(:,1))) ; sqrt(var(v_2d(:,2)))];
sigma_ratio_2d = sigma_2d(2) / sigma_2d(1)
sigma_ratio_2d=sigma_2d(2)/sigma_2d(1)
% if sigma_ratio=1 -> Prob in circle with r=DRMS -> 65% % if sigma_ratio=1 -> Prob in circle with r=DRMS -> 65%
DRMS=sqrt(sigma_2d(1)^2+sigma_2d(2)^2) DRMS = sqrt(sigma_2d(1)^2 + sigma_2d(2)^2)
% if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95% % if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95%
TWO_DRMS=2*DRMS TWO_DRMS = 2 * DRMS
% if sigma_ratio>0.3 -> Prob in circle with r=CEP -> 50% % if sigma_ratio>0.3 -> Prob in circle with r=CEP -> 50%
CEP=0.62*sigma_2d(1)+0.56*sigma_2d(2) CEP = 0.62 * sigma_2d(1) + 0.56 * sigma_2d(2)
% 3D Mean and Variance
% Mean and Variance mean_3d = [mean(v_3d(:,1)) ; mean(v_3d(:,2)) ; mean(v_3d(:,3))];
mean_3d=[mean(v_3d(:,1)) ; mean(v_3d(:,2)) ; mean(v_3d(:,3))]; sigma_3d = [sqrt(var(v_3d(:,1))) ; sqrt(var(v_3d(:,2))) ; sqrt(var(v_3d(:,3)))];
sigma_3d=[sqrt(var(v_3d(:,1))) ; sqrt(var(v_3d(:,2))) ; sqrt(var(v_3d(:,3)))];
% absolute mean error % absolute mean error
% 2D error_2D_vec = [mean_utm_X-mean_2d(1) mean_utm_Y-mean_2d(2)];
error_2D_m = norm(error_2D_vec)
error_2D_vec=[mean_utm_X-mean_2d(1) mean_utm_Y-mean_2d(2)]; error_3D_vec = [mean_utm_X-mean_3d(1) mean_utm_Y-mean_3d(2) mean_utm_Z-mean_3d(3)];
error_2D_m=norm(error_2D_vec) error_3D_m = norm(error_3D_vec)
error_3D_vec=[mean_utm_X-mean_3d(1) mean_utm_Y-mean_3d(2) mean_utm_Z-mean_3d(3)]; RMSE_X = sqrt(mean((v_3d(:,1)-mean_utm_X).^2))
error_3D_m=norm(error_3D_vec) RMSE_Y = sqrt(mean((v_3d(:,2)-mean_utm_Y).^2))
RMSE_Z = sqrt(mean((v_3d(:,3)-mean_utm_Z).^2))
% RMSE 2D RMSE_2D = sqrt(mean((v_2d(:,1)-mean_utm_X).^2 + (v_2d(:,2)-mean_utm_Y).^2))
RMSE_3D = sqrt(mean((v_3d(:,1)-mean_utm_X).^2 + (v_3d(:,2)-mean_utm_Y).^2 + (v_3d(:,3)-mean_utm_Z).^2))
RMSE_X=sqrt(mean((v_3d(:,1)-mean_utm_X).^2)) % if sigma_ratio=1 -> Prob in circle with r=DRMS -> 50%
RMSE_Y=sqrt(mean((v_3d(:,2)-mean_utm_Y).^2)) SEP = 0.51 * sqrt(sigma_3d(1)^2 + sigma_3d(2)^2 + sigma_3d(3)^2)
RMSE_Z=sqrt(mean((v_3d(:,3)-mean_utm_Z).^2)) % if sigma_ratio=1 -> Prob in circle with r=DRMS -> 61%
MRSE = sqrt(sigma_3d(1)^2 + sigma_3d(2)^2 + sigma_3d(3)^2)
% if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95%
TWO_MRSE = 2 * MRSE
RMSE_2D=sqrt(mean((v_2d(:,1)-mean_utm_X).^2+(v_2d(:,2)-mean_utm_Y).^2)) %% SCATTER PLOT 2D
RMSE_3D=sqrt(mean((v_3d(:,1)-mean_utm_X).^2+(v_3d(:,2)-mean_utm_Y).^2+(v_3d(:,3)-mean_utm_Z).^2))
% SCATTER PLOT
subplot(3,3,8) subplot(3,3,8)
scatter(v_2d(:,1)-mean_2d(1),v_2d(:,2)-mean_2d(2)); scatter(v_2d(:,1)-mean_2d(1), v_2d(:,2)-mean_2d(2));
hold on; hold on;
plot(0,0,'k*'); plot(0, 0, 'k*');
[x,y,z] = cylinder([TWO_DRMS TWO_DRMS], 200);
plot(x(1,:), y(1,:), 'Color', [0 0.6 0]);
str = strcat('2DRMS=', num2str(TWO_DRMS), ' m');
text(cosd(65)*TWO_DRMS, sind(65)*TWO_DRMS, str, 'Color', [0 0.6 0]);
[x,y,z] = cylinder([TWO_DRMS TWO_DRMS],200); [x,y,z] = cylinder([CEP CEP], 200);
plot(x(1,:),y(1,:),'Color',[0 0.6 0]); plot(x(1,:), y(1,:), 'r--');
str = strcat('2DRMS=',num2str(TWO_DRMS), ' m'); str = strcat('CEP=', num2str(CEP), ' m');
text(cosd(65)*TWO_DRMS,sind(65)*TWO_DRMS,str,'Color',[0 0.6 0]); text(cosd(80)*CEP, sind(80)*CEP, str, 'Color','r');
[x,y,z] = cylinder([CEP CEP],200);
plot(x(1,:),y(1,:),'r--');
str = strcat('CEP=',num2str(CEP), ' m');
text(cosd(80)*CEP,sind(80)*CEP,str,'Color','r');
grid on grid on
axis equal; axis equal;
xlabel('North [m]','fontname','Times','fontsize', fontsize) xlabel('North [m]','fontname','Times','fontsize', fontsize)
ylabel('East [m]','fontname','Times','fontsize', fontsize) ylabel('East [m]','fontname','Times','fontsize', fontsize)
% 3D analysis
% Simulated X,Y,Z measurements
% if sigma_ratio=1 -> Prob in circle with r=DRMS -> 50%
SEP=0.51*sqrt(sigma_3d(1)^2+sigma_3d(2)^2+sigma_3d(3)^2)
% if sigma_ratio=1 -> Prob in circle with r=DRMS -> 61%
MRSE=sqrt(sigma_3d(1)^2+sigma_3d(2)^2+sigma_3d(3)^2)
% if sigma_ratio=1 -> Prob in circle with r=2DRMS -> 95%
TWO_MRSE=2*MRSE
%% SCATTER PLOT 3D
% SCATTER PLOT
subplot(3,3,9) subplot(3,3,9)
scatter3(v_3d(:,1)-mean_3d(1),v_3d(:,2)-mean_3d(2), v_3d(:,3)-mean_3d(3)); scatter3(v_3d(:,1)-mean_3d(1), v_3d(:,2)-mean_3d(2), v_3d(:,3)-mean_3d(3));
hold on; hold on;
[x,y,z] = sphere(); [x,y,z] = sphere();
hSurface=surf(MRSE*x,MRSE*y,MRSE*z); % sphere centered at origin hSurface = surf(MRSE*x, MRSE*y, MRSE*z); % sphere centered at origin
set(hSurface, 'facecolor', 'none', 'edgecolor', [0 0.6 0], 'edgealpha', 1, 'facealpha', 1);
set(hSurface,'facecolor','none','edgecolor',[0 0.6 0],'edgealpha',1,'facealpha',1); xlabel('North [m]', 'fontname', 'Times', 'fontsize', fontsize-2)
ylabel('East [m]', 'fontname', 'Times', 'fontsize', fontsize-2)
zlabel('Up [m]', 'fontname', 'Times', 'fontsize', fontsize-2)
str = strcat('MRSE=', num2str(MRSE), ' m')
text(cosd(45)*MRSE, sind(45)*MRSE, 20, str, 'Color', [0 0.6 0]);
a = gca;
set(a, 'fontsize', fontsize-6)
%axis equal; hh = findall(hf, '-property', 'FontName');
xlabel('North [m]','fontname','Times','fontsize', fontsize-2) set(hh, 'FontName', 'Times');
ylabel('East [m]','fontname','Times','fontsize', fontsize-2)
zlabel('Up [m]','fontname','Times','fontsize', fontsize-2)
str = strcat('MRSE=',num2str(MRSE), ' m')
text(cosd(45)*MRSE,sind(45)*MRSE,20,str,'Color',[0 0.6 0]);
a=gca;
set(a,'fontsize',fontsize-6)
hh=findall(hf,'-property','FontName');
set(hh,'FontName','Times');
print(hf, 'Figure2.eps', '-depsc') print(hf, 'Figure2.eps', '-depsc')
close(hf); close(hf);