1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-12 05:13:04 +00:00
This commit is contained in:
Carles Fernandez
2018-12-03 22:08:19 +01:00
parent 1743a773b5
commit 327fec627c
80 changed files with 327 additions and 649 deletions

View File

@@ -126,28 +126,26 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const
// no defined gains to clip to
return gain;
}
else
{
double last_stop = gains.front();
BOOST_FOREACH (double g, gains)
{
g /= 10.0;
if (gain < g)
double last_stop = gains.front();
BOOST_FOREACH (double g, gains)
{
g /= 10.0;
if (gain < g)
{
if (std::abs(gain - g) < std::abs(gain - last_stop))
{
if (std::abs(gain - g) < std::abs(gain - last_stop))
{
return g;
}
else
{
return last_stop;
}
return g;
}
else
{
return last_stop;
}
last_stop = g;
}
return last_stop;
last_stop = g;
}
return last_stop;
}