|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmarf.Storage.StorageManager
marf.Preprocessing.Preprocessing
marf.Preprocessing.FFTFilter.FFTFilter
public abstract class FFTFilter
FFTFilter class implements filtering using the FFT algorithm.
Derivatives must set frequency response based on the type of filter they are.
$Id: FFTFilter.java,v 1.22 2005/06/16 19:58:47 mokhov Exp $
Field Summary | |
---|---|
protected double[] |
adFreqResponse
Frequency repsonse to be multiplied by the incoming value. |
static int |
DEFAULT_FREQUENCY_RESPONSE_SIZE
Default size of the frequency response vector, 128. |
Fields inherited from class marf.Preprocessing.Preprocessing |
---|
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 | |
---|---|
FFTFilter(Preprocessing poPreprocessing)
Pipelined constructor. |
|
FFTFilter(Sample poSample)
FFTFilter Constructor. |
Method Summary | |
---|---|
boolean |
filter(double[] sample,
double[] filtered)
Perform a filter by the following algorithm: (1) sample -> window -> FFT -> buffer (2) buffer * frequency response (3) buffer -> IFFT -> window -> sample. |
abstract void |
genereateResponseCoefficients()
Creates frequency response coefficients and sets applies them to the frequency response vector. |
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
boolean |
preprocess()
FFTFilter implementation of preprocess() . |
void |
setFrequencyResponse(double[] padPesponse)
Sets frequency response. |
Methods inherited from class marf.Preprocessing.Preprocessing |
---|
backSynchronizeObject, cropAudio, getSample, normalize, normalize, normalize, removeNoise, removeSilence |
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 |
Field Detail |
---|
public static final transient int DEFAULT_FREQUENCY_RESPONSE_SIZE
protected transient double[] adFreqResponse
Constructor Detail |
---|
public FFTFilter(Preprocessing poPreprocessing) throws PreprocessingException
poPreprocessing
- followup preprocessing module
PreprocessingException
public FFTFilter(Sample poSample) throws PreprocessingException
poSample
- incoming sample
PreprocessingException
Method Detail |
---|
public boolean preprocess() throws PreprocessingException
preprocess()
.
It does call removeNoise()
and removeSilence()
if they were explicitly requested by an app before applying filtering.
true
if there was something filtered out
PreprocessingException
- if the frequency response is nullIPreprocessing.removeNoise()
,
IPreprocessing.removeSilence()
public final void setFrequencyResponse(double[] padPesponse)
padPesponse
- desired frequency response coefficientspublic final boolean filter(double[] sample, double[] filtered) throws PreprocessingException
-responseSize/2
, in order to avoid
amplitude distortion of the first half of the first window.
sample
- incoming sample analog datafiltered
- will contain data after the filter was applied.
"filtered" must be at least as long as "sample".
true
if some filtering actually happened
PreprocessingException
- if the filtered and sample data
arrays are not of the same size, the frequency response was not
set, or there was an underlying FeatureExctractionException while
executing the underlying FFT algorithm.public abstract void genereateResponseCoefficients()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |