git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@90843 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
01a355420b
commit
834f19eb06
|
@ -2,6 +2,7 @@ package org.gcube.dataanalysis.ecoengine.signals;
|
|||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
@ -278,6 +279,18 @@ public class SignalConversions {
|
|||
return spectrum;
|
||||
}
|
||||
|
||||
public static void displaySpectrogram(double[][] spectrum, String name, int samplingRate, int windowshift, int frameslength, boolean display) throws Exception {
|
||||
|
||||
SpectrogramCustom spec = new SpectrogramCustom(null, samplingRate, Window.get(Window.HAMMING, frameslength), windowshift, frameslength, 640, 480);
|
||||
|
||||
spec.spectra = new ArrayList<double[]>();
|
||||
for (int i=0;i<spectrum.length;i++){
|
||||
spec.spectra.add(spectrum[i]);
|
||||
}
|
||||
spec.showInJFrame(name, true, true);
|
||||
|
||||
}
|
||||
|
||||
public static float spectrumTimeFromIndex(int index, float windowShiftTime) {
|
||||
return index * windowShiftTime;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue