mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-30 10:09:25 -04:00
Extract complex16_mag_squared_to_dbv_norm to utility.
This commit is contained in:
parent
d855336985
commit
efaf13d2d1
3 changed files with 10 additions and 7 deletions
|
@ -70,13 +70,6 @@
|
|||
constexpr auto baseband_thread_priority = NORMALPRIO + 20;
|
||||
constexpr auto rssi_thread_priority = NORMALPRIO + 10;
|
||||
|
||||
static float complex16_mag_squared_to_dbv_norm(const float c16_mag_squared) {
|
||||
constexpr float mag2_max = -32768.0f * -32768.0f + -32768.0f * -32768.0f;
|
||||
constexpr float mag2_log10_max = std::log10(mag2_max);
|
||||
constexpr float mag2_to_db_factor = 20.0f / 2.0f;
|
||||
return (std::log10(c16_mag_squared) - mag2_log10_max) * mag2_to_db_factor;
|
||||
}
|
||||
|
||||
class BasebandStatsCollector {
|
||||
public:
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue