[CodeFactor] Apply fixes to commit 9697fac

This commit is contained in:
codefactor-io
2026-03-14 05:03:08 +00:00
parent 9697facfb4
commit e35ff7fa3f
164 changed files with 458 additions and 530 deletions
+2 -2
View File
@@ -185,7 +185,7 @@ public sealed class Ebsw : AbstractBase
double wave = (filt0 + filt1 + filt2) / 3.0;
// Power: 3-bar average of squared filtered values
double pwr = (filt0 * filt0 + filt1 * filt1 + filt2 * filt2) / 3.0;
double pwr = ((filt0 * filt0) + (filt1 * filt1) + (filt2 * filt2)) / 3.0;
// Automatic gain control: normalize by RMS, clamp to [-1, +1]
double sineWave = pwr > 0 ? wave / Math.Sqrt(pwr) : 0;
@@ -326,7 +326,7 @@ public sealed class Ebsw : AbstractBase
double wave = (filt0 + filt1 + filt2) / 3.0;
// Power
double pwr = (filt0 * filt0 + filt1 * filt1 + filt2 * filt2) / 3.0;
double pwr = ((filt0 * filt0) + (filt1 * filt1) + (filt2 * filt2)) / 3.0;
// AGC normalization
double sineWave = pwr > 0 ? wave / Math.Sqrt(pwr) : 0;