1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 11:40:33 +00:00

bugfix: Solves shared freq channel ambiguity and carr freq in plots

Adds code to solve the shared frequency channels for GLONASS satellites
during acq and trk, it is now decode responsability to fix the identifier
when decoding of ephemeris happens. It also adds more details in tracking
plotting and fixes silly bug that created false alarm.
This commit is contained in:
Damian Miralles 2017-09-09 13:44:35 -06:00
parent 778fa4f5f8
commit 2946d36f84
13 changed files with 69 additions and 26 deletions

View File

@ -26,7 +26,7 @@ Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_1G.count=5
Channels.in_acquisition=1
Channels.in_acquisition=5
Channel0.signal=1G
Channel1.signal=1G
Channel2.signal=1G
@ -34,9 +34,10 @@ Channel3.signal=1G
Channel4.signal=1G
Channel0.satellite=11
Channel1.satellite=15
;Channel2.satellite=12
;Channel3.satellite=23
Channel1.satellite=2
Channel2.satellite=18
Channel3.satellite=12
Channel4.satellite=21
; Possible list includes 2, 12, 21, 22
;######### ACQUISITION GLOBAL CONFIG ############
@ -49,14 +50,15 @@ Acquisition_1G.doppler_max=10000
Acquisition_1G.doppler_step=250
Acquisition_1G.dump=false;
Acquisition_1G.dump_filename=/archive/glo_acquisition.dat
;Acquisition_1G.coherent_integration_time_ms=10
;######### TRACKING GLOBAL CONFIG ############
Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1G.item_type=gr_complex
Tracking_1G.if=0
Tracking_1G.if=1
Tracking_1G.early_late_space_chips=0.5
Tracking_1G.pll_bw_hz=20.0;
Tracking_1G.dll_bw_hz=4.0;
Tracking_1G.pll_bw_hz=25.0;
Tracking_1G.dll_bw_hz=3.0;
Tracking_1G.dump=true;
Tracking_1G.dump_filename=/archive/glo_tracking_ch_

View File

@ -34,7 +34,7 @@ DataTypeAdapter.dump=false
DataTypeAdapter.dump_filename=../data/DataTypeAdapter.dat
;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=8
Channels_1C.count=5
Channels.in_acquisition=1
Channel.signal=1C
@ -51,6 +51,7 @@ Acquisition_1C.threshold=0.05
Acquisition_1C.doppler_max=10000
Acquisition_1C.doppler_step=250
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_C_Aid_Tracking
Tracking_1C.item_type=gr_complex

View File

@ -194,8 +194,8 @@ bool pcps_acquisition_cc::is_fdma()
// Dealing with FDMA system
if( strcmp(d_gnss_synchro->Signal,"1G") == 0 )
{
d_freq += d_old_freq * GLONASS_PRN.at(d_gnss_synchro->PRN);
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq * GLONASS_PRN.at(d_gnss_synchro->PRN) << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
d_freq += DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN);
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
return true;
}
else

View File

@ -288,7 +288,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
// NEW GLONASS string received
// 0. fetch the symbols into an array
int string_length = GLONASS_GNAV_STRING_SYMBOLS - d_symbols_per_preamble;
double string_symbols[string_length] = {0};
double string_symbols[GLONASS_GNAV_DATA_SYMBOLS] = {0};
//******* SYMBOL TO BIT *******
for (int i = 0; i < string_length; i++)

View File

@ -196,7 +196,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
acq_trk_diff_seconds = static_cast<double>(acq_trk_diff_samples) / static_cast<double>(d_fs_in);
// Doppler effect
// Fd=(C/(C+Vr))*F
d_glonass_freq_ch = GLONASS_L1_CA_FREQ_HZ + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN));
d_glonass_freq_ch = GLONASS_L1_CA_FREQ_HZ + (DFRQ1_GLO * static_cast<double>(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)));
double radial_velocity = (d_glonass_freq_ch + d_acq_carrier_doppler_hz) / d_glonass_freq_ch;
// new chip and prn sequence periods based on acq Doppler
double T_chip_mod_seconds;
@ -576,7 +576,8 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
d_dump_file.write(reinterpret_cast<char*>(&d_acc_carrier_phase_cycles), sizeof(double));
// carrier and code frequency
d_dump_file.write(reinterpret_cast<char*>(&d_carrier_doppler_hz), sizeof(double));
double if_freq_carrier = d_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast<double>(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)));
d_dump_file.write(reinterpret_cast<char*>(&if_freq_carrier), sizeof(double));
d_dump_file.write(reinterpret_cast<char*>(&d_code_freq_chips), sizeof(double));
//PLL commands

View File

@ -85,7 +85,7 @@ private:
long d_if_freq;
long d_fs_in;
long d_glonass_freq_ch;
double d_glonass_freq_ch;
double d_early_late_spc_chips;
int d_n_correlator_taps;

View File

@ -597,8 +597,8 @@ void GNSSFlowgraph::set_signals_list()
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};
std::set<unsigned int> available_glonass_prn = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24};
// Removing satellites sharing same frequency number(1 and 5, 2 and 6, 3 and 7, 4 and 6, 11 and 15, 12 and 16, 14 and 18, 17 and 21
std::set<unsigned int> available_glonass_prn = { 1, 2, 3, 4, 9, 10, 11, 12, 18, 19, 20, 21 };
std::string sv_list = configuration_->property("Galileo.prns", std::string("") );

View File

