marf.Preprocessing.Dummy
Class Crop
java.lang.Object
marf.Storage.StorageManager
marf.Preprocessing.Preprocessing
marf.Preprocessing.Dummy.Dummy
marf.Preprocessing.Dummy.Raw
marf.Preprocessing.Dummy.Crop
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, IPreprocessing, IStorageManager
public class Crop
- extends Raw
Designed to be a general "cropper". It does no real preprocessing,
other than just cutting tails or heads or the middle of the sample
array for the fixed-length chunk.
While can be used as a regular preprocessing module (in which case
it is equivalent to Raw
, except cropped), Crop meant to
be used in conjunction with other modules either through Preprocessing
pipeline concatenation or the implementation of the cropAudio() API.
If no parameters specified, by default cuts out the first 512 elements
of the sample array.
$Id: Crop.java,v 1.1 2008/02/17 00:03:59 mokhov Exp $
- Since:
- 0.3.0.6
- Version:
- $Revision: 1.1 $
- Author:
- Serguei Mokhov
- See Also:
- Serialized Form
Field Summary |
static int |
DEFAULT_CROP_CHUNK_SIZE
Default amount of elements to keep in the resulting array. |
protected int |
iCropChunkSize
|
protected int |
iCropLeft
Where to start cropping from, by default (chunk-size, i.e. |
protected int |
iCropRight
Where to stop cropping, by default "the rest of the sample". |
Methods inherited from class marf.Preprocessing.Preprocessing |
backSynchronizeObject, clone, compress, compress, extractParameters, getSample, normalize, normalize, normalize, removeSilence, setSample |
Methods inherited from class marf.Storage.StorageManager |
dump, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restore, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
DEFAULT_CROP_CHUNK_SIZE
public static final int DEFAULT_CROP_CHUNK_SIZE
- Default amount of elements to keep in the resulting array.
- See Also:
- Constant Field Values
iCropLeft
protected int iCropLeft
- Where to start cropping from, by default (chunk-size, i.e.
preserving the elements from 0 to chunk-size - 1).
iCropChunkSize
protected int iCropChunkSize
iCropRight
protected int iCropRight
- Where to stop cropping, by default "the rest of the sample".
Crop
public Crop()
Crop
public Crop(IPreprocessing poPreprocessing)
throws PreprocessingException
- Parameters:
poPreprocessing
-
- Throws:
PreprocessingException
Crop
public Crop(Sample poSample)
throws PreprocessingException
- Parameters:
poSample
-
- Throws:
PreprocessingException
preprocess
public boolean preprocess()
throws PreprocessingException
- Description copied from class:
Raw
- Raw implementation of
preprocess()
for testing.
Does not do any preprocessing.
- Specified by:
preprocess
in interface IPreprocessing
- Overrides:
preprocess
in class Raw
- Returns:
true
- Throws:
PreprocessingException
- never thrown- See Also:
IPreprocessing.removeNoise()
,
IPreprocessing.removeSilence()
getCropStart
public int getCropStart()
setCropLeft
public void setCropLeft(int piCropStart)
getCropRight
public int getCropRight()
setCropEnd
public void setCropEnd(int piCropEnd)
getCropChunkSize
public int getCropChunkSize()
setCropChunkSize
public void setCropChunkSize(int piCropChunkSize)