package edu.purdue.wind.util;
import edu.purdue.wind.WindowFunction;
import edu.purdue.wind.HanningWindow;
public class PlotWindow {
public static void main(String[] args) {
final int dataSize = 1024;
if (args.length != 1) {
System.out.println("usage: PlotWindow <function>");
System.exit(1);
}
WindowFunction window = null;
if (args[0].equals("hanning")) {
window = new HanningWindow();
} else {
System.out.println("unrecognized window function '" + args[0] + "', must be one of: hanning");
System.exit(1);
}
double[] data = new double[dataSize];
for (int i = 0; i < data.length; i++) {
data[i] = 1.0;
}
window.window(data, data.length);
for (int i = 0; i < data.length; i++) {
System.out.println("" + i + " " + data[i]);
}
}
}