Package detectionPlotFX.plots
Class FFTPlot<D extends PamDataUnit>
java.lang.Object
detectionPlotFX.plots.FFTPlot<D>
- Type Parameters:
 D- - the detection type.
- All Implemented Interfaces:
 DetectionPlot<D>
- Direct Known Subclasses:
 RawFFTPlot,RawHolderFFTPlot
Plots the spectrogram of a detection which already has a calculated spectrgram, e.g. a a RawDataHolder. 
 
Note that this is not particularly suitable for data that needs to load raw data from sound files. Use RawFFTPlot instead for this functionality.
- Author:
 - Jamie Macaulay
 
- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DetectionPlotDisplayReference to the detection plot display.protected FFTPlotParamsThe FFT parameters.protected DThe last data unit which has been plotted.protected StandardPlot2DColoursThe spectrogram coloursprotected RawFFTPlot.FreqTimeProjectorThe time frequency projectorFields inherited from interface detectionPlotFX.layout.DetectionPlot
SCROLLPANE_DRAW, STANDARD_DRAW - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionCreate plot paramters for the FFT plot paramsprotected FFTSettingsPane<?> Create the FFT settings pane.protected voiddrawClipSpectrogram(D pamDetection, int fftLength, int fftHop, int windowType, double clipLevel, javafx.scene.image.WritableImage writableImage) Draw a spectrogram of a detection onto a writeable image.voidenableTimeSpinner(boolean enable) Enable the time buffer spinner.Get the FFT plot params.getName()Get the name of the plot e.g.javafx.scene.layout.PaneGet the settings pane for the particular plot.abstract double[][]getSpectrogram(D pamDetection, int fftSize, int fftHop, int windowType) Get the spectrogram image from the data unit.booleanisUseKHz()abstract voidpaintDetections(D detection, javafx.scene.canvas.GraphicsContext graphicsContext, javafx.scene.shape.Rectangle windowRect, DetectionPlotProjector projector) Paint the detection over the FFT.voidpaintPlot(D pamDetection, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Plot the relevent data from a detection.voidRepaint the current data unit.voidsetFFTParams(FFTPlotParams fftPlotParams) Set the FFT params.voidsettingsChanged(FFTPlotParams fftPlotParams) Called whenever the settings are changed.voidsetupAxis(D pamDetection, double sR, DetectionPlotProjector projector) Setup the axis.voidsetupFreqAxis(double minFreq, double maxFreq, DetectionPlotProjector projector) Set up the frequency axisvoidSetup the plot.voidsetUpTimeAxis(double millisDuration, DetectionPlotProjector plotProjector) Setup the time axis within the given duration. 
- 
Field Details
- 
detectionPlotDisplay
Reference to the detection plot display. - 
lastData
The last data unit which has been plotted. - 
timeFreqProjector
The time frequency projector - 
spectrogramColours
The spectrogram colours - 
fftParams
The FFT parameters. 
 - 
 - 
Constructor Details
- 
FFTPlot
 
 - 
 - 
Method Details
- 
getName
Description copied from interface:DetectionPlotGet the name of the plot e.g. waveform, spectrum etc.- Specified by:
 getNamein interfaceDetectionPlot<D extends PamDataUnit>
 - 
setupPlot
public void setupPlot()Description copied from interface:DetectionPlotSetup the plot. This may, for example, involve changing axis etc.- Specified by:
 setupPlotin interfaceDetectionPlot<D extends PamDataUnit>
 - 
setupAxis
Description copied from interface:DetectionPlotSetup the axis. This is called before paintPlot. Ensures axis are correct values- Specified by:
 setupAxisin interfaceDetectionPlot<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
Setup the time axis within the given duration.- Parameters:
 millisDuration-southAxis-
 - 
setupFreqAxis
Set up the frequency axis- Parameters:
 minFreq-maxFreq-freqAxis-
 - 
paintPlot
public void paintPlot(D pamDetection, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Description copied from interface:DetectionPlotPlot the relevent data from a detection.- Specified by:
 paintPlotin interfaceDetectionPlot<D extends PamDataUnit>- Parameters:
 pamDetection- - the data of every channel. e.g. might be a waveform with each point representing a sample.gc- - the graphics handle to draw on.
 - 
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.- Parameters:
 graphicsContext- - the graphics handlewindowRect- - the window rectangle in pixelspamAxis- - the pamAxis whihc are being plotte on.
 - 
getSpectrogram
Get the spectrogram image from the data unit.- Parameters:
 pamDetection- - the spectrogram image.- Returns:
 - the spectrogram image.
 
 - 
drawClipSpectrogram
protected void drawClipSpectrogram(D pamDetection, int fftLength, int fftHop, int windowType, double clipLevel, javafx.scene.image.WritableImage writableImage) Draw a spectrogram of a detection onto a writeable image.- Parameters:
 g- - the graphics handlespectrum- - the click spectrum in FFT bins.tC- -the time in pixelsthe- clip level - add the clip level. Note that we add the clip level because it is one number that takes the voltage range into accounttdProjector- - the projector
 - 
createSettingsPane
Create the FFT settings pane.- Returns:
 - the FFT settings pane.
 
 - 
enableTimeSpinner
public void enableTimeSpinner(boolean enable) Enable the time buffer spinner.- Parameters:
 enable- - true to enable
 - 
settingsChanged
Called whenever the settings are changed. - 
getSettingsPane
public javafx.scene.layout.Pane getSettingsPane()Description copied from interface:DetectionPlotGet the settings pane for the particular plot. This sits on the right hand side of the display inside a hiding pane.- Specified by:
 getSettingsPanein interfaceDetectionPlot<D extends PamDataUnit>- Returns:
 - a pane with controls for changing settings in a node.
 
 - 
createPlotParams
Create plot paramters for the FFT plot params- Returns:
 
 - 
reDrawLastUnit
public void reDrawLastUnit()Repaint the current data unit. - 
setFFTParams
Set the FFT params.- Parameters:
 params- - the params
 - 
getFFTParams
Get the FFT plot params.- Returns:
 - the fft plot params.
 
 - 
isUseKHz
public boolean isUseKHz() 
 -