mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-17 23:28:50 -05:00
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 <cmath>
|
||||
|
||||
Real CalcDb::dbPower(Real magsq)
|
||||
Real CalcDb::dbPower(Real magsq, Real floordB)
|
||||
{
|
||||
if (magsq > 0)
|
||||
{
|
||||
@ -25,6 +25,6 @@ Real CalcDb::dbPower(Real magsq)
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return floordB;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
class CalcDb
|
||||
{
|
||||
public:
|
||||
static Real dbPower(Real magsq);
|
||||
static Real dbPower(Real magsq, Real floordB = -100.0f);
|
||||
};
|
||||
|
||||
#endif /* INCLUDE_UTIL_DB_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user