mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Add warning if sample rates are not consistent
This commit is contained in:
parent
43862991e9
commit
10cd79591b
@ -30,6 +30,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "direct_resampler_conditioner.h"
|
#include "direct_resampler_conditioner.h"
|
||||||
|
#include <cmath>
|
||||||
|
#include <limits>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/blocks/file_sink.h>
|
#include <gnuradio/blocks/file_sink.h>
|
||||||
#include <volk/volk.h>
|
#include <volk/volk.h>
|
||||||
@ -38,7 +40,6 @@
|
|||||||
#include "direct_resampler_conditioner_cb.h"
|
#include "direct_resampler_conditioner_cb.h"
|
||||||
#include "configuration_interface.h"
|
#include "configuration_interface.h"
|
||||||
|
|
||||||
|
|
||||||
using google::LogMessage;
|
using google::LogMessage;
|
||||||
|
|
||||||
DirectResamplerConditioner::DirectResamplerConditioner(
|
DirectResamplerConditioner::DirectResamplerConditioner(
|
||||||
@ -48,8 +49,17 @@ DirectResamplerConditioner::DirectResamplerConditioner(
|
|||||||
{
|
{
|
||||||
std::string default_item_type = "short";
|
std::string default_item_type = "short";
|
||||||
std::string default_dump_file = "./data/signal_conditioner.dat";
|
std::string default_dump_file = "./data/signal_conditioner.dat";
|
||||||
|
double fs_in;
|
||||||
|
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
|
||||||
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", (double)4000000.0);
|
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", (double)4000000.0);
|
||||||
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", (double)2048000.0);
|
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
|
||||||
|
if(std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())
|
||||||
|
{
|
||||||
|
std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_hz and "
|
||||||
|
+ role_ + ".sample_freq_out are not set to the same value!" ;
|
||||||
|
LOG(WARNING) << aux_warn;
|
||||||
|
std::cout << aux_warn << std::endl;
|
||||||
|
}
|
||||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||||
dump_ = configuration->property(role + ".dump", false);
|
dump_ = configuration->property(role + ".dump", false);
|
||||||
DLOG(INFO) << "dump_ is " << dump_;
|
DLOG(INFO) << "dump_ is " << dump_;
|
||||||
|
Loading…
Reference in New Issue
Block a user