mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
LimeSDR source is now operative
This commit is contained in:
parent
514bb331ce
commit
a694033755
@ -16,16 +16,20 @@
|
||||
|
||||
#include "limesdr_signal_source.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_string_literals.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Limesdr_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
const std::string empty;
|
||||
@ -43,16 +47,23 @@ LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configura
|
||||
gain_ = configuration->property(role + ".gain", 40.0);
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6);
|
||||
//todo: check aif bw is within limits
|
||||
analog_bw_hz_ = configuration->property(role + ".analog_bw", sample_rate_);
|
||||
digital_bw_hz_ = configuration->property(role + ".digital_bw", sample_rate_);
|
||||
analog_bw_hz_ = configuration->property(role + ".analog_bw", sample_rate_ / 2); //LPF analog filters in I,Q branches
|
||||
digital_bw_hz_ = configuration->property(role + ".digital_bw", 0); //disable by default
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
limesdr_serial_ = configuration->property(role + ".limesdr_serial", std::string());
|
||||
limesdr_file_ = configuration->property(role + ".limesdr_file", std::string());
|
||||
antenna_ = configuration->property(role + ".antenna", 255);
|
||||
|
||||
PPS_mode_ = configuration->property(role + ".PPS_mode", false);
|
||||
//channel_mode Channel and mode selection A(1), B(2), (A+B)MIMO(3).
|
||||
limechannel_mode_ = configuration->property(role + ".limechannel_mode", 1);
|
||||
ext_clock_MHz_ = configuration->property(role + ".ext_clock_MHz", 0.0); //external clock: 0.0 MHz will enable the internal clock
|
||||
limechannel_mode_ = configuration->property(role + ".limechannel_mode", 0);
|
||||
if (limechannel_mode_ < 0 && limechannel_mode_ > 2)
|
||||
{
|
||||
std::cout
|
||||
<< "ERROR: source_impl::source_impl(): ChannelMode must be A(0), B(1) or (A+B) MIMO(2)"
|
||||
<< std::endl;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
if (item_type_ == "short")
|
||||
@ -68,6 +79,21 @@ LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configura
|
||||
{
|
||||
#ifdef LimeSDR_PPS
|
||||
limesdr_source_ = gr::limesdr::source::make(limesdr_serial_, limechannel_mode_, limesdr_file_, PPS_mode_);
|
||||
if (ext_clock_MHz_ != 0.0)
|
||||
{
|
||||
if (limesdr_source_->set_ext_clk(ext_clock_MHz_))
|
||||
{
|
||||
std::cout << "External clock enabled with expected frequency input of " << ext_clock_MHz_ << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error setting external reference clock\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
limesdr_source_->disable_ext_clk();
|
||||
}
|
||||
#else
|
||||
limesdr_source_ = gr::limesdr::source::make(limesdr_serial_, limechannel_mode_, limesdr_file_);
|
||||
#endif
|
||||
@ -123,9 +149,12 @@ LimesdrSignalSource::LimesdrSignalSource(const ConfigurationInterface* configura
|
||||
// Set analog bandwidth
|
||||
double actual_analog_bw = limesdr_source_->set_bandwidth(analog_bw_hz_, channel_);
|
||||
std::cout << "Actual Analog Bandwidth: " << actual_analog_bw << " [Hz]...\n";
|
||||
LOG(INFO) << "Actual Analog Bandwidth: : " << actual_analog_bw << " [Hz]...";
|
||||
|
||||
// Set digital bandwidth
|
||||
limesdr_source_->set_digital_filter(digital_bw_hz_, channel_);
|
||||
|
||||
limesdr_source_->calibrate(sample_rate_ / 2, channel_);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
||||
#define GNSS_SDR_LIMESDR_SIGNAL_SOURCE_H
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <pmt/pmt.h>
|
||||
#include <cstdint>
|
||||
@ -39,7 +39,7 @@ class ConfigurationInterface;
|
||||
* \brief This class instantiates the LimeSDR gnuradio signal source.
|
||||
* It has support also for a customized LimeSDR firmware and signal source to support PPS samplestamp reading.
|
||||
*/
|
||||
class LimesdrSignalSource : public GNSSBlockInterface
|
||||
class LimesdrSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
LimesdrSignalSource(const ConfigurationInterface* configuration,
|
||||
@ -48,19 +48,6 @@ public:
|
||||
|
||||
~LimesdrSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Osmosdr_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Limesdr_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@ -90,6 +77,7 @@ private:
|
||||
double gain_;
|
||||
double analog_bw_hz_;
|
||||
double digital_bw_hz_;
|
||||
double ext_clock_MHz_;
|
||||
size_t item_size_;
|
||||
int64_t samples_;
|
||||
|
||||
|
@ -170,6 +170,10 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)),
|
||||
{
|
||||
std::cout << "msg Bad any_cast: " << e.what();
|
||||
}
|
||||
catch (const std::exception &ee)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
//************* end time tags **************
|
||||
|
@ -100,6 +100,10 @@ if(ENABLE_OSMOSDR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_LIMESDR)
|
||||
target_compile_definitions(core_receiver PRIVATE -DLIMESDR_DRIVER=1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_ARRAY)
|
||||
target_compile_definitions(core_receiver PRIVATE -DRAW_ARRAY_DRIVER=1)
|
||||
endif()
|
||||
|
@ -163,6 +163,10 @@
|
||||
#include "ad9361_fpga_signal_source.h"
|
||||
#endif
|
||||
|
||||
#if LIMESDR_DRIVER
|
||||
#include "limesdr_signal_source.h"
|
||||
#endif
|
||||
|
||||
#if FLEXIBAND_DRIVER
|
||||
#include "flexiband_signal_source.h"
|
||||
#endif
|
||||
@ -747,6 +751,16 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LIMESDR_DRIVER
|
||||
else if (implementation == "Limesdr_Signal_Source")
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface>
|
||||
block_ = std::make_unique<LimesdrSignalSource>(configuration, role, in_streams,
|
||||
out_streams, queue);
|
||||
block = std::move(block_);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PLUTOSDR_DRIVER
|
||||
else if (implementation == "Plutosdr_Signal_Source")
|
||||
{
|
||||
|
@ -21,13 +21,13 @@ if ~exist('dll_pll_veml_read_tracking_dump.m', 'file')
|
||||
addpath('./libs')
|
||||
end
|
||||
|
||||
samplingFreq = 2048000; %[Hz]
|
||||
plot_last_outputs=0;
|
||||
samplingFreq = 3000000; %[Hz]
|
||||
plot_last_outputs=0;%1000;
|
||||
|
||||
channels = 8; % Number of channels
|
||||
channels = 1; % Number of channels
|
||||
first_channel = 0; % Number of the first channel
|
||||
|
||||
path = '/Users/javier/git/gnss-sdr/build/test_postpro_24h_casa/'; %% CHANGE THIS PATH
|
||||
path = '/home/javier/git/gnss-sdr/install/test_inta/'; %% CHANGE THIS PATH
|
||||
|
||||
for N=1:1:channels
|
||||
tracking_log_path = [path 'tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE track_ch_ BY YOUR dump_filename
|
||||
|
Loading…
Reference in New Issue
Block a user