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
+1 -1
View File
@@ -156,7 +156,7 @@ public class Htit : AbstractBase
_imBuffer.Add(im, Input.IsNew);
// Calculate period
double pd = (im != 0 && re != 0) ? TWO_PI / System.Math.Atan(im / re) : 0;
double pd = (im >= double.Epsilon && re >= double.Epsilon) ? TWO_PI / System.Math.Atan(im / re) : 0;
pd = ClampPeriod(pd, _lastPd);
pd = (ALPHA * pd) + (BETA * _lastPd);
_pdBuffer.Add(pd, Input.IsNew);