From 8ba43b63ecbc8f62c6ae10f51ac9aaa4d9226760 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 10 Apr 2023 03:29:59 +0200 Subject: [PATCH] Sound pressure: modified correction factors for PDM and analog --- usermods/audioreactive/audio_reactive.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index 69c70561..e5536ce4 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -1268,9 +1268,9 @@ class AudioReactive : public Usermod { // take the max sample from last I2S batch. float micSampleMax = fabsf(sampleReal); // from getSample() - nice results, however a bit distorted by MicLev processing //float micSampleMax = fabsf(micDataReal); // from FFTCode() - better source, but more flickering - if (dmType == 0) micSampleMax *= 4.0f; // correction for ADC analog + if (dmType == 0) micSampleMax *= 2.0f; // correction for ADC analog if (dmType == 4) micSampleMax *= 16.0f; // correction for I2S Line-In - if (dmType == 5) micSampleMax *= 4.0f; // correction for PDM + if (dmType == 5) micSampleMax *= 2.0f; // correction for PDM // make sure we are in expected ranges if(micSampleMax <= sampleMin) return 0.0f; if(micSampleMax >= sampleMax) return 255.0f;