1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-17 15:24:56 +00:00

Add glonass signal acquisition

This commit is contained in:
Gastd 2017-07-18 17:51:28 -03:00
parent 936c5d5bea
commit 52140c85f2
2 changed files with 39 additions and 0 deletions

View File

@ -41,6 +41,8 @@
#include <volk_gnsssdr/volk_gnsssdr.h>
#include "control_message_factory.h"
#include "GPS_L1_CA.h" //GPS_TWO_PI
#include "Glonass_L1_CA.h" //GLONASS_TWO_PI
using google::LogMessage;
@ -159,6 +161,11 @@ pcps_acquisition_sc::~pcps_acquisition_sc()
void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
{
// This will check if it's fdma, if yes will update the intermediate frequency and the doppler grid
if( is_fdma() )
{
update_grid_doppler_wipeoffs();
}
// COD
// Here we want to create a buffer that looks like this:
// [ 0 0 0 ... 0 c_0 c_1 ... c_L]
@ -175,6 +182,22 @@ void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
}
bool pcps_acquisition_sc::is_fdma()
{
// Dealing with FDMA system
if( strcmp(d_gnss_synchro->Signal,"1G") == 0 )
{
d_freq += DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN);
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN) << " in Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
return true;
}
else
{
return false;
}
}
void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
{
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
@ -211,6 +234,19 @@ void pcps_acquisition_sc::init()
}
void pcps_acquisition_sc::update_grid_doppler_wipeoffs()
{
// Create the carrier Doppler wipeoff signals
d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins];
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
{
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
}
}
void pcps_acquisition_sc::set_state(int state)
{

View File

@ -97,6 +97,9 @@ private:
int correlator_length_samples,
float freq);
void update_grid_doppler_wipeoffs();
bool is_fdma();
long d_fs_in;
long d_freq;
int d_samples_per_ms;