|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object comirva.audio.extraction.AttributeExtractor comirva.audio.extraction.AudioFeatureExtractor comirva.audio.extraction.SpectralPatternCentExtractor
public class SpectralPatternCentExtractor
Title: Fluctuation Patterns
Description:
This class supports the extraction of the so-called "Fluctuation Patterns" from an audio stream. This is a advanced version based on the cent scale instead of the bark scale.
AudioFeatureExtractor
,
FluctuationPattern
Field Summary | |
---|---|
protected int |
blockSize
|
protected CentSpectrum |
centProcessor
|
protected int |
delta
|
protected int |
frameHop
|
protected AudioPreProcessor |
preProcessor
|
protected float |
sampleRate
|
Constructor Summary | |
---|---|
SpectralPatternCentExtractor()
The default constructor uses segments of size 65536 samples. |
|
SpectralPatternCentExtractor(float sampleRate)
Constructs an individualized FluctuationPatternExtractor. |
Method Summary | |
---|---|
Attribute |
calculate(File input)
This method is used to calculate the fluctuation pattern for a whole song. |
AttributeExtractor |
copy()
This method returns a copy of an AttributeExtractor. |
protected Matrix |
createPattern(double[][] block)
Computes the fluctuation pattern for a short piece of audio. |
int |
getAttributeType()
Returns the type of the attribute that the class implementing this interface will return as the result of its extraction process. |
(package private) double[][] |
getBlock(Vector<double[]> normalizedCentSpectrum,
int start)
|
(package private) double[] |
getDiff(double[] a,
double[] b)
|
static double |
getQuantil(double[] array,
double quantil)
Computes the median of all the elements in the array. |
protected Matrix |
getSpectralPatterns()
Splits the audio stream in short segments and computes a fluctuation pattern for every third segment. |
String |
toString()
Returns the feature extractors name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int frameHop
protected int blockSize
protected int delta
protected float sampleRate
protected CentSpectrum centProcessor
protected AudioPreProcessor preProcessor
Constructor Detail |
---|
public SpectralPatternCentExtractor()
public SpectralPatternCentExtractor(float sampleRate)
fftSize
- int number of cent values to considersegmentSize
- int number of samples a segments consists ofMethod Detail |
---|
public AttributeExtractor copy()
AttributeExtractor
copy
in class AttributeExtractor
public Attribute calculate(File input) throws IllegalArgumentException, IOException, UnsupportedAudioFileException
AudioPreProcessor
object. All settings are set by the constructor, so this method can easily
be called for a large number of songs to extract this feature.
calculate
in class AttributeExtractor
input
- Object an AudioPreProcessor
representing the audio
input stream;
FluctuationPattern
feature is returned as a
result of this feature extraction process
IOException
- if there are any problems regarding the inputstream
IllegalArgumentException
- raised if method contract of a subroutine
is violated
UnsupportedAudioFileException
protected Matrix getSpectralPatterns() throws IOException, IllegalArgumentException
IOException
- if there are any problems regarding the inputstream
IllegalArgumentException
- raised if method contract of a subroutine
is violateddouble[] getDiff(double[] a, double[] b)
double[][] getBlock(Vector<double[]> normalizedCentSpectrum, int start)
protected Matrix createPattern(double[][] block)
sone
- double[][] sone values; must not be a null value;
public static double getQuantil(double[] array, double quantil) throws IllegalArgumentException
array
- double[] array of values; must not be a null value and must
contain at least one element;
IllegalArgumentException
- raised if method contract is violatedpublic int getAttributeType()
getAttributeType
in class AttributeExtractor
Attribute
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |