git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@90869 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3b071a58f9
commit
a3a150a8bd
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue