This commit is contained in:
Gianpaolo Coro 2014-02-04 12:37:48 +00:00
parent 3b071a58f9
commit a3a150a8bd
1 changed files with 4 additions and 4 deletions

View File

@ -303,7 +303,7 @@ public class SignalConversions {
return (int) (time * sampleRate);
}
static double[] takeMaxFrequenciesInSpectrogram(double[][] spectrogram, int samplingRate,int windowSamples, float minfreq) {
public static double[] takeMaxFrequenciesInSpectrogram(double[][] spectrogram, int samplingRate,int windowSamples, float minfreq) {
double[] maxs = new double[spectrogram.length];
int j = 0;
for (double[] slice : spectrogram) {
@ -328,7 +328,7 @@ public class SignalConversions {
return maxs;
}
static double[] takeLongestStableTract(double[] signal, double valuedifftoleranceperc) {
public static double[] takeLongestStableTract(double[] signal, double valuedifftoleranceperc) {
ArrayList<int[]> pairs = new ArrayList<int[]>();
int idx1 = -1;
@ -381,11 +381,11 @@ public class SignalConversions {
return subsignal;
}
static float spectrumIdx2Frequency(int idx,int samplingRate,int windowsSizeSamples){
public static float spectrumIdx2Frequency(int idx,int samplingRate,int windowsSizeSamples){
return ((float)idx*samplingRate)/(float)(windowsSizeSamples-1);
}
static int spectrumFreq2Idx(float freq, int samplingRate,int windowsSizeSamples){
public static int spectrumFreq2Idx(float freq, int samplingRate,int windowsSizeSamples){
return Math.round((windowsSizeSamples-1)*freq/samplingRate);
}