1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Cleanup of Matlab/Octave code

This commit is contained in:
Carles Fernandez 2018-03-30 10:33:11 +02:00
parent a2e40eca95
commit 9458fe6e57
32 changed files with 1681 additions and 2027 deletions

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
@ -44,40 +43,40 @@ 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
for N=1:1:channels for N=1:1:channels
trackResults(N).status = 'T'; %fake track trackResults(N).status = 'T'; %fake track
trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.'; trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.'; trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.';
trackResults(N).dllDiscr = GNSS_tracking(N).code_error.'; trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.'; trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.'; trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.'; trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
trackResults(N).I_P = GNSS_tracking(N).P.'; trackResults(N).I_P = GNSS_tracking(N).P.';
trackResults(N).Q_P = zeros(1,length(GNSS_tracking(N).P)); trackResults(N).Q_P = zeros(1,length(GNSS_tracking(N).P));
trackResults(N).I_VE = GNSS_tracking(N).VE.'; trackResults(N).I_VE = GNSS_tracking(N).VE.';
trackResults(N).I_E = GNSS_tracking(N).E.'; trackResults(N).I_E = GNSS_tracking(N).E.';
trackResults(N).I_L = GNSS_tracking(N).L.'; trackResults(N).I_L = GNSS_tracking(N).L.';
trackResults(N).I_VL = GNSS_tracking(N).VL.'; trackResults(N).I_VL = GNSS_tracking(N).VL.';
trackResults(N).Q_VE = zeros(1,length(GNSS_tracking(N).VE)); trackResults(N).Q_VE = zeros(1,length(GNSS_tracking(N).VE));
trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).L)); trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).L));
trackResults(N).Q_VL = zeros(1,length(GNSS_tracking(N).VL)); trackResults(N).Q_VL = zeros(1,length(GNSS_tracking(N).VL));
trackResults(N).data_I = GNSS_tracking(N).prompt_I.'; trackResults(N).data_I = GNSS_tracking(N).prompt_I.';
trackResults(N).data_Q = GNSS_tracking(N).prompt_Q.'; trackResults(N).data_Q = GNSS_tracking(N).prompt_Q.';
trackResults(N).PRN = GNSS_tracking(N).PRN.'; trackResults(N).PRN = GNSS_tracking(N).PRN.';
trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.'; trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.';
% 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,38 +41,38 @@ 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
for N=1:1:channels for N=1:1:channels
trackResults(N).status = 'T'; %fake track trackResults(N).status = 'T'; %fake track
trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.'; trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.'; trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.';
trackResults(N).dllDiscr = GNSS_tracking(N).code_error.'; trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.'; trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.'; trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.'; trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
trackResults(N).I_P = GNSS_tracking(N).prompt_I.'; trackResults(N).I_P = GNSS_tracking(N).prompt_I.';
trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.'; trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.';
trackResults(N).I_VE = GNSS_tracking(N).VE.'; trackResults(N).I_VE = GNSS_tracking(N).VE.';
trackResults(N).I_E = GNSS_tracking(N).E.'; trackResults(N).I_E = GNSS_tracking(N).E.';
trackResults(N).I_L = GNSS_tracking(N).L.'; trackResults(N).I_L = GNSS_tracking(N).L.';
trackResults(N).I_VL = GNSS_tracking(N).VL.'; trackResults(N).I_VL = GNSS_tracking(N).VL.';
trackResults(N).Q_VE = zeros(1,length(GNSS_tracking(N).VE)); trackResults(N).Q_VE = zeros(1,length(GNSS_tracking(N).VE));
trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).L)); trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).L));
trackResults(N).Q_VL = zeros(1,length(GNSS_tracking(N).VL)); trackResults(N).Q_VL = zeros(1,length(GNSS_tracking(N).VL));
trackResults(N).PRN = GNSS_tracking(N).PRN.'; trackResults(N).PRN = GNSS_tracking(N).PRN.';
trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.'; trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.';
% 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,54 +42,54 @@ 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
for N=1:1:channels for N=1:1:channels
trackResults(N).status = 'T'; %fake track trackResults(N).status = 'T'; %fake track
trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.'; trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.'; trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.';
trackResults(N).dllDiscr = GNSS_tracking(N).code_error.'; trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.'; trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.'; trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.'; trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
trackResults(N).I_PN = GNSS_tracking(N).prompt_I.'; trackResults(N).I_PN = GNSS_tracking(N).prompt_I.';
trackResults(N).Q_PN = GNSS_tracking(N).prompt_Q.'; trackResults(N).Q_PN = GNSS_tracking(N).prompt_Q.';
trackResults(N).Q_P = zeros(1,length(GNSS_tracking(N).P)); trackResults(N).Q_P = zeros(1,length(GNSS_tracking(N).P));
trackResults(N).I_P = GNSS_tracking(N).P.'; trackResults(N).I_P = GNSS_tracking(N).P.';
trackResults(N).I_E = GNSS_tracking(N).E.'; trackResults(N).I_E = GNSS_tracking(N).E.';
trackResults(N).I_L = GNSS_tracking(N).L.'; trackResults(N).I_L = GNSS_tracking(N).L.';
trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).PRN = GNSS_tracking(N).PRN.'; trackResults(N).PRN = GNSS_tracking(N).PRN.';
% 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
@ -43,32 +42,32 @@ 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 epl_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
for N=1:1:channels for N=1:1:channels
trackResults(N).status = 'T'; %fake track trackResults(N).status = 'T'; %fake track
trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.'; trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
trackResults(N).carrFreq = GNSS_tracking(N).carrier_freq_hz.'; trackResults(N).carrFreq = GNSS_tracking(N).carrier_freq_hz.';
trackResults(N).dllDiscr = GNSS_tracking(N).code_error.'; trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.'; trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.'; trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.'; trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
trackResults(N).I_P = GNSS_tracking(N).prompt_I.'; trackResults(N).I_P = GNSS_tracking(N).prompt_I.';
trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.'; trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.';
trackResults(N).I_E = GNSS_tracking(N).E.'; trackResults(N).I_E = GNSS_tracking(N).E.';
trackResults(N).I_L = GNSS_tracking(N).L.'; trackResults(N).I_L = GNSS_tracking(N).L.';
trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.'; trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.';
trackResults(N).PRN = ones(1,length(GNSS_tracking(N).E)); trackResults(N).PRN = ones(1,length(GNSS_tracking(N).E));
% 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
@ -43,34 +42,34 @@ 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 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
for N=1:1:channels for N=1:1:channels
trackResults(N).status = 'T'; %fake track trackResults(N).status = 'T'; %fake track
trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.'; trackResults(N).codeFreq = GNSS_tracking(N).code_freq_hz.';
trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.'; trackResults(N).carrFreq = GNSS_tracking(N).carrier_doppler_hz.';
trackResults(N).dllDiscr = GNSS_tracking(N).code_error.'; trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.'; trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.'; trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.'; trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
trackResults(N).I_P = GNSS_tracking(N).prompt_I.'; trackResults(N).I_P = GNSS_tracking(N).prompt_I.';
trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.'; trackResults(N).Q_P = GNSS_tracking(N).prompt_Q.';
trackResults(N).I_E = GNSS_tracking(N).E.'; trackResults(N).I_E = GNSS_tracking(N).E.';
trackResults(N).I_L = GNSS_tracking(N).L.'; trackResults(N).I_L = GNSS_tracking(N).L.';
trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_E = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E)); trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).E));
trackResults(N).PRN = ones(1,length(GNSS_tracking(N).E)); trackResults(N).PRN = ones(1,length(GNSS_tracking(N).E));
trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.'; trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.';
% 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 @@
% /*! % Readx GNSS-SDR PVT dump binary file using the provided
% * \file gps_l1_ca_pvt_plot_sample.m % function and plotx 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;
@ -63,17 +61,17 @@ h=35;
[X, Y, Z]=geo2cart(lat, long, h, 5); % geographical to cartesian conversion [X, Y, Z]=geo2cart(lat, long, h, 5); % geographical to cartesian conversion
%=== 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);
for k=1:1:length(navSolutions.X) for k=1:1:length(navSolutions.X)
[navSolutions.E(k), ... [navSolutions.E(k), ...
navSolutions.N(k), ... navSolutions.N(k), ...
navSolutions.U(k)]=cart2utm(navSolutions.X(k), navSolutions.Y(k), navSolutions.Z(k), utmZone); navSolutions.U(k)]=cart2utm(navSolutions.X(k), navSolutions.Y(k), navSolutions.Z(k), utmZone);
end end
plot_skyplot=0; plot_skyplot=0;

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;
@ -6,4 +30,4 @@ samplingFreq = 64e6/16; %[Hz]
channels=4; channels=4;
path='/home/javier/workspace/gnss-sdr-ref/trunk/install/'; path='/home/javier/workspace/gnss-sdr-ref/trunk/install/';
pvt_raw_log_path=[path 'PVT_raw.dat']; pvt_raw_log_path=[path 'PVT_raw.dat'];
GNSS_PVT_raw= gps_l1_ca_read_pvt_raw_dump(channels,pvt_raw_log_path); GNSS_PVT_raw= gps_l1_ca_read_pvt_raw_dump(channels,pvt_raw_log_path);

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]
@ -35,6 +34,6 @@ path='/home/javier/workspace/gnss-sdr-ref/trunk/install/';
clear PRN_absolute_sample_start; clear PRN_absolute_sample_start;
for N=1:1:channels for N=1:1:channels
telemetry_log_path=[path 'telemetry' num2str(N-1) '.dat']; telemetry_log_path=[path 'telemetry' num2str(N-1) '.dat'];
GNSS_telemetry(N)= gps_l1_ca_read_telemetry_dump(telemetry_log_path); GNSS_telemetry(N)= gps_l1_ca_read_telemetry_dump(telemetry_log_path);
end end

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
@ -25,9 +50,9 @@ error_ms=preambles_timestamp_sdr_ms(common_start_index:(common_start_index+lengt
% figure % figure
% stem(tracking_loop_start+javi_subFrameStart_sample(channel,:),1000*trackResults_sdr(channel).absoluteSample(javi_subFrameStart_sample(channel,:))/settings.samplingFreq); % stem(tracking_loop_start+javi_subFrameStart_sample(channel,:),1000*trackResults_sdr(channel).absoluteSample(javi_subFrameStart_sample(channel,:))/settings.samplingFreq);
% %
% hold on; % hold on;
% %
% plot(GNSS_observables.preamble_delay_ms(channel,:)); % plot(GNSS_observables.preamble_delay_ms(channel,:));
% %
% plot(GNSS_observables.prn_delay_ms(channel,:),'r') % plot(GNSS_observables.prn_delay_ms(channel,:),'r')

View File

@ -1,4 +1,29 @@
% compare pseudoranges % -------------------------------------------------------------------------
%
% 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
close all; close all;
% GNSS SDR % GNSS SDR

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;
@ -41,24 +66,24 @@ title('Doppler frequency')
xlabel('TOW [s]') xlabel('TOW [s]')
ylabel('[Hz]'); ylabel('[Hz]');
% %
% %read true obs from simulator (optional) % %read true obs from simulator (optional)
% GPS_STARTOFFSET_s = 68.802e-3; % GPS_STARTOFFSET_s = 68.802e-3;
% %
% true_observables_log_path='/home/javier/git/gnss-sdr/build/obs_out.bin'; % true_observables_log_path='/home/javier/git/gnss-sdr/build/obs_out.bin';
% GNSS_true_observables= read_true_sim_observables_dump(true_observables_log_path); % GNSS_true_observables= read_true_sim_observables_dump(true_observables_log_path);
% %
% %correct the clock error using true values (it is not possible for a receiver to correct % %correct the clock error using true values (it is not possible for a receiver to correct
% %the receiver clock offset error at the observables level because it is required the % %the receiver clock offset error at the observables level because it is required the
% %decoding of the ephemeris data and solve the PVT equations) % %decoding of the ephemeris data and solve the PVT equations)
% %
% SPEED_OF_LIGHT_M_S = 299792458.0; % SPEED_OF_LIGHT_M_S = 299792458.0;
% %
% %find the reference satellite % %find the reference satellite
% [~,ref_sat_ch]=min(GNSS_observables.Pseudorange_m(:,min_idx+1)); % [~,ref_sat_ch]=min(GNSS_observables.Pseudorange_m(:,min_idx+1));
% shift_time_s=GNSS_true_observables.Pseudorange_m(ref_sat_ch,:)/SPEED_OF_LIGHT_M_S-GPS_STARTOFFSET_s; % shift_time_s=GNSS_true_observables.Pseudorange_m(ref_sat_ch,:)/SPEED_OF_LIGHT_M_S-GPS_STARTOFFSET_s;
% %
% %
% %Compute deltas if required and interpolate to measurement time % %Compute deltas if required and interpolate to measurement time
% delta_true_psudorange_m=GNSS_true_observables.Pseudorange_m(1,:)-GNSS_true_observables.Pseudorange_m(2,:); % delta_true_psudorange_m=GNSS_true_observables.Pseudorange_m(1,:)-GNSS_true_observables.Pseudorange_m(2,:);
% delta_true_interp_psudorange_m=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ... % delta_true_interp_psudorange_m=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ...
@ -67,23 +92,23 @@ ylabel('[Hz]');
% GNSS_true_observables.Carrier_phase_hz(1,:),GNSS_observables.RX_time(1,min_idx+1:end),'lineal','extrap'); % GNSS_true_observables.Carrier_phase_hz(1,:),GNSS_observables.RX_time(1,min_idx+1:end),'lineal','extrap');
% true_interp_acc_carrier_phase_ch2_hz=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ... % true_interp_acc_carrier_phase_ch2_hz=interp1(GNSS_true_observables.RX_time(1,:)-shift_time_s, ...
% GNSS_true_observables.Carrier_phase_hz(2,:),GNSS_observables.RX_time(2,min_idx+1:end),'lineal','extrap'); % GNSS_true_observables.Carrier_phase_hz(2,:),GNSS_observables.RX_time(2,min_idx+1:end),'lineal','extrap');
% %
% %Compute measurement errors % %Compute measurement errors
% %
% delta_measured_psudorange_m=GNSS_observables.Pseudorange_m(1,min_idx+1:end)-GNSS_observables.Pseudorange_m(2,min_idx+1:end); % delta_measured_psudorange_m=GNSS_observables.Pseudorange_m(1,min_idx+1:end)-GNSS_observables.Pseudorange_m(2,min_idx+1:end);
% psudorange_error_m=delta_measured_psudorange_m-delta_true_interp_psudorange_m; % psudorange_error_m=delta_measured_psudorange_m-delta_true_interp_psudorange_m;
% psudorange_rms_m=sqrt(sum(psudorange_error_m.^2)/length(psudorange_error_m)) % psudorange_rms_m=sqrt(sum(psudorange_error_m.^2)/length(psudorange_error_m))
% %
% acc_carrier_error_ch1_hz=GNSS_observables.Carrier_phase_hz(1,min_idx+1:end)-true_interp_acc_carrier_phase_ch1_hz... % acc_carrier_error_ch1_hz=GNSS_observables.Carrier_phase_hz(1,min_idx+1:end)-true_interp_acc_carrier_phase_ch1_hz...
% -GNSS_observables.Carrier_phase_hz(1,min_idx+1)+true_interp_acc_carrier_phase_ch1_hz(1); % -GNSS_observables.Carrier_phase_hz(1,min_idx+1)+true_interp_acc_carrier_phase_ch1_hz(1);
% %
% acc_phase_rms_ch1_hz=sqrt(sum(acc_carrier_error_ch1_hz.^2)/length(acc_carrier_error_ch1_hz)) % acc_phase_rms_ch1_hz=sqrt(sum(acc_carrier_error_ch1_hz.^2)/length(acc_carrier_error_ch1_hz))
% %
% acc_carrier_error_ch2_hz=GNSS_observables.Carrier_phase_hz(2,min_idx+1:end)-true_interp_acc_carrier_phase_ch2_hz... % acc_carrier_error_ch2_hz=GNSS_observables.Carrier_phase_hz(2,min_idx+1:end)-true_interp_acc_carrier_phase_ch2_hz...
% -GNSS_observables.Carrier_phase_hz(2,min_idx+1)+true_interp_acc_carrier_phase_ch2_hz(1); % -GNSS_observables.Carrier_phase_hz(2,min_idx+1)+true_interp_acc_carrier_phase_ch2_hz(1);
% acc_phase_rms_ch2_hz=sqrt(sum(acc_carrier_error_ch2_hz.^2)/length(acc_carrier_error_ch2_hz)) % acc_phase_rms_ch2_hz=sqrt(sum(acc_carrier_error_ch2_hz.^2)/length(acc_carrier_error_ch2_hz))
% %
% %
% %plot results % %plot results
% figure; % figure;
% plot(GNSS_true_observables.RX_time(1,:),delta_true_psudorange_m,'g'); % plot(GNSS_true_observables.RX_time(1,:),delta_true_psudorange_m,'g');
@ -92,25 +117,25 @@ ylabel('[Hz]');
% title('TRUE vs. measured Pseudoranges [m]') % title('TRUE vs. measured Pseudoranges [m]')
% xlabel('TOW [s]') % xlabel('TOW [s]')
% ylabel('[m]'); % ylabel('[m]');
% %
% figure; % figure;
% plot(GNSS_observables.RX_time(1,min_idx+1:end),psudorange_error_m) % plot(GNSS_observables.RX_time(1,min_idx+1:end),psudorange_error_m)
% title('Pseudoranges error [m]') % title('Pseudoranges error [m]')
% xlabel('TOW [s]') % xlabel('TOW [s]')
% ylabel('[m]'); % ylabel('[m]');
% %
% figure; % figure;
% plot(GNSS_observables.RX_time(1,min_idx+1:end),acc_carrier_error_ch1_hz) % plot(GNSS_observables.RX_time(1,min_idx+1:end),acc_carrier_error_ch1_hz)
% title('Accumulated carrier phase error CH1 [hz]') % title('Accumulated carrier phase error CH1 [hz]')
% xlabel('TOW [s]') % xlabel('TOW [s]')
% ylabel('[hz]'); % ylabel('[hz]');
% %
% figure; % figure;
% plot(GNSS_observables.RX_time(1,min_idx+1:end),acc_carrier_error_ch2_hz) % plot(GNSS_observables.RX_time(1,min_idx+1:end),acc_carrier_error_ch2_hz)
% title('Accumulated carrier phase error CH2 [hz]') % title('Accumulated carrier phase error CH2 [hz]')
% xlabel('TOW [s]') % xlabel('TOW [s]')
% ylabel('[hz]'); % ylabel('[hz]');
% %
% %
% %
% %

View File

@ -1,130 +1,128 @@
% /*! % 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
v2 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v2 = 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
v3 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v3 = 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
v4 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v4 = 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
v5 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v5 = 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
v6 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v6 = 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
v7 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v7 = 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
v8 = fread (f, count, 'long', skip_bytes_each_read - unsigned_long_int_size_bytes); v8 = fread (f, count, 'long', skip_bytes_each_read - unsigned_long_int_size_bytes);
bytes_shift = bytes_shift + unsigned_long_int_size_bytes; bytes_shift = bytes_shift + unsigned_long_int_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float fseek(f,bytes_shift,'bof'); % move to next float
v9 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v9 = 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
v10 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v10 = 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
v11 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v11 = 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
v12 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v12 = 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
v13 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v13 = 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
v14 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v14 = 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
v15 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v15 = 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
v16 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v16 = 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
v17 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes); v17 = 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
v18 = fread (f, count, 'float', skip_bytes_each_read-float_size_bytes); v18 = 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 double fseek(f,bytes_shift,'bof'); % move to next double
v19 = fread (f, count, 'double', skip_bytes_each_read - double_size_bytes); v19 = fread (f, count, 'double', 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 unsigned int fseek(f,bytes_shift,'bof'); % move to next unsigned int
v20 = fread (f, count, 'uint', skip_bytes_each_read - unsigned_int_size_bytes); v20 = fread (f, count, 'uint', skip_bytes_each_read - unsigned_int_size_bytes);
fclose (f); fclose (f);
@ -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,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,158 +1,156 @@
% /*! % 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
v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); v2 = 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
v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); v3 = 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
v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); v4 = 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
v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); v5 = 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 unsigned_long_int 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); v6 = fread (f, count, 'uint64',skip_bytes_each_read-unsigned_long_int_size_bytes);
bytes_shift=bytes_shift+unsigned_long_int_size_bytes; bytes_shift=bytes_shift+unsigned_long_int_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v7 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v7 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v8 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v8 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v9 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v9 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v10 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v10 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v11 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v11 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v12 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v12 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v13 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v13 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v14 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v14 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v15 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v15 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v16 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v16 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v17 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); v17 = 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 double fseek(f,bytes_shift,'bof'); % move to next interleaved double
v18 = fread (f, count, 'uint32',skip_bytes_each_read-double_size_bytes); v18 = fread (f, count, 'uint32',skip_bytes_each_read-double_size_bytes);
fclose (f); fclose (f);
%%%%%%%% 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,39 +1,40 @@
% /*! %
% * \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;
% d_dump_file.write((char*)&tmp_double, sizeof(double)); % d_dump_file.write((char*)&tmp_double, sizeof(double));
@ -58,57 +59,56 @@ function [navSolutions] = gps_l1_ca_pvt_read_pvt_dump (filename, count)
% // GEO user position Height [m] % // GEO user position Height [m]
% 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);
num_double_vars=8;
double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars;
bytes_shift=0;
if (m)
usage (m);
end
if (nargin < 3) m = nargchk (1,2,nargin);
num_double_vars=8;
double_size_bytes=8;
skip_bytes_each_read=double_size_bytes*num_double_vars;
bytes_shift=0;
if (m)
usage (m);
end
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
ECEF_X = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); ECEF_X = 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
ECEF_Y = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); ECEF_Y = 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
ECEF_Z = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); ECEF_Z = 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
Clock_Offset = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); Clock_Offset = 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
Lat = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); Lat = 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
Long = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); Long = 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
Height = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); Height = 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
fclose (f); fclose (f);
end end
navSolutions.X=ECEF_X.'; navSolutions.X=ECEF_X.';
navSolutions.Y=ECEF_Y.'; navSolutions.Y=ECEF_Y.';
navSolutions.Z=ECEF_Z.'; navSolutions.Z=ECEF_Z.';
navSolutions.dt=Clock_Offset.'; navSolutions.dt=Clock_Offset.';
navSolutions.latitude=Lat.'; navSolutions.latitude=Lat.';
navSolutions.longitude=Long.'; navSolutions.longitude=Long.';
navSolutions.height=Height.'; navSolutions.height=Height.';
navSolutions.TransmitTime=GPS_current_time.'; navSolutions.TransmitTime=GPS_current_time.';

View File

@ -1,27 +1,52 @@
% Javier Arribas 2011 % -------------------------------------------------------------------------
%
% 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
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;
@ -33,17 +58,17 @@ function [pvt_raw] = gps_l1_ca_read_pvt_raw_dump (channels, 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
end end
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,48 +1,73 @@
% Javier Arribas 2011 % -------------------------------------------------------------------------
%
% 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
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
telemetry.prn_delay_ms = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); telemetry.prn_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
telemetry.Preamble_symbol_counter = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); telemetry.Preamble_symbol_counter = 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
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 % plot. It plots receiver coordinates in UTM system or coordinate offsets if
% * \brief % the true UTM receiver coordinates are provided.
% 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.
% * \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,47 +13,77 @@ 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))
%% If reference position is not provided, then set reference position %% If reference position is not provided, then set reference position
%% to the average postion %% to the average postion
if isnan(settings.truePosition.E) || isnan(settings.truePosition.N) ... if isnan(settings.truePosition.E) || isnan(settings.truePosition.N) ...
|| isnan(settings.truePosition.U) || isnan(settings.truePosition.U)
%=== Compute mean values ========================================== %=== Compute mean values ==========================================
% Remove NaN-s or the output of the function MEAN will be NaN. % Remove NaN-s or the output of the function MEAN will be NaN.
refCoord.E = mean(navSolutions.E(~isnan(navSolutions.E))); refCoord.E = mean(navSolutions.E(~isnan(navSolutions.E)));
refCoord.N = mean(navSolutions.N(~isnan(navSolutions.N))); refCoord.N = mean(navSolutions.N(~isnan(navSolutions.N)));
refCoord.U = mean(navSolutions.U(~isnan(navSolutions.U))); refCoord.U = mean(navSolutions.U(~isnan(navSolutions.U)));
%Also convert geodetic coordinates to deg:min:sec vector format %Also convert geodetic coordinates to deg:min:sec vector format
meanLongitude = dms2mat(deg2dms(... meanLongitude = dms2mat(deg2dms(...
mean(navSolutions.longitude(~isnan(navSolutions.longitude)))), -5); mean(navSolutions.longitude(~isnan(navSolutions.longitude)))), -5);
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)), '''''']
refPointLgText = ['Mean Position\newline Lat: ', ... refPointLgText = ['Mean Position\newline Lat: ', ...
num2str(meanLatitude(1)), '{\circ}', ... num2str(meanLatitude(1)), '{\circ}', ...
num2str(meanLatitude(2)), '{\prime}', ... num2str(meanLatitude(2)), '{\prime}', ...
num2str(meanLatitude(3)), '{\prime}{\prime}', ... num2str(meanLatitude(3)), '{\prime}{\prime}', ...
'\newline Lng: ', ... '\newline Lng: ', ...
num2str(meanLongitude(1)), '{\circ}', ... num2str(meanLongitude(1)), '{\circ}', ...
num2str(meanLongitude(2)), '{\prime}', ... num2str(meanLongitude(2)), '{\prime}', ...
num2str(meanLongitude(3)), '{\prime}{\prime}', ... num2str(meanLongitude(3)), '{\prime}{\prime}', ...
'\newline Hgt: ', ... '\newline Hgt: ', ...
num2str(mean(navSolutions.height(~isnan(navSolutions.height))), '%+6.1f')]; num2str(mean(navSolutions.height(~isnan(navSolutions.height))), '%+6.1f')];
else else
% compute the mean error for static receiver % compute the mean error for static receiver
mean_position.E = mean(navSolutions.E(~isnan(navSolutions.E))); mean_position.E = mean(navSolutions.E(~isnan(navSolutions.E)));
@ -100,55 +96,55 @@ if (~isempty(navSolutions))
error_meters=sqrt((mean_position.E-refCoord.E)^2+(mean_position.N-refCoord.N)^2+(mean_position.U-refCoord.U)^2); error_meters=sqrt((mean_position.E-refCoord.E)^2+(mean_position.N-refCoord.N)^2+(mean_position.U-refCoord.U)^2);
refPointLgText = ['Reference Position, Mean 3D error = ' num2str(error_meters) ' [m]']; refPointLgText = ['Reference Position, Mean 3D error = ' num2str(error_meters) ' [m]'];
end end
figureNumber = 300; figureNumber = 300;
% The 300 is chosen for more convenient handling of the open % The 300 is chosen for more convenient handling of the open
% figure windows, when many figures are closed and reopened. Figures % figure windows, when many figures are closed and reopened. Figures
% drawn or opened by the user, will not be "overwritten" by this % drawn or opened by the user, will not be "overwritten" by this
% function if the auto numbering is not used. % function if the auto numbering is not used.
%=== Select (or create) and clear the figure ========================== %=== Select (or create) and clear the figure ==========================
figure(figureNumber); figure(figureNumber);
clf (figureNumber); clf (figureNumber);
set (figureNumber, 'Name', 'Navigation solutions'); set (figureNumber, 'Name', 'Navigation solutions');
%--- Draw axes -------------------------------------------------------- %--- Draw axes --------------------------------------------------------
handles(1, 1) = subplot(4, 2, 1 : 4); handles(1, 1) = subplot(4, 2, 1 : 4);
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)', ...
(navSolutions.N - refCoord.N)',... (navSolutions.N - refCoord.N)',...
(navSolutions.U - refCoord.U)']); (navSolutions.U - refCoord.U)']);
title (handles(1, 1), 'Coordinates variations in UTM system'); title (handles(1, 1), 'Coordinates variations in UTM system');
legend(handles(1, 1), 'E', 'N', 'U'); legend(handles(1, 1), 'E', 'N', 'U');
xlabel(handles(1, 1), ['Measurement period: ', ... xlabel(handles(1, 1), ['Measurement period: ', ...
num2str(settings.navSolPeriod), 'ms']); num2str(settings.navSolPeriod), 'ms']);
ylabel(handles(1, 1), 'Variations (m)'); ylabel(handles(1, 1), 'Variations (m)');
grid (handles(1, 1)); grid (handles(1, 1));
axis (handles(1, 1), 'tight'); axis (handles(1, 1), 'tight');
%--- Position plot in UTM system -------------------------------------- %--- Position plot in UTM system --------------------------------------
plot3 (handles(3, 1), navSolutions.E - refCoord.E, ... plot3 (handles(3, 1), navSolutions.E - refCoord.E, ...
navSolutions.N - refCoord.N, ... navSolutions.N - refCoord.N, ...
navSolutions.U - refCoord.U, '+'); navSolutions.U - refCoord.U, '+');
hold (handles(3, 1), 'on'); hold (handles(3, 1), 'on');
%Plot the reference point %Plot the reference point
plot3 (handles(3, 1), 0, 0, 0, 'r+', 'LineWidth', 1.5, 'MarkerSize', 10); plot3 (handles(3, 1), 0, 0, 0, 'r+', 'LineWidth', 1.5, 'MarkerSize', 10);
hold (handles(3, 1), 'off'); hold (handles(3, 1), 'off');
view (handles(3, 1), 0, 90); view (handles(3, 1), 0, 90);
axis (handles(3, 1), 'equal'); axis (handles(3, 1), 'equal');
grid (handles(3, 1), 'minor'); grid (handles(3, 1), 'minor');
legend(handles(3, 1), 'Measurements', refPointLgText); legend(handles(3, 1), 'Measurements', refPointLgText);
title (handles(3, 1), 'Positions in UTM system (3D plot)'); title (handles(3, 1), 'Positions in UTM system (3D plot)');
xlabel(handles(3, 1), 'East (m)'); xlabel(handles(3, 1), 'East (m)');
ylabel(handles(3, 1), 'North (m)'); ylabel(handles(3, 1), 'North (m)');
@ -157,14 +153,14 @@ if (~isempty(navSolutions))
if (plot_skyplot==1) if (plot_skyplot==1)
%--- Satellite sky plot ----------------------------------------------- %--- Satellite sky plot -----------------------------------------------
skyPlot(handles(3, 2), ... skyPlot(handles(3, 2), ...
navSolutions.channel.az, ... navSolutions.channel.az, ...
navSolutions.channel.el, ... navSolutions.channel.el, ...
navSolutions.channel.PRN(:, 1)); navSolutions.channel.PRN(:, 1));
title (handles(3, 2), ['Sky plot (mean PDOP: ', ... title (handles(3, 2), ['Sky plot (mean PDOP: ', ...
num2str(mean(navSolutions.DOP(2,:))), ')']); num2str(mean(navSolutions.DOP(2,:))), ')']);
end end
else else
disp('plotNavigation: No navigation data to plot.'); disp('plotNavigation: No navigation data to plot.');
end % if (~isempty(navSolutions)) end % if (~isempty(navSolutions))

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.
@ -10,7 +10,7 @@ function plotTracking(channelList, trackResults, settings)
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
% SoftGNSS v3.0 % SoftGNSS v3.0
% %
% Copyright (C) Darius Plausinaitis % Copyright (C) Darius Plausinaitis
% Written by Darius Plausinaitis % Written by Darius Plausinaitis
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
@ -30,160 +30,158 @@ 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);
%=== 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
% this function. % this function.
figure(channelNr +200); figure(channelNr +200);
clf(channelNr +200); clf(channelNr +200);
set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ... set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ...
' (PRN ', ... ' (PRN ', ...
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]);
% Row 2 % Row 2
handles(2, 1) = subplot(4, 3, 4); handles(2, 1) = subplot(4, 3, 4);
handles(2, 2) = subplot(4, 3, [5 6]); handles(2, 2) = subplot(4, 3, [5 6]);
% Row 3 % Row 3
handles(3, 1) = subplot(4, 3, 7); handles(3, 1) = subplot(4, 3, 7);
handles(3, 2) = subplot(4, 3, 8); handles(3, 2) = subplot(4, 3, 8);
handles(3, 3) = subplot(4, 3, 9); handles(3, 3) = subplot(4, 3, 9);
% Row 4 % Row 4
handles(4, 1) = subplot(4, 3, 10); handles(4, 1) = subplot(4, 3, 10);
handles(4, 2) = subplot(4, 3, 11); handles(4, 2) = subplot(4, 3, 11);
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;
%----- Discrete-Time Scatter Plot --------------------------------- %----- Discrete-Time Scatter Plot ---------------------------------
plot(handles(1, 1), trackResults(channelNr).I_P,... plot(handles(1, 1), trackResults(channelNr).I_P,...
trackResults(channelNr).Q_P, ... trackResults(channelNr).Q_P, ...
'.'); '.');
grid (handles(1, 1)); grid (handles(1, 1));
axis (handles(1, 1), 'equal'); axis (handles(1, 1), 'equal');
title (handles(1, 1), 'Discrete-Time Scatter Plot'); title (handles(1, 1), 'Discrete-Time Scatter Plot');
xlabel(handles(1, 1), 'I prompt'); xlabel(handles(1, 1), 'I prompt');
ylabel(handles(1, 1), 'Q prompt'); ylabel(handles(1, 1), 'Q prompt');
%----- Nav bits --------------------------------------------------- %----- Nav bits ---------------------------------------------------
plot (handles(1, 2), timeAxisInSeconds, ... plot (handles(1, 2), timeAxisInSeconds, ...
trackResults(channelNr).I_P); trackResults(channelNr).I_P);
grid (handles(1, 2)); grid (handles(1, 2));
title (handles(1, 2), 'Bits of the navigation message'); title (handles(1, 2), 'Bits of the navigation message');
xlabel(handles(1, 2), 'Time (s)'); xlabel(handles(1, 2), 'Time (s)');
axis (handles(1, 2), 'tight'); axis (handles(1, 2), 'tight');
%----- PLL discriminator unfiltered-------------------------------- %----- PLL discriminator unfiltered--------------------------------
plot (handles(2, 1), timeAxisInSeconds, ... plot (handles(2, 1), timeAxisInSeconds, ...
trackResults(channelNr).pllDiscr, 'r'); trackResults(channelNr).pllDiscr, 'r');
grid (handles(2, 1)); grid (handles(2, 1));
axis (handles(2, 1), 'tight'); axis (handles(2, 1), 'tight');
xlabel(handles(2, 1), 'Time (s)'); xlabel(handles(2, 1), 'Time (s)');
ylabel(handles(2, 1), 'Amplitude'); ylabel(handles(2, 1), 'Amplitude');
title (handles(2, 1), 'Raw PLL discriminator'); title (handles(2, 1), 'Raw PLL discriminator');
%----- Correlation ------------------------------------------------ %----- Correlation ------------------------------------------------
plot(handles(2, 2), timeAxisInSeconds, ... plot(handles(2, 2), timeAxisInSeconds, ...
[sqrt(trackResults(channelNr).I_E.^2 + ... [sqrt(trackResults(channelNr).I_E.^2 + ...
trackResults(channelNr).Q_E.^2)', ... trackResults(channelNr).Q_E.^2)', ...
sqrt(trackResults(channelNr).I_P.^2 + ... sqrt(trackResults(channelNr).I_P.^2 + ...
trackResults(channelNr).Q_P.^2)', ... trackResults(channelNr).Q_P.^2)', ...
sqrt(trackResults(channelNr).I_L.^2 + ... sqrt(trackResults(channelNr).I_L.^2 + ...
trackResults(channelNr).Q_L.^2)'], ... trackResults(channelNr).Q_L.^2)'], ...
'-*'); '-*');
grid (handles(2, 2)); grid (handles(2, 2));
title (handles(2, 2), 'Correlation results'); title (handles(2, 2), 'Correlation results');
xlabel(handles(2, 2), 'Time (s)'); xlabel(handles(2, 2), 'Time (s)');
axis (handles(2, 2), 'tight'); axis (handles(2, 2), 'tight');
hLegend = legend(handles(2, 2), '$\sqrt{I_{E}^2 + Q_{E}^2}$', ... hLegend = legend(handles(2, 2), '$\sqrt{I_{E}^2 + Q_{E}^2}$', ...
'$\sqrt{I_{P}^2 + Q_{P}^2}$', ... '$\sqrt{I_{P}^2 + Q_{P}^2}$', ...
'$\sqrt{I_{L}^2 + Q_{L}^2}$'); '$\sqrt{I_{L}^2 + Q_{L}^2}$');
%set interpreter from tex to latex. This will draw \sqrt correctly %set interpreter from tex to latex. This will draw \sqrt correctly
set(hLegend, 'Interpreter', 'Latex'); set(hLegend, 'Interpreter', 'Latex');
%----- PLL discriminator filtered---------------------------------- %----- PLL discriminator filtered----------------------------------
plot (handles(3, 1), timeAxisInSeconds, ... plot (handles(3, 1), timeAxisInSeconds, ...
trackResults(channelNr).pllDiscrFilt(1:settings.msToProcess), 'b'); trackResults(channelNr).pllDiscrFilt(1:settings.msToProcess), 'b');
grid (handles(3, 1)); grid (handles(3, 1));
axis (handles(3, 1), 'tight'); axis (handles(3, 1), 'tight');
xlabel(handles(3, 1), 'Time (s)'); xlabel(handles(3, 1), 'Time (s)');
ylabel(handles(3, 1), 'Amplitude'); ylabel(handles(3, 1), 'Amplitude');
title (handles(3, 1), 'Filtered PLL discriminator'); title (handles(3, 1), 'Filtered PLL discriminator');
%----- DLL discriminator unfiltered-------------------------------- %----- DLL discriminator unfiltered--------------------------------
plot (handles(3, 2), timeAxisInSeconds, ... plot (handles(3, 2), timeAxisInSeconds, ...
trackResults(channelNr).dllDiscr, 'r'); trackResults(channelNr).dllDiscr, 'r');
grid (handles(3, 2)); grid (handles(3, 2));
axis (handles(3, 2), 'tight'); axis (handles(3, 2), 'tight');
xlabel(handles(3, 2), 'Time (s)'); xlabel(handles(3, 2), 'Time (s)');
ylabel(handles(3, 2), 'Amplitude'); ylabel(handles(3, 2), 'Amplitude');
title (handles(3, 2), 'Raw DLL discriminator'); title (handles(3, 2), 'Raw DLL discriminator');
%----- DLL discriminator filtered---------------------------------- %----- DLL discriminator filtered----------------------------------
plot (handles(3, 3), timeAxisInSeconds, ... plot (handles(3, 3), timeAxisInSeconds, ...
trackResults(channelNr).dllDiscrFilt, 'b'); trackResults(channelNr).dllDiscrFilt, 'b');
grid (handles(3, 3)); grid (handles(3, 3));
axis (handles(3, 3), 'tight'); axis (handles(3, 3), 'tight');
xlabel(handles(3, 3), 'Time (s)'); xlabel(handles(3, 3), 'Time (s)');
ylabel(handles(3, 3), 'Amplitude'); ylabel(handles(3, 3), 'Amplitude');
title (handles(3, 3), 'Filtered DLL discriminator'); title (handles(3, 3), 'Filtered DLL discriminator');
%----- CNo for signal---------------------------------- %----- CNo for signal----------------------------------
plot (handles(4, 1), timeAxisInSeconds, ... plot (handles(4, 1), timeAxisInSeconds, ...
trackResults(channelNr).CNo(1:settings.msToProcess), 'b'); trackResults(channelNr).CNo(1:settings.msToProcess), 'b');
grid (handles(4, 1)); grid (handles(4, 1));
axis (handles(4, 1), 'tight'); axis (handles(4, 1), 'tight');
xlabel(handles(4, 1), 'Time (s)'); xlabel(handles(4, 1), 'Time (s)');
ylabel(handles(4, 1), 'CNo (dB-Hz)'); ylabel(handles(4, 1), 'CNo (dB-Hz)');
title (handles(4, 1), 'Carrier to Noise Ratio'); title (handles(4, 1), 'Carrier to Noise Ratio');
%----- Carrier Frequency -------------------------------- %----- Carrier Frequency --------------------------------
plot (handles(4, 2), timeAxisInSeconds(2:end), ... plot (handles(4, 2), timeAxisInSeconds(2:end), ...
trackResults(channelNr).carrFreq(2:settings.msToProcess), 'Color',[0.42 0.25 0.39]); trackResults(channelNr).carrFreq(2:settings.msToProcess), 'Color',[0.42 0.25 0.39]);
grid (handles(4, 2)); grid (handles(4, 2));
axis (handles(4, 2)); axis (handles(4, 2));
xlabel(handles(4, 2), 'Time (s)'); xlabel(handles(4, 2), 'Time (s)');
ylabel(handles(4, 2), 'Freq (hz)'); ylabel(handles(4, 2), 'Freq (hz)');
title (handles(4, 2), 'Carrier Freq'); title (handles(4, 2), 'Carrier Freq');
%----- Code Frequency---------------------------------- %----- Code Frequency----------------------------------
%--- Skip sample 0 to help with results display %--- Skip sample 0 to help with results display
plot (handles(4, 3), timeAxisInSeconds(2:end), ... plot (handles(4, 3), timeAxisInSeconds(2:end), ...
trackResults(channelNr).codeFreq(2:settings.msToProcess), 'Color',[0.2 0.3 0.49]); trackResults(channelNr).codeFreq(2:settings.msToProcess), 'Color',[0.2 0.3 0.49]);
grid (handles(4, 3)); grid (handles(4, 3));
axis (handles(4, 3), 'tight'); axis (handles(4, 3), 'tight');
xlabel(handles(4, 3), 'Time (s)'); xlabel(handles(4, 3), 'Time (s)');
ylabel(handles(4, 3), 'Freq (Hz)'); ylabel(handles(4, 3), 'Freq (Hz)');
title (handles(4, 3), 'Code Freq'); title (handles(4, 3), 'Code Freq');
end % for channelNr = channelList end % for channelNr = channelList

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.
@ -10,7 +10,7 @@ function plotVEMLTracking(channelList, trackResults, settings)
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
% SoftGNSS v3.0 % SoftGNSS v3.0
% %
% Copyright (C) Darius Plausinaitis % Copyright (C) Darius Plausinaitis
% Written by Darius Plausinaitis % Written by Darius Plausinaitis
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
@ -30,136 +30,133 @@ 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
% this function. % this function.
figure(channelNr +200); figure(channelNr +200);
clf(channelNr +200); clf(channelNr +200);
set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ... set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ...
' (PRN ', ... ' (PRN ', ...
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]);
% Row 2 % Row 2
handles(2, 1) = subplot(3, 3, 4); handles(2, 1) = subplot(3, 3, 4);
handles(2, 2) = subplot(3, 3, [5 6]); handles(2, 2) = subplot(3, 3, [5 6]);
% Row 3 % Row 3
handles(3, 1) = subplot(3, 3, 7); handles(3, 1) = subplot(3, 3, 7);
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;
%----- Discrete-Time Scatter Plot --------------------------------- %----- Discrete-Time Scatter Plot ---------------------------------
plot(handles(1, 1), trackResults(channelNr).data_I,... plot(handles(1, 1), trackResults(channelNr).data_I,...
trackResults(channelNr).data_Q, ... trackResults(channelNr).data_Q, ...
'.'); '.');
grid (handles(1, 1)); grid (handles(1, 1));
axis (handles(1, 1), 'equal'); axis (handles(1, 1), 'equal');
title (handles(1, 1), 'Discrete-Time Scatter Plot'); title (handles(1, 1), 'Discrete-Time Scatter Plot');
xlabel(handles(1, 1), 'I prompt'); xlabel(handles(1, 1), 'I prompt');
ylabel(handles(1, 1), 'Q prompt'); ylabel(handles(1, 1), 'Q prompt');
%----- Nav bits --------------------------------------------------- %----- Nav bits ---------------------------------------------------
t = (1:length(trackResults(channelNr).data_I)); t = (1:length(trackResults(channelNr).data_I));
plot (handles(1, 2), t, ... plot (handles(1, 2), t, ...
trackResults(channelNr).data_I); trackResults(channelNr).data_I);
grid (handles(1, 2)); grid (handles(1, 2));
title (handles(1, 2), 'Bits of the navigation message'); title (handles(1, 2), 'Bits of the navigation message');
xlabel(handles(1, 2), 'Time (s)'); xlabel(handles(1, 2), 'Time (s)');
axis (handles(1, 2), 'tight'); axis (handles(1, 2), 'tight');
%----- PLL discriminator unfiltered-------------------------------- %----- PLL discriminator unfiltered--------------------------------
t = (1:length(trackResults(channelNr).pllDiscr)); t = (1:length(trackResults(channelNr).pllDiscr));
plot (handles(2, 1), t, ... plot (handles(2, 1), t, ...
trackResults(channelNr).pllDiscr, 'r'); trackResults(channelNr).pllDiscr, 'r');
grid (handles(2, 1)); grid (handles(2, 1));
axis (handles(2, 1), 'tight'); axis (handles(2, 1), 'tight');
xlabel(handles(2, 1), 'Time (s)'); xlabel(handles(2, 1), 'Time (s)');
ylabel(handles(2, 1), 'Amplitude'); ylabel(handles(2, 1), 'Amplitude');
title (handles(2, 1), 'Raw PLL discriminator'); title (handles(2, 1), 'Raw PLL discriminator');
%----- Correlation ------------------------------------------------ %----- Correlation ------------------------------------------------
t = (1:length(trackResults(channelNr).I_VE)); t = (1:length(trackResults(channelNr).I_VE));
plot(handles(2, 2), t, ... plot(handles(2, 2), t, ...
[sqrt(trackResults(channelNr).I_VE.^2 + ... [sqrt(trackResults(channelNr).I_VE.^2 + ...
trackResults(channelNr).Q_VE.^2)', ... trackResults(channelNr).Q_VE.^2)', ...
sqrt(trackResults(channelNr).I_E.^2 + ... sqrt(trackResults(channelNr).I_E.^2 + ...
trackResults(channelNr).Q_E.^2)', ... trackResults(channelNr).Q_E.^2)', ...
sqrt(trackResults(channelNr).I_P.^2 + ... sqrt(trackResults(channelNr).I_P.^2 + ...
trackResults(channelNr).Q_P.^2)', ... trackResults(channelNr).Q_P.^2)', ...
sqrt(trackResults(channelNr).I_L.^2 + ... sqrt(trackResults(channelNr).I_L.^2 + ...
trackResults(channelNr).Q_L.^2)', ... trackResults(channelNr).Q_L.^2)', ...
sqrt(trackResults(channelNr).I_VL.^2 + ... sqrt(trackResults(channelNr).I_VL.^2 + ...
trackResults(channelNr).Q_VL.^2)'], ... trackResults(channelNr).Q_VL.^2)'], ...
'-*'); '-*');
grid (handles(2, 2)); grid (handles(2, 2));
title (handles(2, 2), 'Correlation results'); title (handles(2, 2), 'Correlation results');
xlabel(handles(2, 2), 'Time (s)'); xlabel(handles(2, 2), 'Time (s)');
axis (handles(2, 2), 'tight'); axis (handles(2, 2), 'tight');
hLegend = legend(handles(2, 2), '$\sqrt{I_{VE}^2 + Q_{VE}^2}$', ... hLegend = legend(handles(2, 2), '$\sqrt{I_{VE}^2 + Q_{VE}^2}$', ...
'$\sqrt{I_{E}^2 + Q_{E}^2}$', ... '$\sqrt{I_{E}^2 + Q_{E}^2}$', ...
'$\sqrt{I_{P}^2 + Q_{P}^2}$', ... '$\sqrt{I_{P}^2 + Q_{P}^2}$', ...
'$\sqrt{I_{L}^2 + Q_{L}^2}$', ... '$\sqrt{I_{L}^2 + Q_{L}^2}$', ...
'$\sqrt{I_{VL}^2 + Q_{VL}^2}$'); '$\sqrt{I_{VL}^2 + Q_{VL}^2}$');
%set interpreter from tex to latex. This will draw \sqrt correctly %set interpreter from tex to latex. This will draw \sqrt correctly
set(hLegend, 'Interpreter', 'Latex'); set(hLegend, 'Interpreter', 'Latex');
%----- PLL discriminator filtered---------------------------------- %----- PLL discriminator filtered----------------------------------
t = (1:length(trackResults(channelNr).pllDiscrFilt)); t = (1:length(trackResults(channelNr).pllDiscrFilt));
plot (handles(3, 1), t, ... plot (handles(3, 1), t, ...
trackResults(channelNr).pllDiscrFilt, 'b'); trackResults(channelNr).pllDiscrFilt, 'b');
grid (handles(3, 1)); grid (handles(3, 1));
axis (handles(3, 1), 'tight'); axis (handles(3, 1), 'tight');
xlabel(handles(3, 1), 'Time (s)'); xlabel(handles(3, 1), 'Time (s)');
ylabel(handles(3, 1), 'Amplitude'); ylabel(handles(3, 1), 'Amplitude');
title (handles(3, 1), 'Filtered PLL discriminator'); title (handles(3, 1), 'Filtered PLL discriminator');
%----- DLL discriminator unfiltered-------------------------------- %----- DLL discriminator unfiltered--------------------------------
t = (1:length(trackResults(channelNr).dllDiscr)); t = (1:length(trackResults(channelNr).dllDiscr));
plot (handles(3, 2), t, ... plot (handles(3, 2), t, ...
trackResults(channelNr).dllDiscr, 'r'); trackResults(channelNr).dllDiscr, 'r');
grid (handles(3, 2)); grid (handles(3, 2));
axis (handles(3, 2), 'tight'); axis (handles(3, 2), 'tight');
xlabel(handles(3, 2), 'Time (s)'); xlabel(handles(3, 2), 'Time (s)');
ylabel(handles(3, 2), 'Amplitude'); ylabel(handles(3, 2), 'Amplitude');
title (handles(3, 2), 'Raw DLL discriminator'); title (handles(3, 2), 'Raw DLL discriminator');
%----- DLL discriminator filtered---------------------------------- %----- DLL discriminator filtered----------------------------------
t = (1:length(trackResults(channelNr).dllDiscrFilt)); t = (1:length(trackResults(channelNr).dllDiscrFilt));
plot (handles(3, 3), t, ... plot (handles(3, 3), t, ...
trackResults(channelNr).dllDiscrFilt, 'b'); trackResults(channelNr).dllDiscrFilt, 'b');
grid (handles(3, 3)); grid (handles(3, 3));
axis (handles(3, 3), 'tight'); axis (handles(3, 3), 'tight');
xlabel(handles(3, 3), 'Time (s)'); xlabel(handles(3, 3), 'Time (s)');
ylabel(handles(3, 3), 'Amplitude'); ylabel(handles(3, 3), 'Amplitude');
title (handles(3, 3), 'Filtered DLL discriminator'); title (handles(3, 3), 'Filtered DLL discriminator');
end % for channelNr = channelList end % for channelNr = channelList

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 @@
% Javier Arribas 2011 % 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
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;
@ -45,27 +70,27 @@ function [observables] = read_hybrid_observables_dump (channels, 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
end end
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 @@
% Javier Arribas 2011 % 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
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;
@ -47,19 +72,19 @@ function [observables] = read_true_sim_observables_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
end end
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.
@ -10,144 +10,141 @@ function plotTracking(channelList, trackResults, settings)
%-------------------------------------------------------------------------- %--------------------------------------------------------------------------
% SoftGNSS v3.0 % SoftGNSS v3.0
% %
% 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
% this function. % this function.
figure(channelNr +200); figure(channelNr +200);
clf(channelNr +200); clf(channelNr +200);
set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ... set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ...
' (PRN ', ... ' (PRN ', ...
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]);
% Row 2 % Row 2
handles(2, 1) = subplot(3, 3, 4); handles(2, 1) = subplot(3, 3, 4);
handles(2, 2) = subplot(3, 3, [5 6]); handles(2, 2) = subplot(3, 3, [5 6]);
% Row 3 % Row 3
handles(3, 1) = subplot(3, 3, 7); handles(3, 1) = subplot(3, 3, 7);
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;
%----- Discrete-Time Scatter Plot --------------------------------- %----- Discrete-Time Scatter Plot ---------------------------------
plot(handles(1, 1), trackResults(channelNr).I_PN,... plot(handles(1, 1), trackResults(channelNr).I_PN,...
trackResults(channelNr).Q_PN, ... trackResults(channelNr).Q_PN, ...
'.'); '.');
grid (handles(1, 1)); grid (handles(1, 1));
axis (handles(1, 1), 'equal'); axis (handles(1, 1), 'equal');
title (handles(1, 1), 'Discrete-Time Scatter Plot'); title (handles(1, 1), 'Discrete-Time Scatter Plot');
xlabel(handles(1, 1), 'I prompt'); xlabel(handles(1, 1), 'I prompt');
ylabel(handles(1, 1), 'Q prompt'); ylabel(handles(1, 1), 'Q prompt');
%----- Nav bits --------------------------------------------------- %----- Nav bits ---------------------------------------------------
plot (handles(1, 2), timeAxisInSeconds, ... plot (handles(1, 2), timeAxisInSeconds, ...
trackResults(channelNr).I_PN(1:settings.msToProcess-1)); trackResults(channelNr).I_PN(1:settings.msToProcess-1));
grid (handles(1, 2)); grid (handles(1, 2));
title (handles(1, 2), 'Bits of the navigation message'); title (handles(1, 2), 'Bits of the navigation message');
xlabel(handles(1, 2), 'Time (s)'); xlabel(handles(1, 2), 'Time (s)');
axis (handles(1, 2), 'tight'); axis (handles(1, 2), 'tight');
%----- PLL discriminator unfiltered-------------------------------- %----- PLL discriminator unfiltered--------------------------------
plot (handles(2, 1), timeAxisInSeconds, ... plot (handles(2, 1), timeAxisInSeconds, ...
trackResults(channelNr).pllDiscr(1:settings.msToProcess-1), 'r'); trackResults(channelNr).pllDiscr(1:settings.msToProcess-1), 'r');
grid (handles(2, 1)); grid (handles(2, 1));
axis (handles(2, 1), 'tight'); axis (handles(2, 1), 'tight');
xlabel(handles(2, 1), 'Time (s)'); xlabel(handles(2, 1), 'Time (s)');
ylabel(handles(2, 1), 'Amplitude'); ylabel(handles(2, 1), 'Amplitude');
title (handles(2, 1), 'Raw PLL discriminator'); title (handles(2, 1), 'Raw PLL discriminator');
%----- Correlation ------------------------------------------------ %----- Correlation ------------------------------------------------
plot(handles(2, 2), timeAxisInSeconds, ... plot(handles(2, 2), timeAxisInSeconds, ...
[sqrt(trackResults(channelNr).I_E(1:settings.msToProcess-1).^2 + ... [sqrt(trackResults(channelNr).I_E(1:settings.msToProcess-1).^2 + ...
trackResults(channelNr).Q_E(1:settings.msToProcess-1).^2)', ... trackResults(channelNr).Q_E(1:settings.msToProcess-1).^2)', ...
sqrt(trackResults(channelNr).I_P(1:settings.msToProcess-1).^2 + ... sqrt(trackResults(channelNr).I_P(1:settings.msToProcess-1).^2 + ...
trackResults(channelNr).Q_P(1:settings.msToProcess-1).^2)', ... trackResults(channelNr).Q_P(1:settings.msToProcess-1).^2)', ...
sqrt(trackResults(channelNr).I_L(1:settings.msToProcess-1).^2 + ... sqrt(trackResults(channelNr).I_L(1:settings.msToProcess-1).^2 + ...
trackResults(channelNr).Q_L(1:settings.msToProcess-1).^2)'], ... trackResults(channelNr).Q_L(1:settings.msToProcess-1).^2)'], ...
'-*'); '-*');
grid (handles(2, 2)); grid (handles(2, 2));
title (handles(2, 2), 'Correlation results'); title (handles(2, 2), 'Correlation results');
xlabel(handles(2, 2), 'Time (s)'); xlabel(handles(2, 2), 'Time (s)');
axis (handles(2, 2), 'tight'); axis (handles(2, 2), 'tight');
hLegend = legend(handles(2, 2), '$\sqrt{I_{E}^2 + Q_{E}^2}$', ... hLegend = legend(handles(2, 2), '$\sqrt{I_{E}^2 + Q_{E}^2}$', ...
'$\sqrt{I_{P}^2 + Q_{P}^2}$', ... '$\sqrt{I_{P}^2 + Q_{P}^2}$', ...
'$\sqrt{I_{L}^2 + Q_{L}^2}$'); '$\sqrt{I_{L}^2 + Q_{L}^2}$');
%set interpreter from tex to latex. This will draw \sqrt correctly %set interpreter from tex to latex. This will draw \sqrt correctly
set(hLegend, 'Interpreter', 'Latex'); set(hLegend, 'Interpreter', 'Latex');
%----- PLL discriminator filtered---------------------------------- %----- PLL discriminator filtered----------------------------------
plot (handles(3, 1), timeAxisInSeconds, ... plot (handles(3, 1), timeAxisInSeconds, ...
trackResults(channelNr).pllDiscrFilt(1:settings.msToProcess-1), 'b'); trackResults(channelNr).pllDiscrFilt(1:settings.msToProcess-1), 'b');
grid (handles(3, 1)); grid (handles(3, 1));
axis (handles(3, 1), 'tight'); axis (handles(3, 1), 'tight');
xlabel(handles(3, 1), 'Time (s)'); xlabel(handles(3, 1), 'Time (s)');
ylabel(handles(3, 1), 'Amplitude'); ylabel(handles(3, 1), 'Amplitude');
title (handles(3, 1), 'Filtered PLL discriminator'); title (handles(3, 1), 'Filtered PLL discriminator');
%----- DLL discriminator unfiltered-------------------------------- %----- DLL discriminator unfiltered--------------------------------
plot (handles(3, 2), timeAxisInSeconds, ... plot (handles(3, 2), timeAxisInSeconds, ...
trackResults(channelNr).dllDiscr(1:settings.msToProcess-1), 'r'); trackResults(channelNr).dllDiscr(1:settings.msToProcess-1), 'r');
grid (handles(3, 2)); grid (handles(3, 2));
axis (handles(3, 2), 'tight'); axis (handles(3, 2), 'tight');
xlabel(handles(3, 2), 'Time (s)'); xlabel(handles(3, 2), 'Time (s)');
ylabel(handles(3, 2), 'Amplitude'); ylabel(handles(3, 2), 'Amplitude');
title (handles(3, 2), 'Raw DLL discriminator'); title (handles(3, 2), 'Raw DLL discriminator');
%----- DLL discriminator filtered---------------------------------- %----- DLL discriminator filtered----------------------------------
plot (handles(3, 3), timeAxisInSeconds, ... plot (handles(3, 3), timeAxisInSeconds, ...
trackResults(channelNr).dllDiscrFilt(1:settings.msToProcess-1), 'b'); trackResults(channelNr).dllDiscrFilt(1:settings.msToProcess-1), 'b');
grid (handles(3, 3)); grid (handles(3, 3));
axis (handles(3, 3), 'tight'); axis (handles(3, 3), 'tight');
xlabel(handles(3, 3), 'Time (s)'); xlabel(handles(3, 3), 'Time (s)');
ylabel(handles(3, 3), 'Amplitude'); ylabel(handles(3, 3), 'Amplitude');
title (handles(3, 3), 'Filtered DLL discriminator'); title (handles(3, 3), 'Filtered DLL discriminator');
end % for channelNr = channelList end % for channelNr = channelList

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 % function and plot acquisition grid of acquisition statistic of PRN sat.
% * \brief Read GNSS-SDR Acquisition dump binary file using the provided % CAF input must be 0 or 1 depending if the user desires to read the file
% function and plot acquisition grid of acquisition statistic of PRN sat. % that resolves doppler ambiguity or not.
% CAF input must be 0 or 1 depending if the user desires to read the file
% 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)
@ -127,7 +126,7 @@ myFile = java.io.File(file);
flen = length(myFile); flen = length(myFile);
num_samples=flen/8; % 8 bytes (2 single floats) per complex sample num_samples=flen/8; % 8 bytes (2 single floats) per complex sample
for k=1:num_samples for k=1:num_samples
a(1:2) = fread(fid, 2, 'float'); a(1:2) = fread(fid, 2, 'float');
x(k) = a(1) + a(2)*1i; x(k) = a(1) + a(2)*1i;
k=k+1; k=k+1;

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))