

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object jAudioFeatureExtractor.jAudioTools.DSPMethods
public class DSPMethods
A holder class for general static methods relating to processing signals in the form of samples stored as arrays of doubles.
Constructor Summary  

DSPMethods()

Method Summary  

static double[][] 
applyGain(double[][] samples,
double gain)
Applies a gain to the given samples. 
static double 
convertSampleToTime(int sample,
float sampling_rate)
Returns the time corresponding to the given sample indice with the given sampling rate. 
static int 
convertTimeToSample(double time,
float sampling_rate)
Returns the sample corresponding to the given time with the given sampling rate. 
static double[] 
getAutoCorrelation(double[] signal,
int min_lag,
int max_lag)
Calculates the autocorrelation of the given signal. 
static double[] 
getAutoCorrelationLabels(double sampling_rate,
int min_lag,
int max_lag)
Returns the bin labels for each bin of an autocorrelation calculation that involved the given paremeters (most likely using the getAutoCorrelation method). 
static double[][] 
getCopyOfSamples(double[][] original_samples)
Returns a copy of the given array of samples. 
static double[] 
getSamplesMixedDownIntoOneChannel(double[][] audio_samples)
Returns the given set of samples as a set of samples mixed down into one channel. 
static double[] 
normalizeSamples(double[] samples_to_normalize)
Normalizes the given samples so that the absolute value of the highest sample amplitude is 1. 
static double[][] 
normalizeSamples(double[][] samples_to_normalize)
Normalizes the given samples dependantly so that the absolute value of the highest sample amplitude is 1. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public DSPMethods()
Method Detail 

public static double[][] applyGain(double[][] samples, double gain)
samples
 Audio samles to modify, usually with a minimum value
of 1 and a maximum value of +1. The first indice
corresponds to the channel and the second indice
corresponds to the sample number.gain
 The gain to apply.
public static double[] getSamplesMixedDownIntoOneChannel(double[][] audio_samples)
audio_samples
 Audio samles to modify, with a minimum value of
1 and a maximum value of +1. The first indice
corresponds to the channel and the second indice
corresponds to the sample number.
public static double[] normalizeSamples(double[] samples_to_normalize)
samples_to_normalize
 The samples to normalize.
public static double[][] normalizeSamples(double[][] samples_to_normalize)
samples_to_normalize
 The samples to normalize. The first indice
denotes channel and the second denotes sample
number.
public static double[][] getCopyOfSamples(double[][] original_samples)
original_samples
 Audio samles to modify, usually with a minimum value of
value of 1 and a maximum value of +1. The first indice
corresponds to the channel and the second indice
corresponds to the sample number.
public static int convertTimeToSample(double time, float sampling_rate)
time
 The time in seconds to convert to a sample indice.sampling_rate
 The sampling rate of the audio in question.
public static double convertSampleToTime(int sample, float sampling_rate)
sample
 The sample indice to convert to time.sampling_rate
 The sampling rate of the audio in question.
public static double[] getAutoCorrelation(double[] signal, int min_lag, int max_lag)
The getAutoCorrelationLabels method can be called to find the labels in Hz for each of the returned bins.
signal
 The digital signal to autocorrelate.min_lag
 The minimum lag in samples to look for in the autocorrelation.max_lag
 The maximum lag in samples to look for in the autocorrealtion.
public static double[] getAutoCorrelationLabels(double sampling_rate, int min_lag, int max_lag)
sampling_rate
 The sampling rate that was used to encode
the signal that was autocorrelated.min_lag
 The minimum lag in samples that was used in the
autocorrelation.max_lag
 The maximum lag in samples that was used in the
autocorrelation.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 