This commit is contained in:
Miha Kralj
2024-11-04 18:08:33 -08:00
parent 5b333bd2ec
commit fc3e9f756d
21 changed files with 82 additions and 134 deletions
+3 -3
View File
@@ -142,15 +142,15 @@ public class Maaf : AbstractBase
double value1 = GetMedian(length);
value2 = (alpha * (smooth - _prevValue2)) + _prevValue2;
if (value1 != 0)
if (value1 >= double.Epsilon)
{
value3 = System.Math.Abs(value1 - value2) / value1;
value3 = Math.Abs(value1 - value2) / value1;
}
length -= 2;
}
length = System.Math.Max(length, 3);
length = Math.Max(length, 3);
double finalAlpha = CalculateAlpha(length);
double filter = (finalAlpha * (smooth - _prevFilter)) + _prevFilter;