uk.org.toot.audio.core
Class FloatDenormals

java.lang.Object
  extended by uk.org.toot.audio.core.FloatDenormals

public class FloatDenormals
extends java.lang.Object

Provides ways to deal with FPU denormals, which, if left in audio data tend to cause exceptionally high CPU uage. Floating point denormals typically occur when a feedback network causes an exponential decay. Eventually the value becomes so small it cannot be represented efficiently by the FPU.


Field Summary
static float THRESHOLD
           
 
Constructor Summary
FloatDenormals()
           
 
Method Summary
static int countDenorms(float[] array, int len)
          Count denormal floats in an array.
static boolean isDenormal(float x)
          Detect a denormal float (excluding zero).
static boolean isDenormalOrZero(float x)
          Detect a denormal (or zero) float.
static float zeroDenorm(float x)
          Replace a denormal float with zero.
static void zeroDenorms(float[] array, int len)
          Replace denormal floats in an array with zeros.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THRESHOLD

public static final float THRESHOLD
See Also:
Constant Field Values
Constructor Detail

FloatDenormals

public FloatDenormals()
Method Detail

isDenormal

public static boolean isDenormal(float x)
Detect a denormal float (excluding zero).


isDenormalOrZero

public static boolean isDenormalOrZero(float x)
Detect a denormal (or zero) float. Faster than isDenormal() if appropriate.


zeroDenorm

public static float zeroDenorm(float x)
Replace a denormal float with zero.


zeroDenorms

public static void zeroDenorms(float[] array,
                               int len)
Replace denormal floats in an array with zeros.


countDenorms

public static int countDenorms(float[] array,
                               int len)
Count denormal floats in an array.



Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.