Refactor MAMA and HTIT implementation for improved accuracy and performance

This commit is contained in:
Miha Kralj
2025-12-24 20:50:58 -08:00
parent 8917575994
commit 9ba89812cd
27 changed files with 1030 additions and 547 deletions
+5
View File
@@ -175,6 +175,11 @@ public sealed class Blma : AbstractBase
throw new ArgumentOutOfRangeException(nameof(period), "Period must be greater than 0");
}
if (destination.Length < source.Length)
{
throw new ArgumentOutOfRangeException(nameof(destination), $"Destination length must be at least {source.Length}.");
}
// Pre-calculate weights for full period
Span<double> weights = period <= 256 ? stackalloc double[period] : new double[period];
double weightSum = CalculateWeights(period, weights);