Package fftManager.fftorganiser
Class FFTDataOrganiser
java.lang.Object
fftManager.fftorganiser.FFTDataOrganiser
- Direct Known Subclasses:
ClickFFTOrganiser
,ClipFFTOrganiser
,WSLFFTDataOrganiser
Functions to create blocks of FFT data for multiple channels as needed by
various localisation algorithms in PAMGuard (e.g. BearingLocaliser and
Group3DLocaliser). These localisers can take data from multiple sources:
FFT Data from an FFTDataBlock
RAW Data from a PAMRawDataBlock
FFT Data from within a data unit (e.g. click spectrum)
RAW Data from within a data unit (e.g. a click waveform) In all cases, FFT data will either be taken or converted from the raw data into a list of FFT units for the requested channels and returned in a FFTDataList object with a bit of additional diagnostic information such as numbers of FFT's per channel, etc. Creates a block of FFT Data. These will be returned as an arraylist
FFT Data from an FFTDataBlock
RAW Data from a PAMRawDataBlock
FFT Data from within a data unit (e.g. click spectrum)
RAW Data from within a data unit (e.g. a click waveform) In all cases, FFT data will either be taken or converted from the raw data into a list of FFT units for the requested channels and returned in a FFTDataList object with a bit of additional diagnostic information such as numbers of FFT's per channel, etc. Creates a block of FFT Data. These will be returned as an arraylist
- Author:
- Doug Gillespie
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canProcess
(PamDataBlock sourceInputBlock, FFTInputTypes inputType) Determine whether or not a particular data block type can be processed in the selected waycreateFFTDataList
(PamDataUnit pamDataUnit, double sampleRate, int channelMap) Create a list of FFT Data units using the preferred input type.long
Get how long the input data to this need to be help in memory for (e.g.getFFTDataUnits
(FFTDataHolder fftDataHolder, Integer fftLength) Separated out function to get the list of FFT data units from the FFT holder so that individual modules can easily override this and add additional information (such as bin ranges) to the FFT data.PamDataBlock<?>
Use only if this FFT organiser is being used with a very specific data source, such as the click detector, where we 100% know that the data will be coming from that detector.void
setDataKeepMillis
(long dataKeepMillis) Set how long the input data to this need to be help in memory for (e.g.void
void
setFftLength
(Integer fftLength) boolean
setInput
(PamDataBlock rawOrFFTData, FFTInputTypes preferredInputType) void
setOnlyAllowedDataBlock
(PamDataBlock<?> onlyAllowedDataBlock) Use only if this FFT organiser is being used with a very specific data source, such as the click detector, where we 100% know that the data will be coming from that detector.suggestInputType
(PamDataBlock sourceInputBlock) Get the most suitable input type for a data block.
-
Field Details
-
inputType
-
-
Constructor Details
-
FFTDataOrganiser
-
-
Method Details
-
getFftObservable
- Returns:
- the fftObservable
-
setInput
-
canProcess
Determine whether or not a particular data block type can be processed in the selected way- Parameters:
sourceInputBlock
- source data blockinputType
- input type- Returns:
- true if this is gonna work
-
suggestInputType
Get the most suitable input type for a data block. internal FFT data preferred, then internal raw, then external FFT, finally external raw.- Parameters:
sourceInputBlock
- source input data- Returns:
- most suitable input type
-
createFFTDataList
public FFTDataList createFFTDataList(PamDataUnit pamDataUnit, double sampleRate, int channelMap) throws FFTDataException Create a list of FFT Data units using the preferred input type.Note that some overridden versions of this function may chose to change the sample rate of the data (e.g. click detector upsampling) so the sample rate in the returned FFTDataList may not be the same as the sampleRate parameter fed to the function.
- Parameters:
pamDataUnit
- data unit we need FFT data for (can be anything, just needs it's times)sampleRate
- sample rate of the data in PamDataUnitchannelMap
- channel map we want data for- Returns:
- Collated and interleaved list of FFT data units
- Throws:
FFTDataException
- See Also:
-
getFFTDataUnits
Separated out function to get the list of FFT data units from the FFT holder so that individual modules can easily override this and add additional information (such as bin ranges) to the FFT data.- Parameters:
fftDataHolder
- FFT Data holderfftLength
- FFT length- Returns:
- list of FFT data units for all channels in the fftDataholder
-
getFftLength
- Returns:
- the fftLength
-
setFftLength
- Parameters:
fftLength
- the fftLength to set
-
getFftHop
- Returns:
- the fftHop
-
setFftHop
- Parameters:
fftHop
- the fftHop to set
-
getOnlyAllowedDataBlock
Use only if this FFT organiser is being used with a very specific data source, such as the click detector, where we 100% know that the data will be coming from that detector.- Returns:
- the onlyAllowedDataBlock
-
setOnlyAllowedDataBlock
Use only if this FFT organiser is being used with a very specific data source, such as the click detector, where we 100% know that the data will be coming from that detector.- Parameters:
onlyAllowedDataBlock
- the onlyAllowedDataBlock to set
-
getDataKeepMillis
public long getDataKeepMillis()Get how long the input data to this need to be help in memory for (e.g. a few seconds for whistles, perhaps a lot longer for things marked on the spectrogram ?- Returns:
- the dataKeepMillis
-
setDataKeepMillis
public void setDataKeepMillis(long dataKeepMillis) Set how long the input data to this need to be help in memory for (e.g. a few seconds for whistles, perhaps a lot longer for things marked on the spectrogram ?- Parameters:
dataKeepMillis
- the dataKeepMillis to set
-