java.lang.Object
marf.Storage.StorageManager
marf.Preprocessing.Preprocessing
marf.Preprocessing.FFTFilter.FFTFilter
- All Implemented Interfaces:
- marf.Preprocessing.IFilter, marf.Preprocessing.IPreprocessing, marf.Storage.IStorageManager, java.io.Serializable
- Direct Known Subclasses:
- BandpassFilter, HighFrequencyBoost, HighPassFilter, LowPassFilter
- public abstract class FFTFilter
- extends marf.Preprocessing.Preprocessing
- implements marf.Preprocessing.IFilter
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.23 2005/08/05 22:19:55 mokhov Exp $
- Since:
- 0.0.1
- Version:
- $Revision: 1.23 $
|
Method Summary |
boolean |
filter(double[] padSample,
double[] padFiltered)
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.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 |
DEFAULT_FREQUENCY_RESPONSE_SIZE
public static final transient int DEFAULT_FREQUENCY_RESPONSE_SIZE
- Default size of the frequency response vector, 128.
- See Also:
- Constant Field Values
adFreqResponse
protected transient double[] adFreqResponse
- Frequency repsonse to be multiplied by the incoming value.
FFTFilter
public FFTFilter(marf.Preprocessing.IPreprocessing poPreprocessing)
throws marf.Preprocessing.PreprocessingException
- Pipelined constructor.
- Since:
- 0.3.0.3
FFTFilter
public FFTFilter(marf.Storage.Sample poSample)
throws marf.Preprocessing.PreprocessingException
- FFTFilter Constructor.
preprocess
public boolean preprocess()
throws marf.Preprocessing.PreprocessingException
- FFTFilter implementation of
preprocess().
It does call removeNoise() and removeSilence()
if they were explicitly requested by an app before applying filtering.
NOTE: it alters inner Sample by resetting its data array to the new
filtered values.
- Specified by:
preprocess in interface marf.Preprocessing.IPreprocessing
setFrequencyResponse
public final void setFrequencyResponse(double[] padPesponse)
- Sets frequency response.
Derivatives must call this method before any preprocessing occurs.
filter
public final boolean filter(double[] padSample,
double[] padFiltered)
throws marf.Preprocessing.PreprocessingException
- Perform a filter by the following algorithm:
(1) sample -> window -> FFT -> buffer
(2) buffer * frequency response
(3) buffer -> IFFT -> window -> sample.
Window used is square root of Hamming window, because
the sum at half-window overlap is a constant, which
avoids amplitude distortion from noise.
Also, start sampling at -responseSize/2, in order to avoid
amplitude distortion of the first half of the first window.
- Specified by:
filter in interface marf.Preprocessing.IFilter
genereateResponseCoefficients
public abstract void genereateResponseCoefficients()
- Creates frequency response coefficients and sets applies
them to the frequency response vector. Must be overridden
by individual filters.
- Since:
- 0.3.0
getMARFSourceCodeRevision
public static java.lang.String getMARFSourceCodeRevision()
- Returns source code revision information.
- Since:
- 0.3.0.2