|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--marf.Storage.StorageManager | +--marf.Preprocessing.Preprocessing
Abstract Preprocessing Module.
$Id: Preprocessing.java,v 1.35 2005/08/05 22:19:54 mokhov Exp $
Field Summary | |
protected marf.Storage.Sample |
oSample
Sample reference. |
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 | |
protected |
Preprocessing(marf.Preprocessing.IPreprocessing poPreprocessing)
Allows chaining of preprocessing modules. |
protected |
Preprocessing(marf.Storage.Sample poSample)
Main Preprocessing constructor that performs normalization as a part of construction process. |
Method Summary | |
void |
backSynchronizeObject()
Implementaion of back-synchronization of Sample loaded object. |
boolean |
cropAudio(double pdStartingFrequency,
double pdEndFrequency)
Derivatives implement this method to crop arbitrary part of the audio sample. |
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
marf.Storage.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 |
removeNoise()
Derivatives should implement this method to remove noise from the sample. |
boolean |
removeSilence()
Derivatives should implement this method to remove silence. |
void |
setSample(marf.Storage.Sample poSample)
Allows setting a sample object reference. |
Methods inherited from class marf.Storage.StorageManager |
dump, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, restore, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface marf.Preprocessing.IPreprocessing |
preprocess |
Field Detail |
protected marf.Storage.Sample oSample
Constructor Detail |
protected Preprocessing(marf.Storage.Sample poSample) throws PreprocessingException
poSample
- loaded sample by a concrete implementation of SampleLoader
PreprocessingException
- if normalize()
failsnormalize()
protected Preprocessing(marf.Preprocessing.IPreprocessing poPreprocessing) throws PreprocessingException
new FooBarBaz(new HighFrequencyBoost(new HighPassFilter(poSample)))
.
Notice, it calls preprocess()
for all inner preprocessing,
but not the outer. The outer is supposed to be called by either MARF
or an application as a part of defined API.
poPreprocessing
- follow up preprocessing module
PreprocessingException
- if underlying preprocess()
fails or
the parameter is null.IPreprocessing.preprocess()
,
MARF
,
HighFrequencyBoost
,
HighPassFilter
Method Detail |
public boolean removeNoise() throws PreprocessingException
removeNoise
in interface IPreprocessing
NotImplementedException
PreprocessingException
- declared but never thrownpublic boolean removeSilence() throws PreprocessingException
removeSilence
in interface IPreprocessing
NotImplementedException
PreprocessingException
- declared but never thrownpublic final boolean normalize() throws PreprocessingException
normalize(0)
.
normalize
in interface IPreprocessing
true
if the sample has been successfully normalized;
false
otherwise
PreprocessingException
- if internal sample reference is nullnormalize(int)
public final boolean normalize(int piIndexFrom) throws PreprocessingException
HighFrequencyBoost
.
Equivalent to normalize(piIndexFrom, sample array length - 1)
.
normalize
in interface IPreprocessing
piIndexFrom
- sample array index to start normalization from
true
if the sample has been successfully normalized;
false
otherwise
PreprocessingException
- if internal sample reference is nullnormalize(int, int)
,
HighFrequencyBoost
public final boolean normalize(int piIndexFrom, int piIndexTo) throws PreprocessingException
normalize
in interface IPreprocessing
piIndexFrom
- sample array index to start normalization frompiIndexTo
- sample array index to end normalization at
true
if the sample has been successfully normalized;
false
otherwise
PreprocessingException
- if internal sample reference is null or one or
both indexes are out of rangepublic boolean cropAudio(double pdStartingFrequency, double pdEndFrequency) throws PreprocessingException
cropAudio
in interface IPreprocessing
pdStartingFrequency
- double Frequency to start to crop frompdEndFrequency
- double Frequency to crop the sample to
true
- cropped, false
- not
NotImplementedException
PreprocessingException
- declared, but is never thrownpublic final marf.Storage.Sample getSample()
getSample
in interface IPreprocessing
public void setSample(marf.Storage.Sample poSample)
setSample
in interface IPreprocessing
poSample
- new sample objectpublic void backSynchronizeObject()
backSynchronizeObject
in class StorageManager
StorageManager.restore()
public static java.lang.String getMARFSourceCodeRevision()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |