marf.Preprocessing.Dummy
Class Crop

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Preprocessing.Preprocessing
          extended by marf.Preprocessing.Dummy.Dummy
              extended by marf.Preprocessing.Dummy.Raw
                  extended by 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".
 
Fields inherited from class marf.Preprocessing.Preprocessing
bRemoveNoise, bRemoveSilence, DEFAULT_SILENCE_THRESHOLD, dSilenceThreshold, oSample
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Preprocessing.IPreprocessing
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
Crop()
           
Crop(IPreprocessing poPreprocessing)
           
Crop(Sample poSample)
           
 
Method Summary
 int getCropChunkSize()
           
 int getCropRight()
           
 int getCropStart()
           
 boolean preprocess()
          Raw implementation of preprocess() for testing.
 void setCropChunkSize(int piCropChunkSize)
           
 void setCropEnd(int piCropEnd)
           
 void setCropLeft(int piCropStart)
           
 
Methods inherited from class marf.Preprocessing.Dummy.Raw
cropAudio, getMARFSourceCodeRevision, removeNoise, removeSilence
 
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
 

Field Detail

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".

Constructor Detail

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
Method Detail

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)


SourceForge Logo