Package detectionPlotFX.plots
Class RawFFTPlot<D extends PamDataUnit>
java.lang.Object
detectionPlotFX.plots.FFTPlot<D>
detectionPlotFX.plots.RawFFTPlot<D>
- Type Parameters:
D
- - the data unit.
- All Implemented Interfaces:
DetectionPlot<D>
- Direct Known Subclasses:
IshFFTPlot
,OverlayGroupDisplay.RawWaveFFTPlot
,WaterfallSpecPlot
,WhistleFFTPlot
Plots FFT data as background if raw data is available. Data units can be drawn over the spectrogram image.
Specifically, this handles the calualtion of spectrograms from raw data and can handle large chunks of raw data. Data are ordered on a thred, an image is then created and loaded on another thread.
For detections whihc may already have a small saved spectrogram, e.g. anything that implements RawDataHolder, then use FFTPlot instead.
- Author:
- Jamie Macaulay
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Simple wrapper class for to make the DetectionPlotProjector into a TimeProjectorFX.class
Data block for holding FFT Valuesclass
-
Field Summary
Fields inherited from interface detectionPlotFX.layout.DetectionPlot
SCROLLPANE_DRAW, STANDARD_DRAW
-
Constructor Summary
ConstructorDescriptionRawFFTPlot
(DetectionPlotDisplay displayPlot, DetectionPlotProjector projector) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkSettingsChange
(FFTPlotParams fftPlotParams) Check new settings against old settings to see what might need recalculated.A simple FFT data blockgetName()
Get the name of the plot e.g.Get the projectorlong
Get scroll startdouble[][]
getSpectrogram
(D pamDetection, int fftLen, int fftHop, int windowType) Get the spectrogram image from the data unit.void
loadRawData
(D dataUnit, double padding, int plotChannel) Load the raw data.abstract void
paintDetections
(D detection, javafx.scene.canvas.GraphicsContext graphicsContext, javafx.scene.shape.Rectangle windowRect, DetectionPlotProjector projector) Paint the detection over the FFT.void
paintPlot
(D dataUnit, javafx.scene.canvas.GraphicsContext graphicsContext, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Plot the relevent data from a detection.void
Repaint the current data unit.void
repaintSpectrogram
(long dataStart) Repaint the spectrogramvoid
setFFTParams
(FFTPlotParams fftPlotParams) Set the FFT params.void
setRawDataOrder
(RawDataOrder rawDataOrder) void
settingsChanged
(FFTPlotParams fftPlotParams) Called whenever the settings are changed.void
setupAxis
(D pamDetection, double sR, DetectionPlotProjector projector) Setup the axis.void
setUpTimeAxis
(double millisDuration, DetectionPlotProjector plotProjector) Setup the time axis within the given duration.Methods inherited from class detectionPlotFX.plots.FFTPlot
createPlotParams, enableTimeSpinner, getFFTParams, getSettingsPane, isUseKHz, setupFreqAxis, setupPlot
-
Constructor Details
-
RawFFTPlot
-
-
Method Details
-
getName
Description copied from interface:DetectionPlot
Get the name of the plot e.g. waveform, spectrum etc.- Specified by:
getName
in interfaceDetectionPlot<D extends PamDataUnit>
- Overrides:
getName
in classFFTPlot<D extends PamDataUnit>
-
paintPlot
public void paintPlot(D dataUnit, javafx.scene.canvas.GraphicsContext graphicsContext, 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 interfaceDetectionPlot<D extends PamDataUnit>
- Overrides:
paintPlot
in classFFTPlot<D extends PamDataUnit>
- Parameters:
dataUnit
- - the data of every channel. e.g. might be a waveform with each point representing a sample.graphicsContext
- - the graphics handle to draw on.
-
loadRawData
Load the raw data. This can be overridden if necessary.- Parameters:
dataUnit
- - the data unit to loadpadding
- - the padding.plotChannel
- - the plot channel.
-
setupAxis
Description copied from interface:DetectionPlot
Setup the axis. This is called before paintPlot. Ensures axis are correct values- Specified by:
setupAxis
in interfaceDetectionPlot<D extends PamDataUnit>
- Overrides:
setupAxis
in classFFTPlot<D extends PamDataUnit>
- Parameters:
pamDetection
- - 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.
-
setUpTimeAxis
Description copied from class:FFTPlot
Setup the time axis within the given duration.- Overrides:
setUpTimeAxis
in classFFTPlot<D extends PamDataUnit>
-
repaintSpectrogram
public void repaintSpectrogram(long dataStart) Repaint the spectrogram- Parameters:
dataStart
-
-
paintDetections
public abstract void paintDetections(D detection, javafx.scene.canvas.GraphicsContext graphicsContext, javafx.scene.shape.Rectangle windowRect, DetectionPlotProjector projector) Paint the detection over the FFT.- Specified by:
paintDetections
in classFFTPlot<D extends PamDataUnit>
- Parameters:
graphicsContext
- - the graphics handlewindowRect
- - the window rectangle in pixelspamAxis
- - the pamAxis whihc are being plotte on.
-
reDrawLastUnit
public void reDrawLastUnit()Repaint the current data unit.- Overrides:
reDrawLastUnit
in classFFTPlot<D extends PamDataUnit>
-
settingsChanged
Description copied from class:FFTPlot
Called whenever the settings are changed.- Overrides:
settingsChanged
in classFFTPlot<D extends PamDataUnit>
-
checkSettingsChange
Check new settings against old settings to see what might need recalculated. Because the spectrogram is quite processor intensive we want to recalculate as little as possible.- Parameters:
fftPlotParams
- - the new settings which will be set.
-
setFFTParams
Set the FFT params.- Overrides:
setFFTParams
in classFFTPlot<D extends PamDataUnit>
- Parameters:
params
- - the params
-
getFFTDataBlock
A simple FFT data block- Returns:
- the SimpleFFTDataBlock
-
getProjector
Get the projector- Returns:
- the time projector
-
getScrollStart
public long getScrollStart()Get scroll start- Returns:
- the scroll start
-
getSpectrogram
- Returns:
- the spectrogram
-
getRawDataOrder
-
setRawDataOrder
-
getSpectrogram
Description copied from class:FFTPlot
Get the spectrogram image from the data unit.- Specified by:
getSpectrogram
in classFFTPlot<D extends PamDataUnit>
- Parameters:
pamDetection
- - the spectrogram image.- Returns:
- the spectrogram image.
-