mirror of https://github.com/f4exb/sdrangel.git
dB calculator: add floor value (default -100.0dB) when argument is 0
This commit is contained in:
parent
330db19163
commit
5571e01a65
|
@ -17,7 +17,7 @@
|
||||||
#include "util/db.h"
|
#include "util/db.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
Real CalcDb::dbPower(Real magsq)
|
Real CalcDb::dbPower(Real magsq, Real floordB)
|
||||||
{
|
{
|
||||||
if (magsq > 0)
|
if (magsq > 0)
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,6 @@ Real CalcDb::dbPower(Real magsq)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
return floordB;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
class CalcDb
|
class CalcDb
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Real dbPower(Real magsq);
|
static Real dbPower(Real magsq, Real floordB = -100.0f);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* INCLUDE_UTIL_DB_H_ */
|
#endif /* INCLUDE_UTIL_DB_H_ */
|
||||||
|
|
Loading…
Reference in New Issue