org.mobicents.media.server.impl.resource
Class GoertzelFilter

java.lang.Object
  extended by org.mobicents.media.server.impl.resource.GoertzelFilter

public class GoertzelFilter
extends java.lang.Object

Author:
kulikov

Constructor Summary
GoertzelFilter()
          Creates a new instance of the Goertzel Filter.
GoertzelFilter(int f, int N, double len)
          Creates a new instance of the Goertzel Filter for predefined frequency of the signal.
 
Method Summary
 double getPower(double[] signal, int offset)
          Calculates power of the specified frequence of the specified signal.
 double getPower(double f, double[] signal, int offset, int len, double scale)
          Calculates power of the specified frequence of the specified signal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoertzelFilter

public GoertzelFilter()
Creates a new instance of the Goertzel Filter.


GoertzelFilter

public GoertzelFilter(int f,
                      int N,
                      double len)
Creates a new instance of the Goertzel Filter for predefined frequency of the signal.

Parameters:
the - length of this signal is samples.
len - the length of the signal is seconds.
the - frequency of the signal.
Method Detail

getPower

public double getPower(double f,
                       double[] signal,
                       int offset,
                       int len,
                       double scale)
Calculates power of the specified frequence of the specified signal.

Parameters:
f - the frequence value.
signal - sampled signal.
offset - index of the first sample of the signal.
len - the length of signal in samples
scale - the length of signal in seconds
Returns:
the power of the specified frequency

getPower

public double getPower(double[] signal,
                       int offset)
Calculates power of the specified frequence of the specified signal.

Parameters:
signal - sampled signal.
offset - index of the first sample of the signal.
Returns:
the power of the specified frequency


Copyright © 2010. All Rights Reserved.