WindowFunction { public double compute(IntToDoubleFunction fn){ double v=fn.applyAsDouble(0)*window[0]; for (int i=1; i<window.length; ++i){ v+=window[i]*fn.applyAsDouble(i); v+=window[i]*fn.applyAsDouble(-i); } return v; } WindowFunction(WindowType type, int len); double computeSymmetric(IntToDoubleFunction fn); double compute(IntToDoubleFunction fn);  }
@Test public void testParzenMethod() { for (int len = 1; len < 12; ++len) { new WindowFunction(WindowType.Parzen, len).compute(i -> fn.get(Math.abs(i))); } }
@Test public void testBartlettMethod() { for (int len = 1; len < 12; ++len) { new WindowFunction(WindowType.Bartlett, len).compute(i -> fn.get(Math.abs(i))); } }