mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 02:10:34 +00:00
cleaned the acquisition code that runs in the Zynq SoC, cleaned some tracking files that run in the Zynq SoC as well.
This commit is contained in:
parent
28058000de
commit
de2043ca00
@ -41,6 +41,7 @@ Acquisition_1C.item_type=cshort
|
||||
Acquisition_1C.if=0
|
||||
Acquisition_1C.sampled_ms=1
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fpga
|
||||
Acquisition_1C.select_queue_Fpga=0;
|
||||
Acquisition_1C.threshold=0.005
|
||||
;Acquisition_1C.pfa=0.01
|
||||
Acquisition_1C.doppler_max=10000
|
||||
|
@ -67,6 +67,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
// note : the FPGA is implemented according to use_CFAR_algorithm = 0. Setting use_CFAR_algorithm to 1 has no effect.
|
||||
use_CFAR_algorithm_flag_=configuration_->property(role + ".use_CFAR_algorithm", false);
|
||||
|
||||
// note : the FPGA does not use the max_dwells variable.
|
||||
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
@ -90,12 +91,14 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
|
||||
code_ = new gr_complex[vector_length_];
|
||||
|
||||
select_queue_Fpga_ = configuration_->property(role + ".select_queue_Fpga", 0);
|
||||
|
||||
if (item_type_.compare("cshort") == 0 )
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
gps_acquisition_fpga_sc_ = gps_pcps_make_acquisition_fpga_sc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_, vector_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, select_queue_Fpga_, dump_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << gps_acquisition_fpga_sc_->unique_id() << ")";
|
||||
|
||||
}
|
||||
@ -103,6 +106,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
LOG(FATAL) << item_type_ << " FPGA only accepts chsort";
|
||||
}
|
||||
|
||||
|
||||
channel_ = 0;
|
||||
threshold_ = 0.0;
|
||||
doppler_step_ = 0;
|
||||
@ -199,8 +203,6 @@ void GpsL1CaPcpsAcquisitionFpga::set_local_code()
|
||||
code[s] = std::complex<float>(0, 0);
|
||||
}
|
||||
|
||||
unsigned long long interpolated_sampling_frequency; // warning: we need a long long to do this conversion to avoid running out of bits
|
||||
|
||||
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_ , 0);
|
||||
|
||||
for (unsigned int i = 0; i < sampled_ms_; i++)
|
||||
|
@ -164,6 +164,8 @@ private:
|
||||
|
||||
unsigned int nsamples_total_;
|
||||
|
||||
unsigned int select_queue_Fpga_;
|
||||
|
||||
float calculate_threshold(float pfa);
|
||||
};
|
||||
|
||||
|
@ -54,13 +54,14 @@ gps_pcps_acquisition_fpga_sc_sptr gps_pcps_make_acquisition_fpga_sc(
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code, int vector_length,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
unsigned int select_queue_Fpga,
|
||||
bool dump,
|
||||
std::string dump_filename)
|
||||
{
|
||||
|
||||
return gps_pcps_acquisition_fpga_sc_sptr(
|
||||
new gps_pcps_acquisition_fpga_sc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, vector_length, bit_transition_flag, use_CFAR_algorithm_flag, dump, dump_filename));
|
||||
samples_per_code, vector_length, bit_transition_flag, use_CFAR_algorithm_flag, select_queue_Fpga, dump, dump_filename));
|
||||
}
|
||||
|
||||
gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc(
|
||||
@ -68,6 +69,7 @@ gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc(
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code, int vector_length,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
unsigned int select_queue_Fpga,
|
||||
bool dump,
|
||||
std::string dump_filename) :
|
||||
|
||||
@ -82,15 +84,15 @@ gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc(
|
||||
d_samples_per_ms = samples_per_ms;
|
||||
d_samples_per_code = samples_per_code;
|
||||
d_sampled_ms = sampled_ms;
|
||||
d_max_dwells = max_dwells;
|
||||
d_max_dwells = max_dwells; // Note : d_max_dwells is not used in the FPGA implementation
|
||||
d_well_count = 0;
|
||||
d_doppler_max = doppler_max;
|
||||
d_fft_size = d_sampled_ms * d_samples_per_ms;
|
||||
d_mag = 0;
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag;
|
||||
d_bit_transition_flag = bit_transition_flag; // Note : bit transition flag is ignored and assumed 0 in the FPGA implementation
|
||||
d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag; // Note : user CFAR algorithm flag is ignored and assumed 0 in the FPGA implementation
|
||||
d_threshold = 0.0;
|
||||
d_doppler_step = 250;
|
||||
d_code_phase = 0;
|
||||
@ -100,21 +102,11 @@ gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc(
|
||||
|
||||
d_nsamples_total = vector_length;
|
||||
|
||||
// COD:
|
||||
// Experimenting with the overlap/save technique for handling bit trannsitions
|
||||
// The problem: Circular correlation is asynchronous with the received code.
|
||||
// In effect the first code phase used in the correlation is the current
|
||||
// estimate of the code phase at the start of the input buffer. If this is 1/2
|
||||
// of the code period a bit transition would move all the signal energy into
|
||||
// adjacent frequency bands at +/- 1/T where T is the integration time.
|
||||
//
|
||||
// We can avoid this by doing linear correlation, effectively doubling the
|
||||
// size of the input buffer and padding the code with zeros.
|
||||
if( d_bit_transition_flag )
|
||||
{
|
||||
d_fft_size *= 2;
|
||||
d_max_dwells = 1;
|
||||
}
|
||||
//if( d_bit_transition_flag )
|
||||
// {
|
||||
// d_fft_size *= 2;
|
||||
// d_max_dwells = 1;
|
||||
// }
|
||||
|
||||
d_fft_codes = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
d_magnitude = static_cast<float*>(volk_gnsssdr_malloc(d_nsamples_total * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
@ -130,6 +122,9 @@ gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc(
|
||||
// Inverse FFT
|
||||
d_ifft = new gr::fft::fft_complex(d_nsamples_total, false);
|
||||
|
||||
// FPGA queue selection
|
||||
d_select_queue_Fpga = select_queue_Fpga;
|
||||
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
@ -185,11 +180,11 @@ void gps_pcps_acquisition_fpga_sc::set_local_code(std::complex<float> * code)
|
||||
|
||||
|
||||
int offset = 0;
|
||||
if( d_bit_transition_flag )
|
||||
{
|
||||
std::fill_n( d_fft_if->get_inbuf(), d_nsamples_total, gr_complex( 0.0, 0.0 ) );
|
||||
offset = d_nsamples_total;
|
||||
}
|
||||
// if( d_bit_transition_flag )
|
||||
// {
|
||||
// std::fill_n( d_fft_if->get_inbuf(), d_nsamples_total, gr_complex( 0.0, 0.0 ) );
|
||||
// offset = d_nsamples_total;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@ -204,8 +199,6 @@ void gps_pcps_acquisition_fpga_sc::set_local_code(std::complex<float> * code)
|
||||
|
||||
void gps_pcps_acquisition_fpga_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
||||
{
|
||||
static int debugint = 0;
|
||||
|
||||
|
||||
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
|
||||
|
||||
@ -240,9 +233,7 @@ void gps_pcps_acquisition_fpga_sc::init()
|
||||
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);
|
||||
}
|
||||
// PENDING : SELECT_QUEUE MUST GO INTO CONFIGURATION
|
||||
unsigned select_queue = 0;
|
||||
acquisition_fpga_8sc.init(d_fft_size, d_nsamples_total, d_freq, d_doppler_max, d_doppler_step, d_num_doppler_bins, d_fs_in, select_queue);
|
||||
acquisition_fpga_8sc.init(d_fft_size, d_nsamples_total, d_freq, d_doppler_max, d_doppler_step, d_num_doppler_bins, d_fs_in, d_select_queue_Fpga);
|
||||
|
||||
|
||||
|
||||
@ -290,8 +281,8 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
d_active = active;
|
||||
|
||||
|
||||
while (d_well_count < d_max_dwells)
|
||||
{
|
||||
// while (d_well_count < d_max_dwells)
|
||||
// {
|
||||
int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
|
||||
d_state = 1;
|
||||
@ -300,9 +291,9 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
int doppler;
|
||||
uint32_t indext = 0;
|
||||
float magt = 0.0;
|
||||
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
//int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||
int effective_fft_size = d_fft_size;
|
||||
//float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_mag = 0.0;
|
||||
|
||||
@ -312,7 +303,7 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN
|
||||
//<< " ,sample stamp: " << d_sample_counter << ", threshold: "
|
||||
<< " ,sample stamp: " << d_sample_counter << ", threshold: "
|
||||
<< ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
@ -329,6 +320,8 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
|
||||
acquisition_fpga_8sc.read_acquisition_results(&indext, &magt, &initial_sample, &d_input_power);
|
||||
|
||||
d_sample_counter = initial_sample;
|
||||
|
||||
temp_peak_to_noise_level = (float) (magt / d_input_power);
|
||||
if (peak_to_noise_level < temp_peak_to_noise_level)
|
||||
{
|
||||
@ -337,13 +330,13 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
|
||||
d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
|
||||
|
||||
if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
{
|
||||
//if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
// {
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
|
||||
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
|
||||
d_gnss_synchro->Acq_samplestamp_samples = initial_sample;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter;
|
||||
d_test_statistics = d_mag / d_input_power;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
// Record results to file if required
|
||||
@ -379,8 +372,7 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
// 6.1- Declare positive acquisition using a message port
|
||||
DLOG(INFO) << "positive acquisition";
|
||||
DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN;
|
||||
//DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "sample_stamp " << initial_sample;
|
||||
DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "test statistics value " << d_test_statistics;
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
@ -394,7 +386,7 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
acquisition_message = 1;
|
||||
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
|
||||
|
||||
break;
|
||||
// break;
|
||||
|
||||
}
|
||||
else //if (d_well_count == d_max_dwells)
|
||||
@ -405,7 +397,6 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
DLOG(INFO) << "negative acquisition";
|
||||
DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN;
|
||||
DLOG(INFO) << "sample_stamp " << d_sample_counter;
|
||||
DLOG(INFO) << "sample_stamp " << initial_sample;
|
||||
DLOG(INFO) << "test statistics value " << d_test_statistics;
|
||||
DLOG(INFO) << "test statistics threshold " << d_threshold;
|
||||
DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples;
|
||||
@ -419,10 +410,10 @@ void gps_pcps_acquisition_fpga_sc::set_active(bool active)
|
||||
acquisition_message = 2;
|
||||
this->message_port_pub(pmt::mp("events"), pmt::from_long(acquisition_message));
|
||||
|
||||
break;
|
||||
// break;
|
||||
}
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
acquisition_fpga_8sc.unblock_samples();
|
||||
|
||||
@ -435,6 +426,6 @@ int gps_pcps_acquisition_fpga_sc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
{
|
||||
|
||||
// general work not used with the acquisition
|
||||
return noutput_items;
|
||||
}
|
||||
|
@ -66,6 +66,7 @@ gps_pcps_make_acquisition_fpga_sc(unsigned int sampled_ms, unsigned int max_dwel
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code, int vector_length_,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
unsigned int select_queue_Fpga,
|
||||
bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
@ -83,6 +84,7 @@ private:
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code, int vector_length,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
unsigned int select_queue_Fpga,
|
||||
bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
@ -90,6 +92,7 @@ private:
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code, int vector_length,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
unsigned int select_queue_Fpga,
|
||||
bool dump,
|
||||
std::string dump_filename);
|
||||
|
||||
@ -132,6 +135,7 @@ private:
|
||||
int d_state;
|
||||
bool d_dump;
|
||||
unsigned int d_channel;
|
||||
unsigned int d_select_queue_Fpga;
|
||||
std::string d_dump_filename;
|
||||
|
||||
gps_fpga_acquisition_8sc acquisition_fpga_8sc;
|
||||
|
@ -76,11 +76,10 @@
|
||||
bool gps_fpga_acquisition_8sc::init(unsigned int fft_size, unsigned int nsamples_total, long freq, unsigned int doppler_max, unsigned int doppler_step, int num_doppler_bins, long fs_in, unsigned select_queue)
|
||||
{
|
||||
float phase_step_rad_fpga;
|
||||
float phase_step_rad_fpga_real;
|
||||
|
||||
d_phase_step_rad_vector = new float[num_doppler_bins];
|
||||
|
||||
for (unsigned int doppler_index = 0; doppler_index < num_doppler_bins; doppler_index++)
|
||||
for (int doppler_index = 0; doppler_index < num_doppler_bins; doppler_index++)
|
||||
{
|
||||
int doppler = -static_cast<int>(doppler_max) + doppler_step * doppler_index;
|
||||
float phase_step_rad = GPS_TWO_PI * (freq + doppler) / static_cast<float>(fs_in);
|
||||
@ -116,6 +115,7 @@
|
||||
|
||||
d_nsamples = fft_size;
|
||||
d_nsamples_total = nsamples_total;
|
||||
d_select_queue = select_queue;
|
||||
|
||||
gps_fpga_acquisition_8sc::configure_acquisition();
|
||||
|
||||
@ -126,8 +126,7 @@
|
||||
|
||||
bool gps_fpga_acquisition_8sc::set_local_code(gr_complex* fft_codes)
|
||||
{
|
||||
int i;
|
||||
float val;
|
||||
unsigned int i;
|
||||
float max = 0;
|
||||
d_fft_codes = new lv_16sc_t[d_nsamples_total];
|
||||
|
||||
|
@ -75,7 +75,7 @@ private:
|
||||
|
||||
unsigned int d_nsamples_total; // total number of samples in the fft including padding
|
||||
unsigned int d_nsamples; // number of samples not including padding
|
||||
unsigned int d_select_queue =0; // queue selection
|
||||
unsigned int d_select_queue; // queue selection
|
||||
|
||||
// FPGA private functions
|
||||
unsigned fpga_acquisition_test_register(unsigned writeval);
|
||||
|
@ -151,7 +151,7 @@ gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::gps_l1_ca_dll_pll_c_aid_tracking_fpga_
|
||||
d_local_code_shift_chips[1] = 0.0;
|
||||
d_local_code_shift_chips[2] = d_early_late_spc_chips;
|
||||
|
||||
multicorrelator_fpga_8sc.init(2 * d_correlation_length_samples, d_n_correlator_taps);
|
||||
multicorrelator_fpga_8sc.init(d_n_correlator_taps);
|
||||
|
||||
//--- Perform initializations ------------------------------
|
||||
// define initial code frequency basis of NCO
|
||||
|
@ -72,11 +72,8 @@
|
||||
|
||||
|
||||
|
||||
bool fpga_multicorrelator_8sc::init(
|
||||
int max_signal_length_samples,
|
||||
int n_correlators)
|
||||
bool fpga_multicorrelator_8sc::init(int n_correlators)
|
||||
{
|
||||
size_t size = max_signal_length_samples * sizeof(lv_16sc_t);
|
||||
d_n_correlators = n_correlators;
|
||||
|
||||
// instantiate variable length vectors
|
||||
@ -117,7 +114,7 @@ bool fpga_multicorrelator_8sc::set_output_vectors(lv_16sc_t* corr_out)
|
||||
}
|
||||
|
||||
|
||||
void fpga_multicorrelator_8sc::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips)
|
||||
void fpga_multicorrelator_8sc::update_local_code(float rem_code_phase_chips)
|
||||
{
|
||||
d_rem_code_phase_chips = rem_code_phase_chips;
|
||||
|
||||
@ -133,7 +130,7 @@ bool fpga_multicorrelator_8sc::Carrier_wipeoff_multicorrelator_resampler(
|
||||
float code_phase_step_chips,
|
||||
int signal_length_samples)
|
||||
{
|
||||
update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips);
|
||||
update_local_code(rem_code_phase_chips);
|
||||
|
||||
d_rem_carrier_phase_in_rad = rem_carrier_phase_in_rad;
|
||||
d_code_phase_step_chips = code_phase_step_chips;
|
||||
@ -327,7 +324,6 @@ void fpga_multicorrelator_8sc::fpga_configure_code_parameters_in_fpga(void)
|
||||
void fpga_multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(void)
|
||||
{
|
||||
float d_rem_carrier_phase_in_rad_temp;
|
||||
float d_phase_step_rad_int_temp;
|
||||
|
||||
d_code_phase_step_chips_num = (unsigned) roundf(MAX_CODE_RESAMPLER_COUNTER * d_code_phase_step_chips);
|
||||
|
||||
|
@ -50,10 +50,10 @@ class fpga_multicorrelator_8sc
|
||||
public:
|
||||
fpga_multicorrelator_8sc();
|
||||
~fpga_multicorrelator_8sc();
|
||||
bool init(int max_signal_length_samples, int n_correlators);
|
||||
bool init(int n_correlators);
|
||||
bool set_local_code_and_taps(int code_length_chips, const lv_16sc_t* local_code_in, float *shifts_chips);
|
||||
bool set_output_vectors(lv_16sc_t* corr_out);
|
||||
void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips);
|
||||
void update_local_code(float rem_code_phase_chips);
|
||||
bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples);
|
||||
bool free();
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/chrono.hpp>
|
||||
//#include <stdio.h>
|
||||
#include <gnuradio/top_block.h>
|
||||
#include <gnuradio/blocks/file_source.h>
|
||||
#include <gnuradio/analog/sig_source_waveform.h>
|
||||
@ -143,7 +142,7 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, const char
|
||||
|
||||
int transfer_size;
|
||||
int num_transferred_samples = 0;
|
||||
while (num_transferred_samples< fileLen/FLOAT_SIZE)
|
||||
while (num_transferred_samples < (int) (fileLen/FLOAT_SIZE))
|
||||
{
|
||||
if (((fileLen/FLOAT_SIZE) - num_transferred_samples) > DMA_ACQ_TRANSFER_SIZE)
|
||||
{
|
||||
@ -274,7 +273,6 @@ void GpsL1CaPcpsAcquisitionTestFpga::init()
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
gnss_synchro.PRN = 1;
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
|
||||
//config->set_property("Acquisition.item_type", "gr_complex");
|
||||
config->set_property("Acquisition.item_type", "cshort");
|
||||
config->set_property("Acquisition.if", "0");
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", "1");
|
||||
@ -285,6 +283,7 @@ void GpsL1CaPcpsAcquisitionTestFpga::init()
|
||||
config->set_property("Acquisition.doppler_step", "500");
|
||||
config->set_property("Acquisition.repeat_satellite", "false");
|
||||
config->set_property("Acquisition.pfa", "0.0");
|
||||
config->set_property("Acquisition.select_queue_Fpga", "0");
|
||||
}
|
||||
|
||||
|
||||
@ -306,9 +305,6 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults)
|
||||
double expected_doppler_hz = 1680;
|
||||
init();
|
||||
|
||||
|
||||
|
||||
|
||||
std::shared_ptr<GpsL1CaPcpsAcquisitionFpga> acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 1);
|
||||
|
||||
boost::shared_ptr<GpsL1CaPcpsAcquisitionTestFpga_msg_rx> msg_rx = GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make();
|
||||
@ -337,15 +333,17 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults)
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
// uncomment the next line to load the file from the current directory
|
||||
std::string file = "./GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
|
||||
|
||||
// uncomment the next two lines to load the file from the signal samples subdirectory
|
||||
//std::string path = std::string(TEST_PATH);
|
||||
//std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
|
||||
|
||||
const char * file_name = file.c_str();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
//std::string path = std::string(TEST_PATH);
|
||||
//std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat";
|
||||
//std::string file = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
|
||||
|
||||
// for the unit test use dummy blocks to make the flowgraph work and allow the acquisition message to be sent.
|
||||
// for the unit test use dummy blocks to make the flowgraph work and allow the acquisition message to be sent.
|
||||
// in the actual system there is a flowchart running in parallel so this is not needed
|
||||
|
||||
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
|
||||
@ -375,9 +373,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults)
|
||||
|
||||
t3.join();
|
||||
|
||||
|
||||
unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
|
||||
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
std::cout << "Ran GpsL1CaPcpsAcquisitionTestFpga in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
|
||||
|
@ -77,7 +77,6 @@ void wait(int seconds)
|
||||
|
||||
void send_tracking_gps_input_samples(FILE *ptr_myfile, int num_remaining_samples, gr::top_block_sptr top_block)
|
||||
{
|
||||
int sample_pointer;
|
||||
int num_samples_transferred = 0;
|
||||
static int flowgraph_stopped = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user