Sautrela

edu.gtts.sautrela.sp
Class MelLogFilterBank

java.lang.Object
  extended by edu.gtts.sautrela.engine.AbstractDataProcessor
      extended by edu.gtts.sautrela.sp.MelLogFilterBank
All Implemented Interfaces:
DataProcessor, java.beans.BeanInfo, java.io.Serializable

public class MelLogFilterBank
extends AbstractDataProcessor

Calculates the logarithm of a Mel-scale Filter Bank. Filters are located in the range [minFreq,maxFreq], so the value of maxFreq must be in the range (minFreq,F], where

F = (datasize - 1) * sampleRate / (2 * datasize)

If maxFreq is set to an out-of-range value, then F is used instead of maxFreq.

See Also:
Serialized Form

Field Summary
static double DEFAULT_MAXFREQ
          default maximum frequency == 0.0
static double DEFAULT_MINFREQ
          default minimun frequency == 0.0
static int DEFAULT_NFILT
          default number of filters == 24
static int DEFAULT_SAMPLERATE
          default sampling rate == 16000
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
MelLogFilterBank()
          Creates a new MelLogFilterBank.
 
Method Summary
 void editBeanInfo(java.beans.BeanInfo info)
           
 int getFilterNum()
          Gets the number of filters
 double getMaxFreq()
          Gets the maximun frequency for filtering
 double getMinFreq()
          Gets the minimun frequency for filtering
 int getSampleRate()
          Gets the sampling rate that was used on the incoming data.
static void main(java.lang.String[] args)
           
 void process(Buffer in, Buffer out)
          Data is pulled from imput buffer, processed and pushed into the output buffer.
 void setFilterNum(int filterNum)
          Sets the number of filters
 void setMaxFreq(double maxFreq)
          Sets the maximun frequency for filtering.
 void setMinFreq(double minFreq)
          Sets the minimun frequency for filtering.
 void setSampleRate(int sampleRate)
          Sets the sampling rate that was used on the incoming data.
 
Methods inherited from class edu.gtts.sautrela.engine.AbstractDataProcessor
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getName, getPropertyDescriptors, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NFILT

public static final int DEFAULT_NFILT
default number of filters == 24

See Also:
Constant Field Values

DEFAULT_SAMPLERATE

public static final int DEFAULT_SAMPLERATE
default sampling rate == 16000

See Also:
Constant Field Values

DEFAULT_MINFREQ

public static final double DEFAULT_MINFREQ
default minimun frequency == 0.0

See Also:
Constant Field Values

DEFAULT_MAXFREQ

public static final double DEFAULT_MAXFREQ
default maximum frequency == 0.0

See Also:
Constant Field Values
Constructor Detail

MelLogFilterBank

public MelLogFilterBank()
Creates a new MelLogFilterBank.

Method Detail

getFilterNum

public int getFilterNum()
Gets the number of filters

Returns:
The number of filters

setFilterNum

public void setFilterNum(int filterNum)
Sets the number of filters

Parameters:
filterNum - The number of filters

getSampleRate

public int getSampleRate()
Gets the sampling rate that was used on the incoming data.

Returns:
The input data sampling rate

setSampleRate

public void setSampleRate(int sampleRate)
Sets the sampling rate that was used on the incoming data. This value is needed in order to set the proper MEL scale.

Parameters:
sampleRate - The input data sampling rate

getMinFreq

public double getMinFreq()
Gets the minimun frequency for filtering

Returns:
The minimun filtering frequency

setMinFreq

public void setMinFreq(double minFreq)
Sets the minimun frequency for filtering.

Parameters:
minFreq - The minimun filtering frequency

getMaxFreq

public double getMaxFreq()
Gets the maximun frequency for filtering

Returns:
The maximun filtering frequency

setMaxFreq

public void setMaxFreq(double maxFreq)
Sets the maximun frequency for filtering. This value must be on the range (fmin,F], where

F = (datasize - 1) * sampleRate / (2 * datasize)

If set to an out of range value, the highest possible frequency (F) is used.

Parameters:
maxFreq - The maximun filtering frequency

process

public void process(Buffer in,
                    Buffer out)
             throws DataProcessorException
Description copied from interface: DataProcessor
Data is pulled from imput buffer, processed and pushed into the output buffer. Processing mus finish as sooan as a CloseData is received.

Parameters:
in - Input Buffer
out - Output Buffer
Throws:
DataProcessorException

editBeanInfo

public void editBeanInfo(java.beans.BeanInfo info)
Overrides:
editBeanInfo in class AbstractDataProcessor

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

Sautrela