marf.Preprocessing.FFTFilter
Class HighFrequencyBoost

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Preprocessing.Preprocessing
          extended by marf.Preprocessing.Filter
              extended by marf.Preprocessing.FFTFilter.FFTFilter
                  extended by marf.Preprocessing.FFTFilter.HighFrequencyBoost
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IFilter, IPreprocessing, IStorageManager

public class HighFrequencyBoost
extends FFTFilter

HighFrequencyBoost class implements filtering using high frequency booster on top of the FFTFilter.

$Id: HighFrequencyBoost.java,v 1.30 2007/12/18 03:45:56 mokhov Exp $

Since:
0.0.1
Version:
$Revision: 1.30 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
static double BASE_BOOST_COEFFICIENT
          Default boost rate of 5*PI to be applied to amplitude values.
protected  double dBoostCoefficient
          Current boost coefficient.
static int DEFAULT_HIGH_FREQUENCY_CUTOFF
          Create a response that boosts all frequencies above 1000 Hz.
protected  double dHighFrequencyCutoff
          Current high frequency cut off.
 
Fields inherited from class marf.Preprocessing.FFTFilter.FFTFilter
adFreqResponse, DEFAULT_FREQUENCY_RESPONSE_SIZE
 
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.IFilter
FILTER_DIMENSIONALITY_1D, FILTER_DIMENSIONALITY_2D, FILTER_DIMENSIONALITY_3D, MARF_INTERFACE_CODE_REVISION
 
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
HighFrequencyBoost()
          Default constructor for reflective creation of Preprocessing clones.
HighFrequencyBoost(IPreprocessing poPreprocessing)
          Pipelined preprocessing constructor.
HighFrequencyBoost(Sample poSample)
          HighFrequencyBoost Constructor.
 
Method Summary
 boolean cropAudio(double pdStartingFrequency, double pdEndFrequency)
          Stub implementation of cropAudio().
 void generateResponseCoefficients()
          Creates high-frequency boost response coefficients and sets applies them to the frequency response vector.
 double getBoostCoefficient()
          Retrieves the current boost coefficient value.
 double getHighFrequencyCutoff()
          Retrieves the current boost coefficient value.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 boolean preprocess()
          Overrides FFTFilter's preprocess() with extra normalization after the boost.
protected  void processModuleParams()
          A common local routine for extraction filter parameters via the ModuleParams machinery.
 void setBoostCoefficient(double pdBoostCoefficient)
          Allows to override the current boost coefficient.
 void setHighFrequencyCutoff(double pdHighFrequencyCutoff)
          Allows to override the current boost coefficient.
 
Methods inherited from class marf.Preprocessing.FFTFilter.FFTFilter
filter, filter, filter, setFrequencyResponse
 
Methods inherited from class marf.Preprocessing.Preprocessing
backSynchronizeObject, clone, compress, compress, extractParameters, getSample, normalize, normalize, normalize, removeNoise, removeSilence, 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_HIGH_FREQUENCY_CUTOFF

public static final int DEFAULT_HIGH_FREQUENCY_CUTOFF
Create a response that boosts all frequencies above 1000 Hz. Note: 1000Hz ~= 25 * 128 / 8000Hz.

Since:
0.3.0.2
See Also:
Constant Field Values

BASE_BOOST_COEFFICIENT

public static final double BASE_BOOST_COEFFICIENT
Default boost rate of 5*PI to be applied to amplitude values. Made up out of the blue.

Since:
0.3.0.3
See Also:
Constant Field Values

dBoostCoefficient

protected double dBoostCoefficient
Current boost coefficient. By default is set to BASE_BOOST_COEFFICIENT.

Since:
0.3.0.5
See Also:
BASE_BOOST_COEFFICIENT

dHighFrequencyCutoff

protected double dHighFrequencyCutoff
Current high frequency cut off. By default is set to DEFAULT_HIGH_FREQUENCY_CUTOFF.

Since:
0.3.0.5
See Also:
DEFAULT_HIGH_FREQUENCY_CUTOFF
Constructor Detail

HighFrequencyBoost

public HighFrequencyBoost()
Default constructor for reflective creation of Preprocessing clones. Typically should not be used unless really necessary for the frameworked modules.

Since:
0.3.0.5

HighFrequencyBoost

public HighFrequencyBoost(IPreprocessing poPreprocessing)
                   throws PreprocessingException
Pipelined preprocessing constructor.

Parameters:
poPreprocessing - follow-up preprocessing module
Throws:
PreprocessingException
Since:
0.3.0.3

HighFrequencyBoost

public HighFrequencyBoost(Sample poSample)
                   throws PreprocessingException
HighFrequencyBoost Constructor.

Parameters:
poSample - incoming sample
Throws:
PreprocessingException
Method Detail

preprocess

public final boolean preprocess()
                         throws PreprocessingException
Overrides FFTFilter's preprocess() with extra normalization after the boost. TODO: Normalization should only be applied to the boosted part.

Specified by:
preprocess in interface IPreprocessing
Overrides:
preprocess in class FFTFilter
Returns:
true if there were changes to the sample
Throws:
PreprocessingException - if there were problems during underlying super.preprocess() or normalize().
Since:
0.2.0
See Also:
IPreprocessing.removeNoise(), IPreprocessing.removeSilence()

cropAudio

public final boolean cropAudio(double pdStartingFrequency,
                               double pdEndFrequency)
                        throws PreprocessingException
Stub implementation of cropAudio().

Specified by:
cropAudio in interface IPreprocessing
Overrides:
cropAudio in class Preprocessing
Parameters:
pdStartingFrequency - unused
pdEndFrequency - unused
Returns:
false
Throws:
PreprocessingException - never thrown

generateResponseCoefficients

public void generateResponseCoefficients()
Creates high-frequency boost response coefficients and sets applies them to the frequency response vector.

Specified by:
generateResponseCoefficients in class FFTFilter
Since:
0.3.0.2
See Also:
FFTFilter.generateResponseCoefficients()

setBoostCoefficient

public void setBoostCoefficient(double pdBoostCoefficient)
Allows to override the current boost coefficient.

Parameters:
pdBoostCoefficient - the new boost coefficient to set
Since:
0.3.0.5

getBoostCoefficient

public double getBoostCoefficient()
Retrieves the current boost coefficient value.

Returns:
returns the boost coefficient
Since:
0.3.0.5

setHighFrequencyCutoff

public void setHighFrequencyCutoff(double pdHighFrequencyCutoff)
Allows to override the current boost coefficient.

Parameters:
pdHighFrequencyCutoff - the new boost coefficient to set
Since:
0.3.0.5

getHighFrequencyCutoff

public double getHighFrequencyCutoff()
Retrieves the current boost coefficient value.

Returns:
returns the boost coefficient
Since:
0.3.0.5

processModuleParams

protected void processModuleParams()
A common local routine for extraction filter parameters via the ModuleParams machinery.

Since:
0.3.0.5

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Returns:
revision string
Since:
0.3.0.2


SourceForge Logo