Class SpectrumPlot<D extends PamDataUnit>

java.lang.Object
detectionPlotFX.plots.SpectrumPlot<D>
Type Parameters:
D - - the input data unit type
All Implemented Interfaces:
DetectionPlot<D>
Direct Known Subclasses:
CTSpectrumPlot, RawSpectrumPlot, TemplateSpectrumPane.SpectrumTemplatePlot

public abstract class SpectrumPlot<D extends PamDataUnit> extends Object implements DetectionPlot<D>
Plot for the spectrum of a waveform.
Author:
Jamie Macaulay
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: DetectionPlot
      Get the name of the plot e.g. waveform, spectrum etc.
      Specified by:
      getName in interface DetectionPlot<D extends PamDataUnit>
    • getPowerSpectrum

      public abstract double[][] getPowerSpectrum(D data, int minSample, int maxSample)
      Get the power spectrum for the detection
      Parameters:
      data - - the pamDetection
      Returns:
      the power spectrum for each channel.
    • getCepstrum

      public abstract double[][] getCepstrum(D data, int minSample, int maxSample)
      Get the cepstrum for the detection
      Parameters:
      data - - the pamDetection
      Returns:
      the cepstrum for each channel.
    • setupPlot

      public void setupPlot()
      Description copied from interface: DetectionPlot
      Setup the plot. This may, for example, involve changing axis etc.
      Specified by:
      setupPlot in interface DetectionPlot<D extends PamDataUnit>
    • setupAxis

      public void setupAxis(D data, double sR, DetectionPlotProjector plotProjector)
      Description copied from interface: DetectionPlot
      Setup the axis. This is called before paintPlot. Ensures axis are correct values
      Specified by:
      setupAxis in interface DetectionPlot<D extends PamDataUnit>
      Parameters:
      data - - the data of every channel. e.g. might be a waveform with each point representing a sample.
      sR - - the sample rate. Primarily used to convert bins into time values.
    • paintPlot

      public void paintPlot(D data, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag)
      Description copied from interface: DetectionPlot
      Plot the relevent data from a detection.
      Specified by:
      paintPlot in interface DetectionPlot<D extends PamDataUnit>
      Parameters:
      data - - the data of every channel. e.g. might be a waveform with each point representing a sample.
      gc - - the graphics handle to draw on.
    • drawLogSpectrum

      public void drawLogSpectrum(javafx.scene.canvas.GraphicsContext g2, javafx.scene.shape.Rectangle clipRect, double[][] clickLineData, DetectionPlotProjector projector)
      Draw the shapes for the log spectrum. This function should eventually be integrated with the drawSpectrum() function.
      Parameters:
      clipRect -
      clickLineData -
      g -
      eventLineData -
    • getSettingsPane

      public javafx.scene.layout.Pane getSettingsPane()
      Description copied from interface: DetectionPlot
      Get the settings pane for the particular plot. This sits on the right hand side of the display inside a hiding pane.
      Specified by:
      getSettingsPane in interface DetectionPlot<D extends PamDataUnit>
      Returns:
      a pane with controls for changing settings in a node.
    • getSampleRate

      public double getSampleRate(D currentDetection)
      Get the sample rate in samples per second of the last data unit.
      Parameters:
      the - detection to find sample rate for.
      Returns:
      the sample rate in samples per second.
    • getSpectrumParams

      public SpectrumPlotParams getSpectrumParams()
      Get spectrum params.
      Returns:
      the spectrum params.
    • reDrawLastUnit

      public void reDrawLastUnit()
      Re paint the last data unit.
    • isFillSpectrum

      public boolean isFillSpectrum()
      Check whether the spectrum is filled with a transparent polygon/
      Returns:
      true if spectum is filled.
    • setFillSpectrum

      public void setFillSpectrum(boolean fillSpectrum)
      Set whether the spectrum is filled with a transparent polygon
      Parameters:
      fillSpectrum - - true to fill spectrum