Sautrela

edu.gtts.sautrela.sp
Class Preemphasis

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

public class Preemphasis
extends AbstractDataProcessor

Implements a high-pass filter that compensates for attenuation in the audio data.

The used formulae, Y[i] = X[i] - (X[i-1] * factor) , is equivalent to the transfer function p(z) = 1 - factor * Z^(-1) and the frecuency response 1 - factor * exp(-jTw) .

See Also:
Serialized Form

Field Summary
static double DEFAULT_FACTOR
          default preemphasis factor == 0.97
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
Preemphasis()
          Creates a new Preemphasis DataProcessor using the default factor
 
Method Summary
 void editBeanInfo(java.beans.BeanInfo info)
           
 double getFactor()
          Gets the pre-emphasis factor
static void main(java.lang.String[] args)
           
 void process(Buffer in, Buffer out)
          Applies pre-emphasis filter to the given Data.
 void setFactor(double factor)
          Sets the pre-emphasis factor
 
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_FACTOR

public static final double DEFAULT_FACTOR
default preemphasis factor == 0.97

See Also:
Constant Field Values
Constructor Detail

Preemphasis

public Preemphasis()
Creates a new Preemphasis DataProcessor using the default factor

Method Detail

getFactor

public double getFactor()
Gets the pre-emphasis factor

Returns:
The pre-emphasis factor

setFactor

public void setFactor(double factor)
Sets the pre-emphasis factor

Parameters:
factor - pre-emphasis factor

process

public void process(Buffer in,
                    Buffer out)
             throws DataProcessorException
Applies pre-emphasis filter to the given Data. First value of a Data Stream is not affected. Both IntData and DoubleData are supported.

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