diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index 1422077ab..7be768a89 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -337,6 +337,8 @@ int hybrid_observables_cc::general_work (int noutput_items, d_dump_file.write((char*)&tmp_double, sizeof(double)); tmp_double = current_gnss_synchro[i].PRN; d_dump_file.write((char*)&tmp_double, sizeof(double)); + tmp_double = current_gnss_synchro[i].Flag_valid_pseudorange; + d_dump_file.write((char*)&tmp_double, sizeof(double)); } } catch (const std::ifstream::failure& e) diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc index 0773a5613..b9fc79d70 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc @@ -43,6 +43,7 @@ bool observables_dump_reader::read_binary_obs() d_dump_file.read((char *) &Acc_carrier_phase_hz[i], sizeof(double)); d_dump_file.read((char *) &Pseudorange_m[i], sizeof(double)); d_dump_file.read((char *) &PRN[i], sizeof(double)); + d_dump_file.read((char *) &valid[i], sizeof(double)); } } catch (const std::ifstream::failure &e) @@ -69,7 +70,7 @@ bool observables_dump_reader::restart() long int observables_dump_reader::num_epochs() { std::ifstream::pos_type size; - int number_of_vars_in_epoch = n_channels*6; + int number_of_vars_in_epoch = n_channels*7; int epoch_size_bytes = sizeof(double) * number_of_vars_in_epoch; std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate); if (tmpfile.is_open()) @@ -117,6 +118,7 @@ observables_dump_reader::observables_dump_reader(int n_channels_) Acc_carrier_phase_hz=new double[n_channels]; Pseudorange_m=new double[n_channels]; PRN=new double[n_channels]; + valid=new double[n_channels]; } observables_dump_reader::~observables_dump_reader() { @@ -130,4 +132,5 @@ observables_dump_reader::~observables_dump_reader() delete[] Acc_carrier_phase_hz; delete[] Pseudorange_m; delete[] PRN; + delete[] valid; } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h index acdffa2f2..205c5cd9b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h @@ -55,6 +55,7 @@ public: double* Acc_carrier_phase_hz; double* Pseudorange_m; double* PRN; + double* valid; private: int n_channels; diff --git a/src/utils/matlab/galileo_e1b_observables_plot_sample.m b/src/utils/matlab/galileo_e1b_observables_plot_sample.m deleted file mode 100644 index 604be3fe3..000000000 --- a/src/utils/matlab/galileo_e1b_observables_plot_sample.m +++ /dev/null @@ -1,22 +0,0 @@ -% Read observables dump - -clear all; -close all; - -%IFEN NSR Sampler Fs=20480000 -% GNSS-SDR decimation factor 8 -samplingFreq = 20480000/8; %[Hz] -channels=4; -path='/home/gnss/workspace/gnss-sdr/trunk/install/'; -observables_log_path=[path 'observables.dat']; -GNSS_observables= gps_l1_ca_read_observables_dump(channels,observables_log_path); - - -skip=9000; -ref_channel=1; -plot(GNSS_observables.d_TOW_at_current_symbol(ref_channel,skip:end),GNSS_observables.Pseudorange_m(:,skip:end).') -title('psudoranges'); -figure -plot(GNSS_observables.d_TOW_at_current_symbol(ref_channel,skip:end),GNSS_observables.Prn_timestamp_ms(:,skip:end).') -title('Prn_timestamps'); - \ No newline at end of file diff --git a/src/utils/matlab/gps_l1_ca_observables_plot_sample.m b/src/utils/matlab/gps_l1_ca_observables_plot_sample.m deleted file mode 100644 index c7a85a60f..000000000 --- a/src/utils/matlab/gps_l1_ca_observables_plot_sample.m +++ /dev/null @@ -1,9 +0,0 @@ -% Read observables dump - -%clear all; - -samplingFreq = 64e6/16; %[Hz] -channels=4; -path='/home/gnss/workspace/gnss-sdr/trunk/install/'; -observables_log_path=[path 'observables.dat']; -GNSS_observables= gps_l1_ca_read_observables_dump(channels,observables_log_path); diff --git a/src/utils/matlab/hybrid_observables_plot_sample.m b/src/utils/matlab/hybrid_observables_plot_sample.m new file mode 100644 index 000000000..eb3274b06 --- /dev/null +++ b/src/utils/matlab/hybrid_observables_plot_sample.m @@ -0,0 +1,39 @@ +% Read observables dump + +%clear all; + +samplingFreq = 2600000; %[Hz] +channels=2; +path='/home/javier/git/gnss-sdr/build/'; +observables_log_path=[path 'observables.dat']; +GNSS_observables= read_hybrid_observables_dump(channels,observables_log_path); + +%optional: +%search all channels having good satellite simultaneously +min_idx=1; +for n=1:1:channels + idx=find(GNSS_observables.valid(n,:)>0,1,'first'); + if min_idx