From 779ee0ad6fc75e8dd0696d742235332bbe7ba8d2 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 19 Apr 2025 10:05:50 +0200 Subject: [PATCH] correct dbr logic (according to the pira.cz's p275 manual) --- lib/bs412.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bs412.c b/lib/bs412.c index 5f3d72a..e327730 100644 --- a/lib/bs412.c +++ b/lib/bs412.c @@ -1,11 +1,11 @@ #include "bs412.h" float dbr_to_deviation(float dbr) { - return 19000.0f * powf(10.0f, dbr / 20.0f); + return 19000.0f * powf(10.0f, dbr / 10.0f); } float deviation_to_dbr(float deviation) { - return 20 * log10f((deviation + 1e-6f) / 19000.0f); + return 10 * log10f((deviation + 1e-6f) / 19000.0f); } void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {