mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-09-28 03:41:50 +00:00
final version
This commit is contained in:
@@ -51,8 +51,10 @@ for N=1:1:channels
|
||||
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
|
||||
trackResults(N).pllDiscrFilt = GNSS_tracking(N).carr_nco.';
|
||||
|
||||
trackResults(N).I_P=GNSS_tracking(N).prompt_I.';
|
||||
trackResults(N).Q_P=GNSS_tracking(N).prompt_Q.';
|
||||
trackResults(N).I_PN=GNSS_tracking(N).prompt_I.';
|
||||
trackResults(N).Q_PN=GNSS_tracking(N).prompt_Q.';
|
||||
trackResults(N).Q_P=zeros(1,length(GNSS_tracking(N).P));
|
||||
trackResults(N).I_P=GNSS_tracking(N).P.';
|
||||
|
||||
trackResults(N).I_E= GNSS_tracking(N).E.';
|
||||
trackResults(N).I_L = GNSS_tracking(N).L.';
|
||||
@@ -63,7 +65,7 @@ for N=1:1:channels
|
||||
% Use original MATLAB tracking plot function
|
||||
settings.numberOfChannels=channels;
|
||||
settings.msToProcess=length(GNSS_tracking(N).E);
|
||||
plotTracking(N,trackResults,settings)
|
||||
plotTrackingE5a(N,trackResults,settings)
|
||||
end
|
||||
|
||||
for N=1:1:channels
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
function plotTracking(channelList, trackResults, settings)
|
||||
%This function plots the tracking results for the given channel list.
|
||||
%
|
||||
%plotTracking(channelList, trackResults, settings)
|
||||
%
|
||||
% Inputs:
|
||||
% channelList - list of channels to be plotted.
|
||||
% trackResults - tracking results from the tracking function.
|
||||
% settings - receiver settings.
|
||||
|
||||
%--------------------------------------------------------------------------
|
||||
% SoftGNSS v3.0
|
||||
%
|
||||
% Copyright (C) Darius Plausinaitis
|
||||
% Written by Darius Plausinaitis
|
||||
%--------------------------------------------------------------------------
|
||||
%This program 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 2
|
||||
%of the License, or (at your option) any later version.
|
||||
%
|
||||
%This program 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 this program; if not, write to the Free Software
|
||||
%Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
%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
|
||||
channelList = intersect(channelList, 1:settings.numberOfChannels);
|
||||
|
||||
%=== For all listed channels ==============================================
|
||||
for channelNr = channelList
|
||||
|
||||
%% Select (or create) and clear the figure ================================
|
||||
% The number 200 is added just for more convenient handling of the open
|
||||
% figure windows, when many figures are closed and reopened.
|
||||
% Figures drawn or opened by the user, will not be "overwritten" by
|
||||
% this function.
|
||||
|
||||
figure(channelNr +200);
|
||||
clf(channelNr +200);
|
||||
set(channelNr +200, 'Name', ['Channel ', num2str(channelNr), ...
|
||||
' (PRN ', ...
|
||||
num2str(trackResults(channelNr).PRN), ...
|
||||
') results']);
|
||||
|
||||
%% Draw axes ==============================================================
|
||||
% Row 1
|
||||
handles(1, 1) = subplot(3, 3, 1);
|
||||
handles(1, 2) = subplot(3, 3, [2 3]);
|
||||
% Row 2
|
||||
handles(2, 1) = subplot(3, 3, 4);
|
||||
handles(2, 2) = subplot(3, 3, [5 6]);
|
||||
% Row 3
|
||||
handles(3, 1) = subplot(3, 3, 7);
|
||||
handles(3, 2) = subplot(3, 3, 8);
|
||||
handles(3, 3) = subplot(3, 3, 9);
|
||||
|
||||
%% Plot all figures =======================================================
|
||||
|
||||
timeAxisInSeconds = (1:settings.msToProcess)/1000;
|
||||
|
||||
%----- Discrete-Time Scatter Plot ---------------------------------
|
||||
plot(handles(1, 1), trackResults(channelNr).I_PN,...
|
||||
trackResults(channelNr).Q_PN, ...
|
||||
'.');
|
||||
|
||||
grid (handles(1, 1));
|
||||
axis (handles(1, 1), 'equal');
|
||||
title (handles(1, 1), 'Discrete-Time Scatter Plot');
|
||||
xlabel(handles(1, 1), 'I prompt');
|
||||
ylabel(handles(1, 1), 'Q prompt');
|
||||
|
||||
%----- Nav bits ---------------------------------------------------
|
||||
plot (handles(1, 2), timeAxisInSeconds, ...
|
||||
trackResults(channelNr).I_PN);
|
||||
|
||||
grid (handles(1, 2));
|
||||
title (handles(1, 2), 'Bits of the navigation message');
|
||||
xlabel(handles(1, 2), 'Time (s)');
|
||||
axis (handles(1, 2), 'tight');
|
||||
|
||||
%----- PLL discriminator unfiltered--------------------------------
|
||||
plot (handles(2, 1), timeAxisInSeconds, ...
|
||||
trackResults(channelNr).pllDiscr, 'r');
|
||||
|
||||
grid (handles(2, 1));
|
||||
axis (handles(2, 1), 'tight');
|
||||
xlabel(handles(2, 1), 'Time (s)');
|
||||
ylabel(handles(2, 1), 'Amplitude');
|
||||
title (handles(2, 1), 'Raw PLL discriminator');
|
||||
|
||||
%----- Correlation ------------------------------------------------
|
||||
plot(handles(2, 2), timeAxisInSeconds, ...
|
||||
[sqrt(trackResults(channelNr).I_E.^2 + ...
|
||||
trackResults(channelNr).Q_E.^2)', ...
|
||||
sqrt(trackResults(channelNr).I_P.^2 + ...
|
||||
trackResults(channelNr).Q_P.^2)', ...
|
||||
sqrt(trackResults(channelNr).I_L.^2 + ...
|
||||
trackResults(channelNr).Q_L.^2)'], ...
|
||||
'-*');
|
||||
|
||||
grid (handles(2, 2));
|
||||
title (handles(2, 2), 'Correlation results');
|
||||
xlabel(handles(2, 2), 'Time (s)');
|
||||
axis (handles(2, 2), 'tight');
|
||||
|
||||
hLegend = legend(handles(2, 2), '$\sqrt{I_{E}^2 + Q_{E}^2}$', ...
|
||||
'$\sqrt{I_{P}^2 + Q_{P}^2}$', ...
|
||||
'$\sqrt{I_{L}^2 + Q_{L}^2}$');
|
||||
|
||||
%set interpreter from tex to latex. This will draw \sqrt correctly
|
||||
set(hLegend, 'Interpreter', 'Latex');
|
||||
|
||||
%----- PLL discriminator filtered----------------------------------
|
||||
plot (handles(3, 1), timeAxisInSeconds, ...
|
||||
trackResults(channelNr).pllDiscrFilt, 'b');
|
||||
|
||||
grid (handles(3, 1));
|
||||
axis (handles(3, 1), 'tight');
|
||||
xlabel(handles(3, 1), 'Time (s)');
|
||||
ylabel(handles(3, 1), 'Amplitude');
|
||||
title (handles(3, 1), 'Filtered PLL discriminator');
|
||||
|
||||
%----- DLL discriminator unfiltered--------------------------------
|
||||
plot (handles(3, 2), timeAxisInSeconds, ...
|
||||
trackResults(channelNr).dllDiscr, 'r');
|
||||
|
||||
grid (handles(3, 2));
|
||||
axis (handles(3, 2), 'tight');
|
||||
xlabel(handles(3, 2), 'Time (s)');
|
||||
ylabel(handles(3, 2), 'Amplitude');
|
||||
title (handles(3, 2), 'Raw DLL discriminator');
|
||||
|
||||
%----- DLL discriminator filtered----------------------------------
|
||||
plot (handles(3, 3), timeAxisInSeconds, ...
|
||||
trackResults(channelNr).dllDiscrFilt, 'b');
|
||||
|
||||
grid (handles(3, 3));
|
||||
axis (handles(3, 3), 'tight');
|
||||
xlabel(handles(3, 3), 'Time (s)');
|
||||
ylabel(handles(3, 3), 'Amplitude');
|
||||
title (handles(3, 3), 'Filtered DLL discriminator');
|
||||
|
||||
end % for channelNr = channelList
|
||||
@@ -83,7 +83,7 @@ if (CAF > 0)
|
||||
filename=[path 'test_statistics_E5a_sat_' num2str(sat) '_CAF.dat'];
|
||||
fid=fopen(filename,'r');
|
||||
xx=fread(fid,'float');%floats from squared correlation
|
||||
acq_grid(:,col)=abs(xx);
|
||||
acq_grid(:,col(1))=abs(xx);
|
||||
Doppler_error_Hz = Doppler_axes(xx==max(xx))
|
||||
maximum_correlation_peak = max(xx)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user