|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.audio.analysis.FourierTransform
com.badlogic.gdx.audio.analysis.DFT
public class DFT
DFT stands for Discrete Fourier Transform and is the most widely used Fourier Transform. You will never want to use this class
due to the fact that it is a brute force implementation of the DFT and as such is quite slow. Use an FFT instead. This exists
primarily as a way to ensure that other implementations of the DFT are working properly. This implementation expects an even
timeSize
and will throw and IllegalArgumentException if this is not the case.
FourierTransform
,
FFT
,
The Discrete Fourier TransformField Summary |
---|
Fields inherited from class com.badlogic.gdx.audio.analysis.FourierTransform |
---|
averages, avgPerOctave, bandWidth, HAMMING, imag, LINAVG, LOGAVG, NOAVG, NONE, octaves, real, sampleRate, spectrum, timeSize, TWO_PI, whichAverage, whichWindow |
Constructor Summary | |
---|---|
DFT(int timeSize,
float sampleRate)
Constructs a DFT that expects audio buffers of length timeSize that have been recorded with a sample rate of
sampleRate . |
Method Summary | |
---|---|
protected void |
allocateArrays()
|
void |
forward(float[] samples)
Performs a forward transform on buffer . |
void |
inverse(float[] buffer)
Performs an inverse transform of the frequency spectrum and places the result in buffer . |
void |
scaleBand(int i,
float s)
Not currently implemented. |
void |
setBand(int i,
float a)
Not currently implemented. |
Methods inherited from class com.badlogic.gdx.audio.analysis.FourierTransform |
---|
avgSize, calcAvg, doWindow, fillSpectrum, forward, freqToIndex, getAverageCenterFrequency, getAvg, getBand, getBandWidth, getFreq, getImaginaryPart, getRealPart, getSpectrum, hamming, indexToFreq, inverse, linAverages, logAverages, noAverages, scaleFreq, setComplex, setFreq, specSize, timeSize, window |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DFT(int timeSize, float sampleRate)
timeSize
that have been recorded with a sample rate of
sampleRate
. Will throw an IllegalArgumentException if timeSize
is not even.
timeSize
- the length of the audio buffers you plan to analyzesampleRate
- the sample rate of the audio samples you plan to analyzeMethod Detail |
---|
protected void allocateArrays()
allocateArrays
in class FourierTransform
public void scaleBand(int i, float s)
scaleBand
in class FourierTransform
i
- the frequency band to modifys
- the scaling factorpublic void setBand(int i, float a)
setBand
in class FourierTransform
i
- the frequency band to modifya
- the new amplitudepublic void forward(float[] samples)
FourierTransform
buffer
.
forward
in class FourierTransform
samples
- the buffer to analyzepublic void inverse(float[] buffer)
FourierTransform
buffer
.
inverse
in class FourierTransform
buffer
- the buffer to place the result of the inverse transform in
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |