Package dataPlotsFX.rawDataPlotFX
Class RawSoundPlotDataFX
java.lang.Object
dataPlotsFX.rawDataPlotFX.RawSoundPlotDataFX
Raw sound data is by default not stored in memory. There are good reasons for this, the first being that raw sound data is generally very large. That creates problems when trying to
display raw sound data on a display. Only a second or so is available in memory for plotting. In order to have display which show a more than a second or so of data there needs to be
an efficient way to store the display information for showing a sound data.
This performs operations to plot one channel of raw sound data on a plot pane of a tdGraphFX. The data to display for each pixel is stored in an array and saved in memory.
RealTime: //TODO
Viewer Mode: //TODO
The array is filled with data for each pixel from incoming raw sound data. Once the array is filled
This performs operations to plot one channel of raw sound data on a plot pane of a tdGraphFX. The data to display for each pixel is stored in an array and saved in memory.
RealTime: //TODO
Viewer Mode: //TODO
The array is filled with data for each pixel from incoming raw sound data. Once the array is filled
- Author:
- Jamie Macaulay
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNewRawData
(RawDataUnit rawDataUnit) Convert new RawDataUnit to pixels and then add toinvalid @link
#soundData
void
Check whether the time scale is correct.void
checkTimeGap
(RawDataUnit rawSoundData) Check that the new rawdata is concurrent to the last fft.void
Reset the array, clearing all data.void
drawRawSoundData
(javafx.scene.canvas.GraphicsContext g2d, javafx.scene.shape.Rectangle windowRect, javafx.geometry.Orientation orientation, PamAxisFX timeAxis, PamAxisFX dataAxis, double scrollStart, double wrapPix) Draw data from the array onto the screen.double
float
Get the sample ratevoid
newRawData
(RawDataUnit rawDataUnit, double binsPerPixel) Called whenever new raw sound data is to be added to display.void
recalcSoundData
(double binsPerPixel2) A new binsPerPixel value is being used.void
Reset the raw sound data for loading.void
setSampleRate
(float sampleRate) Set the sample rate.
-
Constructor Details
-
RawSoundPlotDataFX
-
RawSoundPlotDataFX
public RawSoundPlotDataFX()
-
-
Method Details
-
setSampleRate
public void setSampleRate(float sampleRate) Set the sample rate.- Parameters:
sampleRate
- sample rate in samples per second.
-
getSampleRate
public float getSampleRate()Get the sample rate- Returns:
- the sample rate in bins per second
-
checkConfig
public void checkConfig()Check whether the time scale is correct. -
addNewRawData
Convert new RawDataUnit to pixels and then add toinvalid @link
#soundData
- Parameters:
rawDataUnit
-
-
newRawData
Called whenever new raw sound data is to be added to display.- Parameters:
rawDataUnit
- - raw data unit.
-
checkTimeGap
Check that the new rawdata is concurrent to the last fft. If not fill the spectrogram with blank sapce. -
recalcSoundData
public void recalcSoundData(double binsPerPixel2) A new binsPerPixel value is being used. In real time mode will need to convert the store In viewer model will need to reload data from the store.- Parameters:
binsPerPixel2
- - the new bins per pixel. The old bins per pixel is still stored in the binsPerPixel field.
-
drawRawSoundData
public void drawRawSoundData(javafx.scene.canvas.GraphicsContext g2d, javafx.scene.shape.Rectangle windowRect, javafx.geometry.Orientation orientation, PamAxisFX timeAxis, PamAxisFX dataAxis, double scrollStart, double wrapPix) Draw data from the array onto the screen. This functions assumes that theinvalid @link
#soundData
invalid @link
#binsPerPixel
- Parameters:
g2d
- - the graphics context to draw onto.windowRect
- - rectangle describing the window.orientation
- - the orientation of the display VERTICAL or HORIZONTAL.timeAxis
- - the time axis.dataAxis
- - the amplitude axis.scrollStart
- - the start of the display in milliseconds datenum. The is the left most side of the display i.e. where the oldest visble data is displayed.wrapPix
- - the wrap position on the time display -1 if not wrapping.l
-
resetForLoad
public void resetForLoad()Reset the raw sound data for loading. -
clearRawData
public void clearRawData()Reset the array, clearing all data. -
getBinsPerPixel
public double getBinsPerPixel()
-