2018-03-30 08:33:11 +00:00
|
|
|
% -------------------------------------------------------------------------
|
|
|
|
%
|
2019-07-26 10:38:20 +00:00
|
|
|
% Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
2018-03-30 08:33:11 +00:00
|
|
|
%
|
|
|
|
% GNSS-SDR is a software defined Global Navigation
|
|
|
|
% Satellite Systems receiver
|
|
|
|
%
|
|
|
|
% This file is part of GNSS-SDR.
|
|
|
|
%
|
2020-02-08 00:20:02 +00:00
|
|
|
% SPDX-License-Identifier: GPL-3.0-or-later
|
2018-03-30 08:33:11 +00:00
|
|
|
%
|
|
|
|
% -------------------------------------------------------------------------
|
|
|
|
%
|
|
|
|
|
2012-04-11 10:43:35 +00:00
|
|
|
%help script to compare GNSS-SDR Preambles starts
|
|
|
|
channel=3;
|
|
|
|
% From GNSS_SDR telemetry decoder
|
|
|
|
|
|
|
|
% 1 find preambles indexes
|
|
|
|
preambles_index=find(GNSS_telemetry(channel).Preamble_symbol_counter==0);
|
|
|
|
|
|
|
|
% 2 Get associated timestamp ms
|
|
|
|
|
|
|
|
preambles_timestamp_sdr_ms=GNSS_telemetry(channel).prn_delay_ms(preambles_index);
|
|
|
|
|
|
|
|
|
|
|
|
% From Matlab receiver
|
|
|
|
|
|
|
|
[firstSubFrame, activeChnList, javi_subFrameStart_sample] = findPreambles(trackResults_sdr,settings);
|
|
|
|
|
|
|
|
preambles_timestamp_matlab_ms=trackResults_sdr(channel).prn_delay_ms(javi_subFrameStart_sample(channel,1:6));
|
|
|
|
|
|
|
|
|
|
|
|
%Compare
|
|
|
|
|
|
|
|
common_start_index=max(find(abs(preambles_timestamp_sdr_ms-preambles_timestamp_matlab_ms(1))<2000));
|
|
|
|
|
|
|
|
error_ms=preambles_timestamp_sdr_ms(common_start_index:(common_start_index+length(preambles_timestamp_matlab_ms)-1))-preambles_timestamp_matlab_ms.'
|
|
|
|
|
|
|
|
% figure
|
|
|
|
% stem(tracking_loop_start+javi_subFrameStart_sample(channel,:),1000*trackResults_sdr(channel).absoluteSample(javi_subFrameStart_sample(channel,:))/settings.samplingFreq);
|
2018-03-30 08:33:11 +00:00
|
|
|
%
|
2012-04-11 10:43:35 +00:00
|
|
|
% hold on;
|
2018-03-30 08:33:11 +00:00
|
|
|
%
|
2012-04-11 10:43:35 +00:00
|
|
|
% plot(GNSS_observables.preamble_delay_ms(channel,:));
|
2018-03-30 08:33:11 +00:00
|
|
|
%
|
2018-03-30 10:13:48 +00:00
|
|
|
% plot(GNSS_observables.prn_delay_ms(channel,:),'r')
|