Package com.tagtraum.audiokern.math
Class Mauch2010Transform
- java.lang.Object
-
- com.tagtraum.audiokern.math.Mauch2010Transform
-
- All Implemented Interfaces:
Transform
public class Mauch2010Transform extends Object implements Transform
A constant Q transform that is computed using the algorithm described in Matthias Mauch's 2010 PhD thesis Automatic Chord Transcription from Audio Using Computational Models of Musical Context.
-
-
Constructor Summary
Constructors Constructor Description Mauch2010Transform(int fractionsPerSemitone, float sampleRate, int blockSize)
Creates a transformation object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
float[][]
fourierToConstantQTransform(float[] real, float[] imaginary)
Converts the result of a fourier transform (seeTransform.transform(float[])
) into the result of the Mauch2010 transform.float[]
getFrequencies()
float
getQ()
int
hashCode()
float[][]
inverseTransform(float[] real, float[] imaginary)
String
toString()
float[][]
transform(float[] real)
float[][]
transform(float[] real, float[] imaginary)
-
-
-
Field Detail
-
MIN_MIDI
public static final int MIN_MIDI
- See Also:
- Constant Field Values
-
MAX_MIDI
public static final int MAX_MIDI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Mauch2010Transform
public Mauch2010Transform(int fractionsPerSemitone, float sampleRate, int blockSize)
Creates a transformation object.- Parameters:
fractionsPerSemitone
- number parts into which each semitone is split upsampleRate
- sample rateblockSize
- processing block size - this is also the length of the internally used FFT.
-
-
Method Detail
-
transform
public float[][] transform(float[] real) throws IllegalArgumentException
- Specified by:
transform
in interfaceTransform
- Throws:
IllegalArgumentException
-
inverseTransform
public float[][] inverseTransform(float[] real, float[] imaginary) throws UnsupportedOperationException
- Specified by:
inverseTransform
in interfaceTransform
- Throws:
UnsupportedOperationException
-
transform
public float[][] transform(float[] real, float[] imaginary) throws UnsupportedOperationException
- Specified by:
transform
in interfaceTransform
- Throws:
UnsupportedOperationException
-
fourierToConstantQTransform
public float[][] fourierToConstantQTransform(float[] real, float[] imaginary)
Converts the result of a fourier transform (seeTransform.transform(float[])
) into the result of the Mauch2010 transform. This method allows you to split the transform into its two parts - the FFT part and the processing of the FFT results.- Parameters:
real
- real data (frequency domain)imaginary
- imaginary data (frequency domain)- Returns:
- result of this constant Q transform
-
getQ
public float getQ()
-
getFrequencies
public float[] getFrequencies()
-
-