2018-03-30 08:33:11 +00:00
|
|
|
% Reads GNSS-SDR Acquisition dump .mat file using the provided
|
|
|
|
% function and plots acquisition grid of acquisition statistic of PRN sat
|
|
|
|
% Antonio Ramos, 2017. antonio.ramos(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
|
2018-05-13 20:49:11 +00:00
|
|
|
% along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
2018-03-30 08:33:11 +00:00
|
|
|
%
|
|
|
|
% -------------------------------------------------------------------------
|
2018-01-23 11:28:29 +00:00
|
|
|
%
|
|
|
|
|
2018-03-30 08:33:11 +00:00
|
|
|
%%%%%%%%% ?????? CONFIGURE !!! %%%%%%%%%%%%%
|
2018-01-24 11:59:22 +00:00
|
|
|
|
2018-11-04 23:31:58 +00:00
|
|
|
path = '/home/dmiralles/Documents/gnss-sdr/';
|
|
|
|
file = 'bds_acq';
|
2018-01-24 11:59:22 +00:00
|
|
|
|
2018-11-04 23:31:58 +00:00
|
|
|
sat = 32;
|
2018-01-24 11:59:22 +00:00
|
|
|
|
2018-06-21 06:05:33 +00:00
|
|
|
channel = 0;
|
2018-11-04 23:31:58 +00:00
|
|
|
execution = 3;
|
2018-01-24 11:59:22 +00:00
|
|
|
% Signal:
|
|
|
|
% 1 GPS L1
|
|
|
|
% 2 GPS L2M
|
|
|
|
% 3 GPS L5
|
|
|
|
% 4 Gal. E1B
|
|
|
|
% 5 Gal. E5
|
2018-01-30 14:46:13 +00:00
|
|
|
% 6 Glo. 1G
|
2018-11-04 23:31:58 +00:00
|
|
|
% 7 BDS B1
|
2018-01-24 11:59:22 +00:00
|
|
|
|
2018-11-04 23:31:58 +00:00
|
|
|
signal_type = 7;
|
2018-01-24 11:59:22 +00:00
|
|
|
|
2018-11-04 23:31:58 +00:00
|
|
|
%%% True for light acq_grid representation
|
2018-01-25 16:28:34 +00:00
|
|
|
lite_view = true;
|
2018-01-24 11:59:22 +00:00
|
|
|
|
2018-01-23 11:28:29 +00:00
|
|
|
%%% If lite_view, it sets the number of samples per chip in the graphical representation
|
2018-01-25 16:28:34 +00:00
|
|
|
n_samples_per_chip = 3;
|
2018-01-23 11:28:29 +00:00
|
|
|
|
2018-01-24 11:59:22 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2018-01-23 11:28:29 +00:00
|
|
|
|
2018-01-24 11:59:22 +00:00
|
|
|
switch(signal_type)
|
|
|
|
case 1
|
|
|
|
n_chips = 1023;
|
|
|
|
system = 'G';
|
2018-01-25 16:28:34 +00:00
|
|
|
signal = '1C';
|
2018-01-24 11:59:22 +00:00
|
|
|
case 2
|
|
|
|
n_chips = 10230;
|
|
|
|
system = 'G';
|
2018-01-25 16:28:34 +00:00
|
|
|
signal = '2S';
|
2018-01-24 11:59:22 +00:00
|
|
|
case 3
|
|
|
|
n_chips = 10230;
|
|
|
|
system = 'G';
|
2018-01-25 16:28:34 +00:00
|
|
|
signal = 'L5';
|
2018-01-24 11:59:22 +00:00
|
|
|
case 4
|
|
|
|
n_chips = 4092;
|
|
|
|
system = 'E';
|
2018-01-25 16:28:34 +00:00
|
|
|
signal = '1B';
|
2018-01-24 11:59:22 +00:00
|
|
|
case 5
|
|
|
|
n_chips = 10230;
|
|
|
|
system = 'E';
|
2018-01-25 16:28:34 +00:00
|
|
|
signal = '5X';
|
2018-01-30 14:46:13 +00:00
|
|
|
case 6
|
|
|
|
n_chips = 511;
|
|
|
|
system = 'R';
|
|
|
|
signal = '1G';
|
2018-11-04 23:31:58 +00:00
|
|
|
case 7
|
|
|
|
n_chips = 2046;
|
|
|
|
system = 'C';
|
|
|
|
signal = 'B1';
|
2018-01-24 11:59:22 +00:00
|
|
|
end
|
2018-06-21 06:05:33 +00:00
|
|
|
filename = [path file '_' system '_' signal '_ch_' num2str(channel) '_' num2str(execution) '_sat_' num2str(sat) '.mat'];
|
2018-01-24 11:59:22 +00:00
|
|
|
load(filename);
|
2018-11-04 23:31:58 +00:00
|
|
|
[n_fft n_dop_bins] = size(acq_grid);
|
|
|
|
[d_max f_max] = find(acq_grid == max(max(acq_grid)));
|
2018-01-23 11:28:29 +00:00
|
|
|
freq = (0 : n_dop_bins - 1) * doppler_step - doppler_max;
|
|
|
|
delay = (0 : n_fft - 1) / n_fft * n_chips;
|
|
|
|
figure(1)
|
|
|
|
if(lite_view == false)
|
2018-11-04 23:31:58 +00:00
|
|
|
surf(freq, delay, acq_grid, 'FaceColor', 'interp', 'LineStyle', 'none')
|
2018-01-24 11:35:57 +00:00
|
|
|
ylim([min(delay) max(delay)])
|
2018-01-23 11:28:29 +00:00
|
|
|
else
|
|
|
|
delay_interp = (0 : n_samples_per_chip * n_chips - 1) / n_samples_per_chip;
|
2018-11-04 23:31:58 +00:00
|
|
|
acq_grid_interp = spline(delay, acq_grid', delay_interp)';
|
|
|
|
surf(freq, delay_interp, acq_grid_interp, 'FaceColor', 'interp', 'LineStyle', 'none')
|
2018-01-24 11:35:57 +00:00
|
|
|
ylim([min(delay_interp) max(delay_interp)])
|
2018-01-23 11:28:29 +00:00
|
|
|
end
|
|
|
|
xlabel('Doppler shift / Hz')
|
2018-01-24 11:35:57 +00:00
|
|
|
xlim([min(freq) max(freq)])
|
2018-01-23 11:28:29 +00:00
|
|
|
ylabel('Code delay / chips')
|
|
|
|
zlabel('Test statistics')
|
2018-01-24 10:17:33 +00:00
|
|
|
figure(2)
|
|
|
|
subplot(2,1,1)
|
2018-11-04 23:31:58 +00:00
|
|
|
plot(freq, acq_grid(d_max, :))
|
2018-01-24 11:35:57 +00:00
|
|
|
xlim([min(freq) max(freq)])
|
2018-01-24 10:17:33 +00:00
|
|
|
xlabel('Doppler shift / Hz')
|
2018-01-24 13:42:08 +00:00
|
|
|
ylabel('Test statistics')
|
|
|
|
title(['Fixed code delay to ' num2str((d_max - 1) / n_fft * n_chips) ' chips'])
|
2018-01-24 10:17:33 +00:00
|
|
|
subplot(2,1,2)
|
2018-06-24 09:05:58 +00:00
|
|
|
normalization = (d_samples_per_code^4) * input_power;
|
2018-11-04 23:31:58 +00:00
|
|
|
plot(delay, acq_acq_grid(:, f_max)./normalization)
|
2018-01-24 11:35:57 +00:00
|
|
|
xlim([min(delay) max(delay)])
|
2018-01-24 10:17:33 +00:00
|
|
|
xlabel('Code delay / chips')
|
2018-01-24 13:42:08 +00:00
|
|
|
ylabel('Test statistics')
|
|
|
|
title(['Doppler wipe-off = ' num2str((f_max - 1) * doppler_step - doppler_max) ' Hz'])
|