marf
Class MARF

java.lang.Object
  extended bymarf.MARF

public class MARF
extends java.lang.Object

Class MARF

Implements a so-called MARF server.

Provides basic recognition pipeline and its configuration.

$Header: /cvsroot/marf/marf/src/marf/MARF.java,v 1.56 2004/05/03 22:14:02 mokhov Exp $

Author:
The MARF Development Group

Field Summary
static int BANDPASS_FFT_FILTER
          Indicates to use bandpass filter
static int CEPSTRAL
          Indicates to use cepstral analysis
static int CHEBYSHEV_DISTANCE
          Indicates to use Chebyshev distance for classification
static int CITYBLOCK_DISTANCE
          A synonym to Chebyshev distance
static boolean DEBUG
          Debug flag.
static int DUMMY
          Indicates to use Dummy preprocessing module (just normalization)
static int ENDPOINT
          Indicates to use endpointing
static int EUCLIDEAN_DISTANCE
          Indicates to use Euclidean distance for classification
static int F0
          Indicates to use F0
static int FFT
          Indicates to use FFT
static int HIGH_FREQUENCY_BOOST_FFT_FILTER
          Indicates to use filter boosting high frequencies
static int HIGH_PASS_FFT_FILTER
          Indicates to use high pass FFT filter
static int LOW_PASS_FFT_FILTER
          Indicates to use low pass FFT filter
static int LPC
          Indicates to use LPC
static int MAHALANOBIS_DISTANCE
          Indicates to use Mahalanobis distance for classification
static int MANHATTAN_DISTANCE
          A synonym to Chebyshev distance
static int MARKOV
          Indicates to use Hidden Markov Models for classification
static int MINKOWSKI_DISTANCE
          Indicates to use Minkowski distance for classification
static int MP3
          Indicates MP3 incoming sample file format
static int NEURAL_NETWORK
          Indicates to use Neural Network for classification
static int RANDOM_CLASSIFICATION
          Indicates to use random classification
static int RANDOM_FEATURE_EXTRACTION
          Indicates to use random feature extraction
static int SEGMENTATION
          Indicates to use segmentation
static int STOCHASTIC
          Indicates to use stochastic models for classification
static int ULAW
          Indicates ULAW incoming sample file format
static int WAV
          Indicates WAV incoming sample file format
 
Method Summary
static void debug(java.lang.String pstrMsg)
          Outputs param to STDERR if DEBUG is enabled
static Classification getClassification()
          Retrieves current Classification reference
static int getClassificationMethod()
          Gets classification method to be used
static java.lang.String getConfig()
          Returns a string representation of the current MARF configuration
static int getCurrentSubject()
          Gets ID of a subject currently being trained on
static boolean getDumpSpectrogram()
          Whether spectrogram wanted or not
static boolean getDumpWaveGraph()
          Whether wave graph wanted or not
static FeatureExtraction getFeatureExtraction()
          Retrieves current FeatureExtraction reference
static int getFeatureExtractionMethod()
          Gets currently selected feature extraction method.
static int getIntVersion()
          Returns an integer representation of the MARF version
static ModuleParams getModuleParams()
          Gets module-specific parameters an application programmer passed on to the module
static Preprocessing getPreprocessing()
          Retrieves current Preprocessing reference
static int getPreprocessingMethod()
          Gets currently selected preprocessing method.
static Result getResult()
          Gets the entire Result object
static Sample getSample()
          Retrieves current Sample reference
static java.lang.String getSampleFile()
          Obtains filename of a sample currently being processed
static int getSampleFormat()
          Gets input sample file format
static SampleLoader getSampleLoader()
          Retrieves current SampleLoader reference
static java.lang.String getVersion()
          Returns a string representation of the MARF version
static int queryResultID()
          Queries for the final classification result
static void recognize()
          Recognition/Identification mode
static void setClassificationMethod(int piClassificationMethod)
          Sets classification method to be used
static void setCurrentSubject(int piSubjectID)
          Sets ID of a subject currently being trained on
static void setDumpSpectrogram(boolean pbDump)
          Indicates whether spectrogram is wanted as an output of a FeatureExtraction module
static void setDumpWaveGraph(boolean pbDump)
          Indicates whether wave graph is wanted as an output
static void setFeatureExtractionMethod(int piFeatureExtractionMethod)
          Sets feature extraction method to be used
static void setModuleParams(ModuleParams poModuleParams)
          Sets module-specific parameters an application programmer wishes to pass on to the module
static void setPreprocessingMethod(int piPreprocessingMethod)
          Sets preprocessing method to be used
