From 8494fa407542f78c173bc8db8a5f8475a43932fc Mon Sep 17 00:00:00 2001 From: Giorgos Sgouridis Date: Fri, 18 Aug 2023 19:32:36 +0200 Subject: [PATCH] fix Test_EvenLength_CenterTwoAreSame --- src/FftSharp.Tests/Window.cs | 2 +- src/FftSharp/Window.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/FftSharp.Tests/Window.cs b/src/FftSharp.Tests/Window.cs index de5ccac..1ee5a8f 100644 --- a/src/FftSharp.Tests/Window.cs +++ b/src/FftSharp.Tests/Window.cs @@ -86,7 +86,7 @@ public void Test_OddLength_CenterIndexIsBiggest() [Test] public void Test_EvenLength_CenterTwoAreSame() { - foreach (IWindow window in FftSharp.Window.GetWindows()) + foreach (IWindow window in FftSharp.Window.GetSymmetricWindows()) { double[] values = window.Create(12); Assert.AreEqual(values[5], values[6], 1e-5, window.Name); diff --git a/src/FftSharp/Window.cs b/src/FftSharp/Window.cs index 8ec8126..092bf3b 100644 --- a/src/FftSharp/Window.cs +++ b/src/FftSharp/Window.cs @@ -63,6 +63,13 @@ public static IWindow[] GetWindows() .ToArray(); } + public static IWindow[] GetSymmetricWindows() + { + return GetWindows() + .Where(x => !x.Name.Contains("Periodic")) + .ToArray(); + } + [Obsolete("This method is obsolete. Create a window in the Windows namespace and interact with its methods.")] public static double[] Rectangular(int pointCount) => new Windows.Rectangular().Create(pointCount);