marf.Preprocessing
Interface IPreprocessing

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
BandpassFilter, BandPassFilter, BandStopFilter, BandStopFilter, CFEFilter, Crop, Dummy, Endpoint, FFTFilter, Filter, HighFrequencyBoost, HighPassFilter, HighPassFilter, LowPassFilter, LowPassFilter, Preprocessing, Raw

public interface IPreprocessing
extends java.lang.Cloneable

Preprocessing Interface.

$Id: IPreprocessing.java,v 1.7 2006/07/28 16:56:22 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.7 $
Author:
Serguei Mokhov

Field Summary
static java.lang.String MARF_INTERFACE_CODE_REVISION
          Interface source code revision.
 
Method Summary
 java.lang.Object clone()
          Enable cloning of preprocessing modules in accordance with the Cloneable interface.
 boolean cropAudio(double pdStartingFrequency, double pdEndFrequency)
          Derivatives implement this method to crop arbitrary part of the audio sample.
 Sample getSample()
          Returns enclosed sample.
 boolean normalize()
          Normalization of entire incoming samples by amplitude.
 boolean normalize(int piIndexFrom)
          Normalization of incoming samples by amplitude starting from certain index.
 boolean normalize(int piIndexFrom, int piIndexTo)
          Normalization of incoming samples by amplitude between specified indexes.
 boolean preprocess()
          Derivatives must implement this method to do general preprocessing and perhaps calling removeNoise() and removeSilence().
 boolean removeNoise()
          Derivatives should implement this method to remove noise from the sample.
 boolean removeSilence()
          Derivatives should implement this method to remove silence.
 void setSample(Sample poSample)
          Allows setting a sample object reference.
 

Field Detail

MARF_INTERFACE_CODE_REVISION

static final java.lang.String MARF_INTERFACE_CODE_REVISION
Interface source code revision.

See Also:
Constant Field Values
Method Detail

preprocess

boolean preprocess()
                   throws PreprocessingException
Derivatives must implement this method to do general preprocessing and perhaps calling removeNoise() and removeSilence().

Returns:
boolean that sample has changed as a result of preprocessing
Throws:
PreprocessingException - if an error occurred while preprocessing
See Also:
removeNoise(), removeSilence()

removeNoise

boolean removeNoise()
                    throws PreprocessingException
Derivatives should implement this method to remove noise from the sample.

Returns:
boolean that sample has changed (noise removed)
Throws:
PreprocessingException - declared but never thrown

removeSilence

boolean removeSilence()
                      throws PreprocessingException
Derivatives should implement this method to remove silence.

Returns:
boolean that sample has changed (silence removed)
Throws:
PreprocessingException - declared but never thrown

normalize

boolean normalize()
                  throws PreprocessingException
Normalization of entire incoming samples by amplitude.

Returns:
true if the sample has been successfully normalized; false otherwise
Throws:
PreprocessingException - if internal sample reference is null

normalize

boolean normalize(int piIndexFrom)
                  throws PreprocessingException
Normalization of incoming samples by amplitude starting from certain index. Useful in case where only the last portion of a sample needs to be normalized.

Parameters:
piIndexFrom - sample array index to start normalization from
Returns:
true if the sample has been successfully normalized; false otherwise
Throws:
PreprocessingException - if internal sample reference is null
See Also:
normalize(int, int)

normalize

boolean normalize(int piIndexFrom,
                  int piIndexTo)
                  throws PreprocessingException
Normalization of incoming samples by amplitude between specified indexes. Useful in case where only a portion of a sample needs to be normalized.

Parameters:
piIndexFrom - sample array index to start normalization from
piIndexTo - sample array index to end normalization at
Returns:
true if the sample has been successfully normalized; false otherwise
Throws:
PreprocessingException - if internal sample reference is null or one or both indexes are out of range

cropAudio

boolean cropAudio(double pdStartingFrequency,
                  double pdEndFrequency)
                  throws PreprocessingException
Derivatives implement this method to crop arbitrary part of the audio sample.

Parameters:
pdStartingFrequency - double Frequency to start to crop from
pdEndFrequency - double Frequency to crop the sample to
Returns:
boolean true - cropped, false - not
Throws:
PreprocessingException - declared, but is never thrown

getSample

Sample getSample()
Returns enclosed sample.

Returns:
Sample object

setSample

void setSample(Sample poSample)
Allows setting a sample object reference.

Parameters:
poSample - new sample object
Since:
0.3.0.4

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Enable cloning of preprocessing modules in accordance with the Cloneable interface.

Returns:
a copy of the object implementing this interface
Throws:
java.lang.CloneNotSupportedException - if for some reason cloning is unsupported.
Since:
0.3.0.5


SourceForge Logo