mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-07 18:54:06 +00:00
Now GNSS-SDR also builds on Mac OS X 10.9 Mavericks using clang++ and libc++. Updated cmake scripts, some modification of code not accepted by clang. Updated README with instructions for Mavericks. Fixed file length computation in 64-bit architectures.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@435 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
@@ -52,7 +52,7 @@ include_directories(
|
||||
if(OPENCL_FOUND)
|
||||
include_directories( ${OPENCL_INCLUDE_DIRS} )
|
||||
if(OS_IS_MACOSX)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL")
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL")
|
||||
else(OS_IS_MACOSX)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES})
|
||||
endif(OS_IS_MACOSX)
|
||||
|
||||
@@ -122,8 +122,8 @@ galileo_e1_gen(std::complex<float>* _dest, int* _prn, char _Signal[3])
|
||||
const float alpha = sqrt(10.0 / 11.0);
|
||||
const float beta = sqrt(1.0 / 11.0);
|
||||
|
||||
std::complex<float> sinboc_11[_codeLength]; // 12*4092 (_codeLength not accepted by Clang )
|
||||
std::complex<float> sinboc_61[_codeLength];
|
||||
std::complex<float> sinboc_11[12*4092]; // _codeLength not accepted by Clang
|
||||
std::complex<float> sinboc_61[12*4092];
|
||||
|
||||
galileo_e1_sinboc_11_gen(sinboc_11, _prn, _codeLength); //generate sinboc(1,1) 12 samples per chip
|
||||
galileo_e1_sinboc_61_gen(sinboc_61, _prn, _codeLength); //generate sinboc(6,1) 12 samples per chip
|
||||
@@ -154,7 +154,7 @@ galileo_e1_code_gen_complex_sampled(std::complex<float>* _dest, char _Signal[3],
|
||||
bool _secondary_flag)
|
||||
{
|
||||
|
||||
// This function is based on the GNU software GPS for MATLAB in the Kay Borre bookç
|
||||
// This function is based on the GNU software GPS for MATLAB in Kay Borre's book
|
||||
|
||||
std::string _galileo_signal = _Signal;
|
||||
unsigned int _samplesPerCode;
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
//#ifdef HAVE_CONFIG_H
|
||||
//#include "config.h"
|
||||
//#endif
|
||||
|
||||
#include "signal_generator_c.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
@@ -57,23 +54,23 @@ signal_make_generator_c (std::vector<std::string> system, const std::vector<unsi
|
||||
* The private constructor
|
||||
*/
|
||||
signal_generator_c::signal_generator_c (std::vector<std::string> system, const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips, bool data_flag, bool noise_flag,
|
||||
unsigned int fs_in, unsigned int vector_length, float BW_BB) :
|
||||
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips, bool data_flag, bool noise_flag,
|
||||
unsigned int fs_in, unsigned int vector_length, float BW_BB) :
|
||||
|
||||
gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)*vector_length)),
|
||||
system_(system),
|
||||
PRN_(PRN),
|
||||
CN0_dB_(CN0_dB),
|
||||
doppler_Hz_(doppler_Hz),
|
||||
delay_chips_(delay_chips),
|
||||
data_flag_(data_flag),
|
||||
noise_flag_(noise_flag),
|
||||
fs_in_(fs_in),
|
||||
num_sats_(PRN.size()),
|
||||
vector_length_(vector_length),
|
||||
BW_BB_(BW_BB*(float)fs_in/2.0)
|
||||
gr::block ("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)*vector_length)),
|
||||
system_(system),
|
||||
PRN_(PRN),
|
||||
CN0_dB_(CN0_dB),
|
||||
doppler_Hz_(doppler_Hz),
|
||||
delay_chips_(delay_chips),
|
||||
data_flag_(data_flag),
|
||||
noise_flag_(noise_flag),
|
||||
fs_in_(fs_in),
|
||||
num_sats_(PRN.size()),
|
||||
vector_length_(vector_length),
|
||||
BW_BB_(BW_BB*(float)fs_in/2.0)
|
||||
{
|
||||
init();
|
||||
generate_codes();
|
||||
@@ -143,7 +140,7 @@ void signal_generator_c::generate_codes()
|
||||
if (posix_memalign((void**)&(sampled_code_data_[sat]), 16,
|
||||
vector_length_ * sizeof(gr_complex)) == 0){};
|
||||
|
||||
gr_complex code[samples_per_code_[sat]];
|
||||
gr_complex code[8000];//[samples_per_code_[sat]];
|
||||
|
||||
if (system_[sat] == "G")
|
||||
{
|
||||
|
||||
@@ -90,5 +90,9 @@ include_directories(
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(ARCH_64BITS)
|
||||
add_definitions(-DARCH_64BITS=1)
|
||||
endif(ARCH_64BITS)
|
||||
|
||||
add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES})
|
||||
target_link_libraries(signal_source_adapters signal_source_gr_blocks ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${OPT_LIBRARIES} gnss_sp_libs)
|
||||
|
||||
@@ -142,13 +142,16 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
samples_ = floor((double)size / (double)item_size() - ceil(0.002 * (double)sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms
|
||||
samples_ = floor((double)size / (double)item_size() - ceil(0.002 * (double)sampling_frequency_)); //process all the samples available in the file excluding at least the last 1 ms
|
||||
}
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
|
||||
#ifdef ARCH_64BITS
|
||||
signal_duration_s /= 2;
|
||||
#endif
|
||||
DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user