class 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;
    }

    public  WindowFunction(WindowType type, int len);

}