libgdx API

com.badlogic.gdx.audio.analysis
Class KissFFT

java.lang.Object
  extended by com.badlogic.gdx.audio.analysis.KissFFT
All Implemented Interfaces:
Disposable

public class KissFFT
extends java.lang.Object
implements Disposable

A class for spectral analysis using native KissFFT

Author:
mzechner

Constructor Summary
KissFFT(int numSamples)
          Creates a new fft instance that can analyse numSamples samples.
 
Method Summary
 void dispose()
          Releases all resources of this object
 void getImagPart(java.nio.ShortBuffer imag)
           
 void getRealPart(java.nio.ShortBuffer real)
           
 void spectrum(java.nio.ShortBuffer samples, java.nio.FloatBuffer spectrum)
          Calculates the frequency spectrum of the given samples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KissFFT

public KissFFT(int numSamples)
Creates a new fft instance that can analyse numSamples samples. timeSize must be a power of two.

Parameters:
numSamples - the number of samples to be analysed.
Method Detail

spectrum

public void spectrum(java.nio.ShortBuffer samples,
                     java.nio.FloatBuffer spectrum)
Calculates the frequency spectrum of the given samples. There must be as many samples as specified in the constructor of this class. Spectrum must hold timeSize / 2 + 1 elements

Parameters:
samples - the samples
spectrum - the spectrum

dispose

public void dispose()
Releases all resources of this object

Specified by:
dispose in interface Disposable

getRealPart

public void getRealPart(java.nio.ShortBuffer real)

getImagPart

public void getImagPart(java.nio.ShortBuffer imag)

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)