summaryrefslogtreecommitdiffstats
path: root/Scripts/approximate.py
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/approximate.py')
-rw-r--r--Scripts/approximate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Scripts/approximate.py b/Scripts/approximate.py
index 1bfe13f..fb39283 100644
--- a/Scripts/approximate.py
+++ b/Scripts/approximate.py
@@ -278,7 +278,7 @@ def main(argv: list[str] | None = None) -> int:
)
theta = 2.0 * np.pi * (xs - args.start) / length
- sorted_terms = sorted(terms, key=lambda term: term.amplitude, reverse=True)
+ sorted_terms = sorted(terms, key=lambda term: abs(term.amplitude), reverse=True)
available_components = len(sorted_terms)
if args.terms > available_components: