public class PrintWavetable { // print out values for one cycle of a cosine wave static final double TWOPI = Math.PI*2.; public static void main(String[] args) { int L = 64; // table length double A = 1.; // amplitude double phi = 0.; // phase offset double f = 1.; // frequency double value; // value of each calculated sample for (int n=0; n<L; n++) { value = A*Math.cos(TWOPI*(f*n/L+phi)); System.out.println(value); } } }