public class DFT extends FourierTransform
timeSize
and will throw and IllegalArgumentException if this
is not the case.FourierTransform
,
FFT
,
The Discrete Fourier Transformaverages, avgPerOctave, bandWidth, BARTLETT, BARTLETTHANN, BLACKMAN, COSINE, GAUSS, HAMMING, HANN, imag, LANCZOS, LINAVG, LOGAVG, NOAVG, NONE, octaves, real, sampleRate, spectrum, timeSize, TRIANGULAR, TWO_PI, whichAverage, windowFunction
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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.
|
avgSize, calcAvg, doWindow, fillSpectrum, forward, forward, forward, freqToIndex, getAverageCenterFrequency, getAvg, getBand, getBandWidth, getFreq, getSpectrumImaginary, getSpectrumReal, indexToFreq, inverse, inverse, linAverages, logAverages, noAverages, scaleFreq, setComplex, setFreq, specSize, timeSize, window
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 analyzeprotected 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