|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcomirva.audio.util.Sone
public class Sone
Specific Loudness Sensation - Sone
Description:
Computes sonogram from a pcm signal. A sonogram of an audio segment consists of the specific loudness sensation (Sone) per critical-band (bark) in short time intervals[1]. One object supports only one sample rate and a given window size.
| Field Summary | |
|---|---|
protected double |
baseFreq
|
protected int |
hopSize
|
protected FFT |
normalizedPowerFFT
|
protected float |
sampleRate
|
protected int |
windowSize
|
| Constructor Summary | |
|---|---|
Sone(float sampleRate)
Creates a Sone object with default window size of 256 for the given sample rate. |
|
Sone(int windowSize,
float sampleRate)
Ceates a Sone object with given window size and sample rate. |
|
| Method Summary | |
|---|---|
int[] |
getBarkUpperBoundaries(double sampleRate)
Returns an array with the upper boundaries of the bark bands. |
int |
getHopSize()
Returns the number of samples skipped between two windows. |
double[][] |
getSpreadMatrix(int barkSize)
Creates a matrix for computation of spectral masking effects for the used bark bands. |
double[] |
getTerhardtWeights(double baseFrequency,
int vectorSize)
Creates a weight vector according to the outer ear formula of Terhardt. |
Vector<double[]> |
process(AudioPreProcessor in)
Performs the transformation of the input data to Sone. |
double[][] |
process(double[] input)
Performs the transformation of the input data to Sone. |
double[] |
processWindow(double[] window,
int start)
Transforms one window of samples to Sone. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int windowSize
protected int hopSize
protected float sampleRate
protected double baseFreq
protected FFT normalizedPowerFFT
| Constructor Detail |
|---|
public Sone(float sampleRate)
throws IllegalArgumentException
sampleRate - float samples per second, must be greater than zero; not
whole-numbered values get rounded
IllegalArgumentException - raised if method contract is violated
public Sone(int windowSize,
float sampleRate)
throws IllegalArgumentException
windowSize - int size of a windowsampleRate - float samples per second, must be greater than zero; not
whole-numbered values get rounded
IllegalArgumentException - raised if method contract is violated| Method Detail |
|---|
public int getHopSize()
public Vector<double[]> process(AudioPreProcessor in)
throws IllegalArgumentException,
IOException
in - AudioPreProcessor input data is a complete Audio stream, must
have the same sample rate like this sone object,
must not be a null value
IOException - if there are any problems regarding the inputstream
IllegalArgumentException - raised if method contract is violated
public double[][] process(double[] input)
throws IllegalArgumentException,
IOException
input - double[] input data is an array of samples, must be a multiple
of the hop size, must not be a null value
IOException - if there are any problems regarding the inputstream
IllegalArgumentException - raised if method contract is violated
public double[] processWindow(double[] window,
int start)
throws IllegalArgumentException
window - double[] data to be converted, must contain enough data for
one windowstart - int start index of the window data
IllegalArgumentException - raised if method contract is violated
public double[] getTerhardtWeights(double baseFrequency,
int vectorSize)
throws IllegalArgumentException
baseFrequency - The base frequency (Hz) the weights are based on. The
frequency of the first component of the weight vector.
The base frequency must be a positive value.vectorSize - dimension of the vector to compute, must be a positive
value or zero
IllegalArgumentException - raised if method contract is violated
public double[][] getSpreadMatrix(int barkSize)
throws IllegalArgumentException
barkSize - the number of bark bands in use for the calculation of the
masking effects, must be a positive value
IllegalArgumentException - raised if method contract is violated
public int[] getBarkUpperBoundaries(double sampleRate)
throws IllegalArgumentException
sampleRate - sample rate (Hz), must be a positive value
IllegalArgumentException - raised if method contract is violated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||