public JFrame showInJFrame(String title, boolean allowZoom, boolean showControls, boolean exitOnClose) { return showInJFrame(title, DEFAULT_WIDTH, DEFAULT_HEIGHT + 50, allowZoom, showControls, exitOnClose); }
public JFrame showInJFrame(String title, boolean allowZoom, boolean exitOnClose) { return showInJFrame(title, DEFAULT_WIDTH, DEFAULT_HEIGHT + 50, allowZoom, true, exitOnClose); }
public JFrame showInJFrame(String title, int width, int height, boolean allowZoom, boolean exitOnClose) { return showInJFrame(title, width, height, allowZoom, true, exitOnClose); }
public JFrame showInJFrame(String title, boolean allowZoom, boolean showControls, boolean exitOnClose) { return showInJFrame(title, DEFAULT_WIDTH, DEFAULT_HEIGHT + 50, allowZoom, showControls, exitOnClose); }
public JFrame showInJFrame(String title, boolean allowZoom, boolean exitOnClose) { return showInJFrame(title, DEFAULT_WIDTH, DEFAULT_HEIGHT + 50, allowZoom, true, exitOnClose); }
public JFrame showInJFrame(String title, int width, int height, boolean allowZoom, boolean exitOnClose) { return showInJFrame(title, width, height, allowZoom, true, exitOnClose); }
protected static JFrame showGraph(double[] array, String title) { FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, array); JFrame frame = graph.showInJFrame(title, 500, 300, true, false); return frame; } }
public static void plot(double[] x, boolean bAutoClose, int milliSecondsToClose) { FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, x); JFrame frame = graph.showInJFrame("wgt2", 500, 300, true, false); if (bAutoClose) { try { Thread.sleep(milliSecondsToClose); } catch (InterruptedException e) { } frame.dispose(); } } }
protected static JFrame showGraph(double[] array, String title) { FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, array); JFrame frame = graph.showInJFrame(title, 500, 300, true, false); return frame; } }
public static void plot(double[] x, boolean bAutoClose, int milliSecondsToClose) { FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, x); JFrame frame = graph.showInJFrame("wgt2", 500, 300, true, false); if (bAutoClose) { try { Thread.sleep(milliSecondsToClose); } catch (InterruptedException e) { } frame.dispose(); } } }
public static void plot(float[] xIn, int startInd, int endInd, String strTitle, boolean bAutoClose, int milliSecondsToClose) { if (xIn != null) { double[] xd = new double[endInd - startInd + 1]; for (int i = startInd; i <= endInd; i++) xd[i - startInd] = xIn[i]; FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, xd); JFrame frame = graph.showInJFrame(strTitle, 500, 300, true, false); if (bAutoClose) { try { Thread.sleep(milliSecondsToClose); } catch (InterruptedException e) { } frame.dispose(); } } }
public static void plot(float[] xIn, int startInd, int endInd, String strTitle, boolean bAutoClose, int milliSecondsToClose) { if (xIn != null) { double[] xd = new double[endInd - startInd + 1]; for (int i = startInd; i <= endInd; i++) xd[i - startInd] = xIn[i]; FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, xd); JFrame frame = graph.showInJFrame(strTitle, 500, 300, true, false); if (bAutoClose) { try { Thread.sleep(milliSecondsToClose); } catch (InterruptedException e) { } frame.dispose(); } } }
protected void updateGraph(FunctionGraph someGraph, String title) { if (someGraph.getParent() == null) { JFrame jf = someGraph.showInJFrame(title, 400, 250, false, false); setDependentWindowLocation(jf); } else { JFrame jf = (JFrame) SwingUtilities.getWindowAncestor(someGraph); jf.setTitle(title); jf.setVisible(true); // just to be sure someGraph.repaint(); } } }
protected void updateGraph(FunctionGraph someGraph, String title) { if (someGraph.getParent() == null) { JFrame jf = someGraph.showInJFrame(title, 400, 250, false, false); setDependentWindowLocation(jf); } else { JFrame jf = (JFrame) SwingUtilities.getWindowAncestor(someGraph); jf.setTitle(title); jf.setVisible(true); // just to be sure someGraph.repaint(); } } }
public static void plot(double[] xIn, int startInd, int endInd, String strTitle, boolean bAutoClose, int milliSecondsToClose) { if (xIn != null) { endInd = MathUtils.CheckLimits(endInd, 0, xIn.length - 1); startInd = MathUtils.CheckLimits(startInd, 0, endInd); double[] x = new double[endInd - startInd + 1]; System.arraycopy(xIn, startInd, x, 0, x.length); FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, x); JFrame frame = graph.showInJFrame(strTitle, 500, 300, true, false); if (bAutoClose) { try { Thread.sleep(milliSecondsToClose); } catch (InterruptedException e) { } frame.dispose(); } } }
public static void plot(double[] xIn, int startInd, int endInd, String strTitle, boolean bAutoClose, int milliSecondsToClose) { if (xIn != null) { endInd = MathUtils.CheckLimits(endInd, 0, xIn.length - 1); startInd = MathUtils.CheckLimits(startInd, 0, endInd); double[] x = new double[endInd - startInd + 1]; System.arraycopy(xIn, startInd, x, 0, x.length); FunctionGraph graph = new FunctionGraph(400, 200, 0, 1, x); JFrame frame = graph.showInJFrame(strTitle, 500, 300, true, false); if (bAutoClose) { try { Thread.sleep(milliSecondsToClose); } catch (InterruptedException e) { } frame.dispose(); } } }
public static void main(String[] args) { int samplingRate = Integer.getInteger("samplingrate", 1).intValue(); int windowLengthMs = Integer.getInteger("windowlength.ms", 0).intValue(); int windowLength = Integer.getInteger("windowlength.samples", 512).intValue(); // If both are given, use window length in milliseconds: if (windowLengthMs != 0) windowLength = windowLengthMs * samplingRate / 1000; int fftSize = Math.max(4096, MathUtils.closestPowerOfTwoAbove(windowLength)); Window w = new BlackmanWindow(windowLength); FunctionGraph timeGraph = new FunctionGraph(0, 1. / samplingRate, w.window); timeGraph.showInJFrame(w.toString() + " in time domain", true, false); double[] fftSignal = new double[fftSize]; // fftSignal should integrate to one, so normalise amplitudes: double sum = MathUtils.sum(w.window); for (int i = 0; i < w.window.length; i++) { fftSignal[i] = w.window[i] / sum; } LogSpectrum freqGraph = new LogSpectrum(fftSignal, samplingRate); freqGraph.showInJFrame(w.toString() + " log frequency response", true, false); }
protected FunctionGraph showGraph(double[] array, String title) { FunctionGraph graph = new FunctionGraph(400, 200, 0, 1. / ONE, array); graph.showInJFrame(title, 500, 300, true, false); try { Thread.sleep(1000); } catch (InterruptedException e) { } return graph; }
public static void main(String[] args) throws Exception { F0TrackerAutocorrelationHeuristic tracker = new F0TrackerAutocorrelationHeuristic(new PitchFileHeader()); tracker.pitchAnalyzeWavFile(args[0]); FunctionGraph f0Graph = new FunctionGraph(0, tracker.params.skipSizeInSeconds, tracker.f0s); f0Graph.showInJFrame("F0 curve for " + args[0], false, true); }
public static void main(String[] args) throws Exception { F0TrackerAutocorrelationHeuristic tracker = new F0TrackerAutocorrelationHeuristic(new PitchFileHeader()); tracker.pitchAnalyzeWavFile(args[0]); FunctionGraph f0Graph = new FunctionGraph(0, tracker.params.skipSizeInSeconds, tracker.f0s); f0Graph.showInJFrame("F0 curve for " + args[0], false, true); }