mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-07-31 00:39:17 +02:00
speed up dbr calculation
This commit is contained in:
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
#include "bs412.h"
|
#include "bs412.h"
|
||||||
|
|
||||||
inline float dbr_to_deviation(float dbr) {
|
inline float dbr_to_deviation(float dbr) {
|
||||||
return 19000.0f * powf(10.0f, dbr / 10.0f);
|
return 19000.0f * powf(2.0f, dbr * 0.332193f);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float deviation_to_dbr(float deviation) {
|
inline float deviation_to_dbr(float deviation) {
|
||||||
if(deviation == 0.0f) return -100.0f;
|
if(deviation == 0.0f) return -100.0f;
|
||||||
return 10 * log10f(deviation / 19000.0f);
|
return 10.0f * (log2f(deviation) - log2f(19000.0f)) * 0.30103f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
|
void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user