Package decimator
Class DecimatorWorker
java.lang.Object
decimator.DecimatorWorker
Job to run the actual decimation. Separate out from
DecimatorProcess so that it can be used elsewhere.
Note that this can both decimate and upsample. If decimating, filtering takes place before data are copied to output array. If upsampling, filtering takes place AFTER data are copied to the output array.
Note that this can both decimate and upsample. If decimating, filtering takes place before data are copied to output array. If upsampling, filtering takes place AFTER data are copied to the output array.
- Author:
- dg50
-
Constructor Summary
ConstructorDescriptionDecimatorWorker
(int filterOrder, int channelMap, double inputRate, double outputRate) Make a decimator / upsamplerDecimatorWorker
(DecimatorParams decimatorParams, int channelMap, double inputRate, double outputRate) Make a decimator worker with given filter params, channel map and input and output rates. -
Method Summary
Modifier and TypeMethodDescriptionprocess
(RawDataUnit inputData) Run the decimator on the input data, return null if it's not in the channel list.void
reset()
Reset all counters and output buffers.
-
Constructor Details
-
DecimatorWorker
public DecimatorWorker(DecimatorParams decimatorParams, int channelMap, double inputRate, double outputRate) Make a decimator worker with given filter params, channel map and input and output rates. Channels not in the map will be ignored.- Parameters:
decimatorParams
- Filter parameters for Decimator filterchannelMap
- Channel map (channels not in map will return null)inputRate
- input sample rateoutputRate
- output sample rate
-
DecimatorWorker
public DecimatorWorker(int filterOrder, int channelMap, double inputRate, double outputRate) Make a decimator / upsampler- Parameters:
filterOrder
- Filter order to use (Butterworth low pass applied before decimation or after upsamplingchannelMap
- channel mapinputRate
- input sample rateoutputRate
- output sample rate
-
-
Method Details
-
reset
public void reset()Reset all counters and output buffers. -
process
Run the decimator on the input data, return null if it's not in the channel list.
Also sometimes null if decimation ratio is not an integer factor- Parameters:
inputData
-- Returns:
- a new data unit or null
-