Package edu.purdue.wind.util

Source Code of edu.purdue.wind.util.PlotWindow

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]);
  }
    }
}
TOP

Related Classes of edu.purdue.wind.util.PlotWindow

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.