Java tutorial
//package com.java2s; public class Main { /** * Get a Hann window. */ private static double[] hann(int windowWidth) { double[] envelopeArray = new double[windowWidth]; for (int i = 0; i < windowWidth; i++) { envelopeArray[i] = 0.5 * (1 - Math.cos(2 * Math.PI * i / windowWidth)); } return envelopeArray; } }