Minim core
ugens
analysis
Name DFT
Description 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.
Examples
None available
Constructors
DFT(timeSize, sampleRate);
Parameters
timeSize   the length of the audio buffers you plan to analyze
sampleRate   the sample rate of the audio samples you plan to analyze
Fields
BARTLETT   A constant indicating a Bartlett window should be used on sample buffers.

BARTLETTHANN   A constant indicating a Bartlett-Hann window should be used on sample buffers.

BLACKMAN   A constant indicating a Blackman window with a default value should be used on sample buffers.

COSINE   A constant indicating a Cosine window should be used on sample buffers.

GAUSS   A constant indicating a Gauss window with a default value should be used on sample buffers.

HAMMING   A constant indicating a Hamming window should be used on sample buffers.

HANN   A constant indicating a Hann window should be used on sample buffers.

LANCZOS   A constant indicating a Lanczos window should be used on sample buffers.

NONE   A constant indicating no window should be used on sample buffers. Also referred as a Rectangular window.

TRIANGULAR   A constant indicating a Triangular window should be used on sample buffers.

Methods
avgSize ( )   Returns the number of averages currently being calculated.

calcAvg ( )   Calculate the average amplitude of the frequency band bounded by lowFreq and hiFreq, inclusive.

forward ( )   Performs a forward transform on buffer.

freqToIndex ( )   Returns the index of the frequency band that contains the requested frequency.

getAverageBandWidth ( )   Returns the bandwidth of the requested average band. Using this information and the return value of getAverageCenterFrequency you can determine the lower and upper frequency of any average band.

getAverageCenterFrequency ( )   Returns the center frequency of the ith average band.

getAvg ( )   Gets the value of the ith average.

getBand ( )   Returns the amplitude of the requested frequency band.

getBandWidth ( )   Returns the width of each frequency band in the spectrum (in Hz). It should be noted that the bandwidth of the first and last frequency bands is half as large as the value returned by this function.

getFreq ( )   Gets the amplitude of the requested frequency in the spectrum.

getSpectrumImaginary ( )   Get the Imaginary part of the Complex representation of the spectrum.

getSpectrumReal ( )   Get the Real part of the Complex representation of the spectrum.

indexToFreq ( )   Returns the middle frequency of the ith band.

inverse ( )   Performs an inverse transform of the frequency spectrum and places the result in buffer.

linAverages ( )   Sets the number of averages used when computing the spectrum and spaces the averages in a linear manner. In other words, each average band will be specSize() / numAvg bands wide.

logAverages ( )   Sets the number of averages used when computing the spectrum based on the minimum bandwidth for an octave and the number of bands per octave. For example, with audio that has a sample rate of 44100 Hz, logAverages(11, 1) will result in 12 averages, each corresponding to an octave, the first spanning 0 to 11 Hz. To ensure that each octave band is a full octave, the number of octaves is computed by dividing the Nyquist frequency by two, and then the result of that by two, and so on. This means that the actual bandwidth of the lowest octave may not be exactly the value specified.

noAverages ( )   Sets the object to not compute averages.

scaleBand ( )   Scales the amplitude of the ith frequency band by s. You can use this to shape the spectrum before using inverse().

scaleFreq ( )   Scales the amplitude of the requested frequency by a.

setBand ( )   Sets the amplitude of the ith frequency band to a. You can use this to shape the spectrum before using inverse().

setFreq ( )   Sets the amplitude of the requested frequency in the spectrum to a.

specSize ( )   Returns the size of the spectrum created by this transform. In other words, the number of frequency bands produced by this transform. This is typically equal to timeSize()/2 + 1, see above for an explanation.

timeSize ( )   Returns the length of the time domain signal expected by this transform.

window ( )   Sets the window to use on the samples before taking the forward transform. If an invalid window is asked for, an error will be reported and the current window will not be changed.

Usage Web & Application
Related