forked from mfkiwl/GNSS_SDR_GPSGalileo_MPDD_SQI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.m
executable file
·134 lines (109 loc) · 5.58 KB
/
init.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
%--------------------------------------------------------------------------
% SoftGNSS v3.0
%
% Copyright (C) Darius Plausinaitis and Dennis M. Akos
% Written by Darius Plausinaitis and Dennis M. Akos
%--------------------------------------------------------------------------
%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.
%--------------------------------------------------------------------------
%
%Script initializes settings and environment of the software receiver.
%Then the processing is started.
%--------------------------------------------------------------------------
% CVS record:
% $Id: init.m,v 1.14.2.21 2006/08/22 13:46:00 dpl Exp $
%% Clean up the environment first =========================================
clearvars; close all; clc; fclose all;
format ('compact');
format ('long', 'g');
%--- Include folders with functions ---------------------------------------
addpath include % The software receiver functions
addpath geoFunctions % Position calculation related functions
addpath ('RAIM',genpath('MPDD_functions'),'acq_track_functions','geoFunctions',genpath('include'),'Kalman Filter')%,'include for MPDD') % RAIM functions
%% Print startup ==========================================================
fprintf(['\n',...
'Welcome to: softGNSS\n\n', ...
'An open source GNSS SDR software project initiated by:\n\n', ...
' Danish GPS Center/Aalborg University\n\n', ...
'The code was improved by GNSS Laboratory/University of Colorado.\n\n',...
'The software receiver softGNSS comes with ABSOLUTELY NO WARRANTY;\n',...
'for details please read license details in the file license.txt. This\n',...
'is free software, and you are welcome to redistribute it under\n',...
'the terms described in the license.\n\n']);
fprintf(' -------------------------------\n\n');
%% Initialize constants, settings =========================================
settings = initSettings();
settingsMPDD=InitsettingsMPDD(settings);
for datafileIndex=1:settings.N_of_datafile
settings.datafileIndex=datafileIndex;
if datafileIndex>1
fclose all;
clearvars -except datafileIndex settings settingsMPDD
end
%fileName=char(settings.fileName(datafileIndex));
%fileName=char(settings.fileName{1,1}{1,datafileIndex});
if settings.N_of_datafile==1 % Only 1 dataset or more?
fileName=char(settings.fileName{1,1});
else
fileName=char(settings.fileName{1,1}{1,datafileIndex});
end
% Bl=[0.5 1 2:2:20 30]
% Bl=[0.4:0.1:0.6 1 2:2:20 25 30] analisi completa
%for Bl=[2 6 10 20]%Bl=[0.5 1 2 6 8 10 20 30]
%settings.dllNoiseBandwidth=Bl;
% for pseudorate=[500 1000] % 2000
%settings.navSolPeriod=pseudorate;
%% Generate plot of raw data and ask if ready to start processing =========
try
fprintf('Probing data (%s)...\n', fileName)
probeData(fileName,settings);
catch
% There was an error, print it and exit
errStruct = lasterror;
disp(errStruct.message);
disp(' (run setSettings or change settings in "initSettings.m" to reconfigure)')
return;
end
disp(' Raw IF/IQ data plotted ')
disp(' (run setSettings or change settings in "initSettings.m" to reconfigure)')
disp(' ');
gnssStart = 1; %input('Enter "1" to initiate GNSS processing or "0" to exit : ');
navSolutions=[];
if (gnssStart == 1)
disp(' ');
%start things rolling...
postProcessing
%%%%%%%%%%
if ~isempty(navSolutions)
figure
plot(navSolutions.channel.rawP(:,2:end)','.-')
grid on
title('RAW \rho')
legend(num2str(navSolutions.channel.PRN(:,1)))
xlabel('Time [s]')
% [firstSubFrame, activeChnList] = findPreambles(trackResults,settings);
% startPreamblems=firstSubFrame(1);
% discreteTime=[0:length(navSolutions.channel.rawP(end,:))-1];
% xtime=(discreteTime*settings.navSolPeriod+startPreamblems)/1e3;
% plotNavigation2(navSolutions,settings,xtime);
end
end
% close all
% clearvars -except settings inddataset pseudorate Bl
% clc
%end
% end
end