1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-04 15:30:01 +00:00

Add new configuration parameters iq_balance_mode and dc_offset_mode to the Osmosdr_Signal_Source

This commit is contained in:
Carles Fernandez 2024-10-17 21:38:13 +02:00
parent ff11347a0d
commit f27eb85af6
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 23 additions and 3 deletions

View File

@ -53,6 +53,10 @@ All notable changes to GNSS-SDR will be documented in this file.
- Added new
[`Cshort_To_Gr_Complex`](https://gnss-sdr.org/docs/sp-blocks/data-type-adapter/#implementation-cshort_to_gr_complex)
Data Type Adapter implementation.
- The
[Osmosdr_Signal_Source](https://gnss-sdr.org/docs/sp-blocks/signal-source/#implementation-osmosdr_signal_source)
has gained two new optional configuration parameters: `iq_balance_mode` and
`dc_offset_mode`, both of which are set to Automatic by default.
### Improvements in Portability:

View File

@ -86,6 +86,23 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura
std::cout << "PLL Frequency tune error: " << osmosdr_source_->get_center_freq() - freq_ << " [Hz]...\n";
LOG(INFO) << "PLL Frequency tune error: " << osmosdr_source_->get_center_freq() - freq_ << " [Hz]...\n";
// Set IQ balance and DC offset modes
// iq balance correction mode: 0 = Off, 1 = Manual, 2 = Automatic
// dc offset correction mode: 0 = Off, 1 = Manual, 2 = Automatic
int iq_balance_mode = configuration->property(role + ".iq_balance_mode", 2);
if (iq_balance_mode < 0 || iq_balance_mode > 2)
{
iq_balance_mode = 2;
}
int dc_offset_mode = configuration->property(role + ".dc_offset_mode", 2);
if (dc_offset_mode < 0 || dc_offset_mode > 2)
{
dc_offset_mode = 2;
}
osmosdr_source_->set_iq_balance_mode(iq_balance_mode);
osmosdr_source_->set_dc_offset_mode(dc_offset_mode);
// 4. set rx gain
if (this->AGC_enabled_ == true)
{
@ -128,10 +145,9 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura
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";
}
// Get actual bandwidth
std::cout << "Actual Bandwidth: " << osmosdr_source_->get_bandwidth(0) << " [Hz]...\n";
}
else
{