1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-30 02:44:50 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2015-05-25 18:47:26 +02:00
commit 5eedb1975e
4 changed files with 32 additions and 25 deletions

View File

@ -107,14 +107,14 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
int samples_per_ms = round(code_length_); int samples_per_ms = round(code_length_);
code_= new gr_complex[code_length_]; code_ = new gr_complex[code_length_]();
/*Object relevant information for debugging*/ /*Object relevant information for debugging*/
LOG(INFO) <<"Implementation: "<<this->implementation() LOG(INFO) << "Implementation: " << this->implementation()
<<", Vector Length: "<<vector_length_ << ", Vector Length: " << vector_length_
<<", Samples per ms: "<<samples_per_ms << ", Samples per ms: " << samples_per_ms
<<", Folding factor: "<<folding_factor_ << ", Folding factor: " << folding_factor_
<<", Sampled ms: "<<sampled_ms_ << ", Sampled ms: " << sampled_ms_
<<", Code Length: "<<code_length_; << ", Code Length: " << code_length_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
@ -168,7 +168,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold)
if(pfa == 0.0) if(pfa == 0.0)
{ {
pfa = configuration_->property(role_+".pfa", 0.0); pfa = configuration_->property(role_ + ".pfa", 0.0);
} }
if(pfa == 0.0) if(pfa == 0.0)
{ {
@ -255,7 +255,7 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_local_code()
{ {
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
std::complex<float>* code = new std::complex<float>[code_length_]; std::complex<float>* code = new std::complex<float>[code_length_]();
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);

View File

@ -119,7 +119,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
d_corr_acumulator = 0; d_corr_acumulator = 0;
d_signal_folded = 0; d_signal_folded = 0;
d_code_folded = 0; d_code_folded = new gr_complex[d_fft_size]();
d_noise_floor_power = 0; d_noise_floor_power = 0;
d_doppler_resolution = 0; d_doppler_resolution = 0;
d_threshold = 0; d_threshold = 0;
@ -132,7 +132,7 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
d_test_statistics = 0; d_test_statistics = 0;
d_channel_internal_queue = 0; d_channel_internal_queue = 0;
d_channel = 0; d_channel = 0;
d_code_folded = 0; //d_code_folded = 0;
// DLOG(INFO) << "END CONSTRUCTOR"; // DLOG(INFO) << "END CONSTRUCTOR";
} }
@ -174,7 +174,7 @@ void pcps_quicksync_acquisition_cc::set_local_code(std::complex<float>* code)
lation in time in the final steps of the acquisition stage*/ lation in time in the final steps of the acquisition stage*/
memcpy(d_code, code, sizeof(gr_complex) * d_samples_per_code); memcpy(d_code, code, sizeof(gr_complex) * d_samples_per_code);
d_code_folded = new gr_complex[d_fft_size](); //d_code_folded = new gr_complex[d_fft_size]();
memcpy(d_fft_if->get_inbuf(), d_code_folded, sizeof(gr_complex) * (d_fft_size)); memcpy(d_fft_if->get_inbuf(), d_code_folded, sizeof(gr_complex) * (d_fft_size));
/*perform folding of the code by the factorial factor parameter. Notice that /*perform folding of the code by the factorial factor parameter. Notice that
@ -204,6 +204,8 @@ void pcps_quicksync_acquisition_cc::init()
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
if(d_doppler_step == 0) d_doppler_step = 250;
// Count the number of bins // Count the number of bins
d_num_doppler_bins = 0; d_num_doppler_bins = 0;
for (int doppler = static_cast<int>(-d_doppler_max); for (int doppler = static_cast<int>(-d_doppler_max);
@ -472,7 +474,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
std::streamsize n = sizeof(float) * (d_fft_size); // complex file write std::streamsize n = sizeof(float) * (d_fft_size); // complex file write
filename.str(""); filename.str("");
filename << "../data/test_statistics_" << d_gnss_synchro->System filename << "../data/test_statistics_" << d_gnss_synchro->System
<<"_" << d_gnss_synchro->Signal << "_sat_" << "_" << d_gnss_synchro->Signal << "_sat_"
<< d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat"; << d_gnss_synchro->PRN << "_doppler_" << doppler << ".dat";
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary); d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
d_dump_file.write((char*)d_magnitude_folded, n); //write directly |abs(x)|^2 in this Doppler bin? d_dump_file.write((char*)d_magnitude_folded, n); //write directly |abs(x)|^2 in this Doppler bin?

View File

@ -98,11 +98,10 @@ void galileo_e5_a_code_gen_complex_primary(std::complex<float>* _dest, signed in
void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3], void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3],
unsigned int _prn, signed int _fs, unsigned int _chip_shift) unsigned int _prn, signed int _fs, unsigned int _chip_shift)
{ {
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
unsigned int _samplesPerCode; unsigned int _samplesPerCode;
unsigned int delay; unsigned int delay;
unsigned int _codeLength = Galileo_E5a_CODE_LENGTH_CHIPS; const unsigned int _codeLength = Galileo_E5a_CODE_LENGTH_CHIPS;
const int _codeFreqBasis = Galileo_E5a_CODE_CHIP_RATE_HZ; //Hz const int _codeFreqBasis = Galileo_E5a_CODE_CHIP_RATE_HZ;
std::complex<float>* _code = new std::complex<float>[_codeLength](); std::complex<float>* _code = new std::complex<float>[_codeLength]();
@ -114,17 +113,23 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex<float>* _dest, char _Sig
if (_fs != _codeFreqBasis) if (_fs != _codeFreqBasis)
{ {
std::complex<float>* _resampled_signal; std::complex<float>* _resampled_signal;
if (posix_memalign((void**)&_resampled_signal, 16, _samplesPerCode * sizeof(gr_complex)) == 0){}; if (posix_memalign((void**)&_resampled_signal, 16, _samplesPerCode * sizeof(gr_complex)) == 0){};
resampler(_code, _resampled_signal, _codeFreqBasis, _fs, _codeLength, _samplesPerCode); //resamples code to fs resampler(_code, _resampled_signal, _codeFreqBasis, _fs, _codeLength, _samplesPerCode); //resamples code to fs
delete[] _code; delete[] _code;
_code = _resampled_signal; _code = _resampled_signal;
} }
for (unsigned int i = 0; i < _samplesPerCode; i++) for (unsigned int i = 0; i < _samplesPerCode; i++)
{ {
_dest[(i + delay) % _samplesPerCode] = _code[i]; _dest[(i + delay) % _samplesPerCode] = _code[i];
} }
if (_fs != _codeFreqBasis)
delete[] _code; {
free(_code);
}
else
{
delete[] _code;
}
} }

View File

@ -935,11 +935,11 @@ void ControlThread::galileo_utc_model_data_collector()
void ControlThread::keyboard_listener() void ControlThread::keyboard_listener()
{ {
bool read_keys = true; bool read_keys = true;
char c; char c = '0';
while(read_keys) while(read_keys)
{ {
std::cin.get(c); std::cin.get(c);
if (c =='q') if (c == 'q')
{ {
std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl; std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());