From 3491fed625ecc4953ae2f63fa12852562ea07e05 Mon Sep 17 00:00:00 2001 From: Vladisslav P Date: Wed, 6 Jul 2022 08:25:50 +0300 Subject: [PATCH] osmosdr signal source: implement bandwidth selection New config file parameter: SignalSource.if_bw= Signed-off-by: Vladisslav P --- .../signal_source/adapters/osmosdr_signal_source.cc | 7 +++++++ .../signal_source/adapters/osmosdr_signal_source.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index 0d952d6e7..f7ab32057 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -42,6 +42,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura gain_(configuration->property(role + ".gain", 40.0)), if_gain_(configuration->property(role + ".if_gain", 40.0)), rf_gain_(configuration->property(role + ".rf_gain", 40.0)), + if_bw_(configuration->property(role + ".if_bw", 0.0)), samples_(configuration->property(role + ".samples", static_cast(0))), in_stream_(in_stream), out_stream_(out_stream), @@ -118,6 +119,12 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura } } + // 5. set bandwidth + if (if_bw_ > 0.0) + { + osmosdr_source_->set_bandwidth(if_bw_, 0); + } + // Get actual bandwidth std::cout << "Actual Bandwidth: " << osmosdr_source_->get_bandwidth(0) << " [Hz]...\n"; } diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index cc34de155..b9fd4763b 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -79,6 +79,7 @@ private: double gain_; double if_gain_; double rf_gain_; + double if_bw_; size_t item_size_; int64_t samples_;