|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.icdif.audio.analysis.FourierTransform
com.icdif.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.icdif.audio.analysis.FourierTransform |
---|
HAMMING, NONE |
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 | |
---|---|
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.icdif.audio.analysis.FourierTransform |
---|
avgSize, calcAvg, forward, freqToIndex, getAverageCenterFrequency, getAvg, getBand, getBandWidth, getFreq, getImaginaryPart, getRealPart, getSpectrum, indexToFreq, inverse, linAverages, logAverages, noAverages, scaleFreq, setFreq, specSize, timeSize, window |
Methods inherited from class java.lang.Object |
---|
equals, 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 |
---|
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 |