static void setSampleFile(java.lang.String pstrFileName)
          Sets input sample file name
static void setSampleFormat(int piSampleFormat)
          Sets input sample file format
static void setSamplesDir(java.lang.String pstrSamplesDir)
          Sets directory with sample files to be read from
static void streamedRecognition()
          Meant to provide implementation of the buffered sample processing for large samples.
static void train()
          Training mode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Debug flag.

if is set to true, prompts debug() method to output to STDERR


DUMMY

public static final int DUMMY
Indicates to use Dummy preprocessing module (just normalization)

See Also:
Constant Field Values

HIGH_FREQUENCY_BOOST_FFT_FILTER

public static final int HIGH_FREQUENCY_BOOST_FFT_FILTER
Indicates to use filter boosting high frequencies

See Also:
Constant Field Values

BANDPASS_FFT_FILTER

public static final int BANDPASS_FFT_FILTER
Indicates to use bandpass filter

See Also:
Constant Field Values

ENDPOINT

public static final int ENDPOINT
Indicates to use endpointing

See Also:
Constant Field Values

LOW_PASS_FFT_FILTER

public static final int LOW_PASS_FFT_FILTER
Indicates to use low pass FFT filter

See Also:
Constant Field Values

HIGH_PASS_FFT_FILTER

public static final int HIGH_PASS_FFT_FILTER
Indicates to use high pass FFT filter

See Also:
Constant Field Values

LPC

public static final int LPC
Indicates to use LPC

See Also:
Constant Field Values

FFT

public static final int FFT
Indicates to use FFT

See Also:
Constant Field Values

F0

public static final int F0
Indicates to use F0

See Also:
Constant Field Values

SEGMENTATION

public static final int SEGMENTATION
Indicates to use segmentation

See Also:
Constant Field Values

CEPSTRAL

public static final int CEPSTRAL
Indicates to use cepstral analysis

See Also:
Constant Field Values

RANDOM_FEATURE_EXTRACTION

public static final int RANDOM_FEATURE_EXTRACTION
Indicates to use random feature extraction

Since:
0.2.0
See Also:
Constant Field Values

NEURAL_NETWORK

public static final int NEURAL_NETWORK
Indicates to use Neural Network for classification

See Also:
Constant Field Values

STOCHASTIC

public static final int STOCHASTIC
Indicates to use stochastic models for classification

See Also:
Constant Field Values

MARKOV

public static final int MARKOV
Indicates to use Hidden Markov Models for classification

See Also:
Constant Field Values

EUCLIDEAN_DISTANCE

public static final int EUCLIDEAN_DISTANCE
Indicates to use Euclidean distance for classification

See Also:
Constant Field Values

CHEBYSHEV_DISTANCE

public static final int CHEBYSHEV_DISTANCE
Indicates to use Chebyshev distance for classification

See Also:
Constant Field Values

MANHATTAN_DISTANCE

public static final int MANHATTAN_DISTANCE
A synonym to Chebyshev distance

Since:
0.2.0
See Also:
Constant Field Values

CITYBLOCK_DISTANCE

public static final int CITYBLOCK_DISTANCE
A synonym to Chebyshev distance

Since:
0.3.0
See Also:
Constant Field Values

MINKOWSKI_DISTANCE

public static final int MINKOWSKI_DISTANCE
Indicates to use Minkowski distance for classification

Since:
0.2.0
See Also:
Constant Field Values

MAHALANOBIS_DISTANCE

public static final int MAHALANOBIS_DISTANCE
Indicates to use Mahalanobis distance for classification

Since:
0.2.0
See Also:
Constant Field Values

RANDOM_CLASSIFICATION

public static final int RANDOM_CLASSIFICATION
Indicates to use random classification

Since:
0.2.0
See Also:
Constant Field Values

WAV

public static final int WAV
Indicates WAV incoming sample file format

See Also:
Constant Field Values

MP3

public static final int MP3
Indicates MP3 incoming sample file format

See Also:
Constant Field Values

ULAW

public static final int ULAW
Indicates ULAW incoming sample file format

See Also:
Constant Field Values
Method Detail

setPreprocessingMethod

public static final void setPreprocessingMethod(int piPreprocessingMethod)
                                         throws MARFException
Sets preprocessing method to be used

Parameters:
piPreprocessingMethod - one of the allowed preprocessing methods
Throws:
MARFException

getPreprocessingMethod

public static final int getPreprocessingMethod()
Gets currently selected preprocessing method.

Returns:
one of the preprocessing methods

setFeatureExtractionMethod

public static final void setFeatureExtractionMethod(int piFeatureExtractionMethod)
                                             throws MARFException
Sets feature extraction method to be used

Parameters:
piFeatureExtractionMethod - one of the allowed feature extraction methods
Throws:
MARFException

getFeatureExtractionMethod

public static final int getFeatureExtractionMethod()
Gets currently selected feature extraction method.

Returns:
current feature extraction method

setClassificationMethod

public static final void setClassificationMethod(int piClassificationMethod)
                                          throws MARFException
Sets classification method to be used

Parameters:
piClassificationMethod - one of the allowed classification methods
Throws:
MARFException

getClassificationMethod

public static final int getClassificationMethod()
Gets classification method to be used

Returns:
current classification method

setSampleFormat

public static final void setSampleFormat(int piSampleFormat)
Sets input sample file format

Parameters:
piSampleFormat - one of the allowed sample formats

getSampleFormat

public static final int getSampleFormat()
Gets input sample file format

Returns:
current sample format

setSampleFile

public static final void setSampleFile(java.lang.String pstrFileName)
Sets input sample file name

Parameters:
pstrFileName - string representing sample file to be read

getSampleFile

public static final java.lang.String getSampleFile()
Obtains filename of a sample currently being processed

Returns:
file name of a string representing sample file

setSamplesDir

public static final void setSamplesDir(java.lang.String pstrSamplesDir)
Sets directory with sample files to be read from

Parameters:
pstrSamplesDir - string representing directory name

setModuleParams

public static final void setModuleParams(ModuleParams poModuleParams)
Sets module-specific parameters an application programmer wishes to pass on to the module

Parameters:
poModuleParams - parameters' instance

getModuleParams

public static final ModuleParams getModuleParams()
Gets module-specific parameters an application programmer passed on to the module

Returns:
ModuleParams object reference

setDumpSpectrogram

public static final void setDumpSpectrogram(boolean pbDump)
Indicates whether spectrogram is wanted as an output of a FeatureExtraction module

Parameters:
pbDump - true if wanted, false if not

getDumpSpectrogram

public static final boolean getDumpSpectrogram()
Whether spectrogram wanted or not

Returns:
true if spectrogram being dumped, false otherwise

setDumpWaveGraph

public static final void setDumpWaveGraph(boolean pbDump)
Indicates whether wave graph is wanted as an output


getDumpWaveGraph

public static final boolean getDumpWaveGraph()
Whether wave graph wanted or not

Returns:
true if graph wanted being dumped, false otherwise

setCurrentSubject

public static final void setCurrentSubject(int piSubjectID)
Sets ID of a subject currently being trained on

Parameters:
piSubjectID - integer ID of the subject

getCurrentSubject

public static final int getCurrentSubject()
Gets ID of a subject currently being trained on

Returns:
integer ID of the subject
Since:
0.2.0

getVersion

public static final java.lang.String getVersion()
Returns a string representation of the MARF version

Returns:
version String

getIntVersion

public static final int getIntVersion()
Returns an integer representation of the MARF version

Returns:
integer version

getConfig

public static final java.lang.String getConfig()
Returns a string representation of the current MARF configuration

Returns:
configuration string

getSample

public static final Sample getSample()
Retrieves current Sample reference

Returns:
Sample object
Since:
0.2.0

getSampleLoader

public static final SampleLoader getSampleLoader()
Retrieves current SampleLoader reference

Returns:
SampleLoader object
Since:
0.2.0

getPreprocessing

public static final Preprocessing getPreprocessing()
Retrieves current Preprocessing reference

Returns:
Preprocessing object
Since:
0.2.0

getFeatureExtraction

public static final FeatureExtraction getFeatureExtraction()
Retrieves current FeatureExtraction reference

Returns:
FeatureExtraction object
Since:
0.2.0

getClassification

public static final Classification getClassification()
Retrieves current Classification reference

Returns:
Classification object
Since:
0.2.0

queryResultID

public static final int queryResultID()
Queries for the final classification result

Returns:
integer ID of the indentified subject

getResult

public static final Result getResult()
Gets the entire Result object

Returns:
Result ID and all the stats of the classification

recognize

public static final void recognize()
                            throws MARFException
Recognition/Identification mode

Throws:
MARFException
Since:
0.2.0

train

public static final void train()
                        throws MARFException
Training mode

Throws:
MARFException
Since:
0.2.0

streamedRecognition

public static final void streamedRecognition()
Meant to provide implementation of the buffered sample processing for large samples. Not implemented.


debug

public static final void debug(java.lang.String pstrMsg)
Outputs param to STDERR if DEBUG is enabled

Parameters:
pstrMsg - message to output.