public class LogFrequencySpectrum extends AbstractAudioSpectrum implements Cloneable
ConstantQTransform.ConstantQTransform,
ConstantQTransformFactoryaudioFormat, frameNumber, imaginaryData, magnitudes, powers, realData| Constructor and Description |
|---|
LogFrequencySpectrum(int frameNumber,
float[] real,
float[] imag,
AudioFormat audioFormat,
float q,
float[] frequencies) |
LogFrequencySpectrum(LogFrequencySpectrum logFrequencySpectrum) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Creates an exact copy of this buffer.
|
LogFrequencySpectrum |
derive(float shift)
Creates a copy of this spectrum with the bins' values shifted (interpolated) by shift*
getBinsPerSemitone()
bins. |
LogFrequencySpectrum |
derive(float[] real,
float[] imaginary)
Creates a copy of this spectrum, but replaces its values with the given real and imaginary data.
|
int |
getBin(float frequency)
Returns the bin that is closest to the given frequency.
|
float |
getBinsPerSemitone()
Number of fractions each semitone is divided into.
|
float[] |
getFrequencies()
Center frequencies for each bin.
|
float |
getMidiNote(int index)
MIDI note for a bin/index.
|
float[] |
getMidiNotes()
MIDI notes for each bin.
|
float |
getQ()
Returns the ratio between a note's frequency and its bandwidth.
|
String |
toString() |
computeMagnitudes, computePowers, getAudioFormat, getData, getFrameNumber, getFrequency, getImaginaryData, getMagnitudes, getNumberOfSamples, getPowers, getRealData, getTimestamp, getTimestamp, reusepublic LogFrequencySpectrum(int frameNumber,
float[] real,
float[] imag,
AudioFormat audioFormat,
float q,
float[] frequencies)
public LogFrequencySpectrum(LogFrequencySpectrum logFrequencySpectrum)
public float getBinsPerSemitone()
Number of fractions each semitone is divided into.
E.g. if binsPerSemitone
LinearFrequencySpectrum.getBandwidth(),
getQ()public float getQ()
Returns the ratio between a note's frequency and its bandwidth.
Q is directly related to getBinsPerSemitone(), as it is defined
like this:
Q = (binsPerSemitone * 12) / ln 2
Instances of this spectrum have a constant Q value.
getBinsPerSemitone()public LogFrequencySpectrum derive(float[] real, float[] imaginary)
AudioSpectrumderive in interface AudioBufferderive in interface AudioSpectrumreal - real dataimaginary - imaginary datapublic LogFrequencySpectrum derive(float shift)
getBinsPerSemitone()
bins. Note that the frequencies are not adjusted.
This is e.g. useful to map a tuning other than 440Hz into the regular 440Hz tuning.shift - value between -1 and 1public float[] getFrequencies()
getFrequencies in interface AudioSpectrumAudioSpectrum.getFrequency(int)public float[] getMidiNotes()
public float getMidiNote(int index)
index - bin indexgetMidiNotes()public int getBin(float frequency)
getBin in interface AudioSpectrumfrequency - frequencypublic Object clone() throws CloneNotSupportedException
AudioBufferclone in interface AudioBufferclone in class AbstractAudioSpectrumCloneNotSupportedExceptionCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.