@ -159,6 +159,7 @@ const int GLONASS_GNAV_TELEMETRY_RATE_SYMBOLS_SECOND = GLONASS_GNAV_TELEMETRY_RA
const int GLONASS_GNAV_STRING_SYMBOLS = 2000; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits]
const int GLONASS_GNAV_STRING_BITS = 85; //!< Number of bits per string in the GNAV message (85 data bits + 30 time mark bits) [bits]
const int GLONASS_GNAV_HAMMING_CODE_BITS = 8; //!< Number of bits in hamming code sequence of GNAV message
const int GLONASS_GNAV_DATA_SYMBOLS = 1700; // STRING DATA WITHOUT PREAMBLE
const std::vector<int> GLONASS_GNAV_CRC_I_INDEX {9, 10, 12, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84};
const std::vector<int> GLONASS_GNAV_CRC_J_INDEX {9, 11, 12, 14, 15, 18, 19, 21, 22, 25, 26, 29, 30, 33, 34, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84};

View File

@ -68,6 +68,7 @@ for N=1:1:channels
trackResults(N).Q_L = zeros(1,length(GNSS_tracking(N).L));
trackResults(N).Q_VL = zeros(1,length(GNSS_tracking(N).VL));
trackResults(N).PRN = GNSS_tracking(N).PRN.';
trackResults(N).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.';
% Use original MATLAB tracking plot function
settings.numberOfChannels = channels;

View File

@ -51,7 +51,7 @@ end
for N=1:1:channels
trackResults(N).status = 'T'; %fake track
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_freq_hz.';
trackResults(N).dllDiscr = GNSS_tracking(N).code_error.';
trackResults(N).dllDiscrFilt = GNSS_tracking(N).code_nco.';
trackResults(N).pllDiscr = GNSS_tracking(N).carr_error.';
@ -64,6 +64,7 @@ for N=1:1:channels
trackResults(N).I_L = GNSS_tracking(N).L.';
trackResults(N).Q_E = 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).PRN = ones(1,length(GNSS_tracking(N).E));
% Use original MATLAB tracking plot function

View File

@ -65,6 +65,7 @@ for N=1:1:channels
trackResults(N).Q_E = 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).CNo = GNSS_tracking(N).CN0_SNV_dB_Hz.';
% Use original MATLAB tracking plot function
settings.numberOfChannels = channels;

View File

@ -157,7 +157,7 @@ function [GNSS_tracking] = glonass_ca_dll_pll_read_tracking_dump (filename, coun
prompt_Q=v5;
PRN_start_sample=v6;
acc_carrier_phase_rad=v7;
carrier_doppler_hz=v8;
carrier_freq_hz=v8;
code_freq_hz=v9;
carr_error=v10;
carr_nco=v11;
@ -176,7 +176,7 @@ function [GNSS_tracking] = glonass_ca_dll_pll_read_tracking_dump (filename, coun
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.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;

View File

@ -54,15 +54,20 @@ for channelNr = channelList
%% Draw axes ==============================================================
% Row 1
handles(1, 1) = subplot(3, 3, 1);
handles(1, 2) = subplot(3, 3, [2 3]);
handles(1, 1) = subplot(4, 3, 1);
handles(1, 2) = subplot(4, 3, [2 3]);
% Row 2
handles(2, 1) = subplot(3, 3, 4);
handles(2, 2) = subplot(3, 3, [5 6]);
handles(2, 1) = subplot(4, 3, 4);
handles(2, 2) = subplot(4, 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);
handles(3, 1) = subplot(4, 3, 7);
handles(3, 2) = subplot(4, 3, 8);
handles(3, 3) = subplot(4, 3, 9);
% Row 4
handles(4, 1) = subplot(4, 3, 10);
handles(4, 2) = subplot(4, 3, 11);
handles(4, 3) = subplot(4, 3, 12);
%% Plot all figures =======================================================
@ -149,5 +154,35 @@ for channelNr = channelList
xlabel(handles(3, 3), 'Time (s)');
ylabel(handles(3, 3), 'Amplitude');
title (handles(3, 3), 'Filtered DLL discriminator');
%----- CNo for signal----------------------------------
plot (handles(4, 1), timeAxisInSeconds, ...
trackResults(channelNr).CNo(1:settings.msToProcess), 'b');
grid (handles(4, 1));
axis (handles(4, 1), 'tight');
xlabel(handles(4, 1), 'Time (s)');
ylabel(handles(4, 1), 'CNo (dB-Hz)');
title (handles(4, 1), 'Carrier to Noise Ratio');
%----- Carrier Frequency --------------------------------
plot (handles(4, 2), timeAxisInSeconds, ...
trackResults(channelNr).carrFreq(1:settings.msToProcess), 'Color',[0.42 0.25 0.39]);
grid (handles(4, 2));
axis (handles(4, 2), 'tight');
xlabel(handles(4, 2), 'Time (s)');
ylabel(handles(4, 2), 'Freq (hz)');
title (handles(4, 2), 'Carrier Freq');
%----- Code Frequency----------------------------------
plot (handles(4, 3), timeAxisInSeconds, ...
trackResults(channelNr).codeFreq(1:settings.msToProcess), 'Color',[0.2 0.3 0.49]);
grid (handles(4, 3));
axis (handles(4, 3), 'tight');
xlabel(handles(4, 3), 'Time (s)');
ylabel(handles(4, 3), 'Freq (Hz)');
title (handles(4, 3), 'Code Freq');
end % for channelNr = channelList