|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ddf.minim.analysis.FourierTransform ddf.minim.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 ddf.minim.analysis.FourierTransform |
---|
averages, avgPerOctave, bandWidth, BARTLETT, BARTLETTHANN, COSINE, HAMMING, HANN, imag, LANCZOS, LINAVG, LOGAVG, NOAVG, NONE, octaves, real, sampleRate, spectrum, timeSize, TRIANGULAR, TWO_PI, whichAverage, windowFunction |
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 ddf.minim.analysis.FourierTransform |
---|
avgSize, calcAvg, doWindow, fillSpectrum, forward, forward, forward, freqToIndex, getAverageCenterFrequency, getAvg, getBand, getBandWidth, getFreq, indexToFreq, inverse, 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |