Loading dwtools/CC.cpp +2 −2 Original line number Diff line number Diff line /* CC.cpp * * Copyright (C) 1993-2018 David Weenink * Copyright (C) 1993-2019 David Weenink * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Loading Loading @@ -49,7 +49,7 @@ Thing_implement (CC, Sampled, 1); static integer CC_getMaximumNumberOfCoefficientsUsed (CC me) { integer CC_getMaximumNumberOfCoefficientsUsed (CC me) { integer numberOfCoefficients = 0; for (integer iframe = 1; iframe <= my nx; iframe ++) { CC_Frame cf = & my frame [iframe]; Loading dwtools/CC.h +3 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ #define _CC_h_ /* CC.h * * Copyright (C) 1993-2017 David Weenink * Copyright (C) 1993-2019 David Weenink * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Loading Loading @@ -34,6 +34,8 @@ void CC_init (CC me, double tmin, double tmax, integer nt, double dt, double t1, void CC_getNumberOfCoefficients_extrema (CC me, integer startframe, integer endframe, integer *min, integer *max); integer CC_getMaximumNumberOfCoefficientsUsed (CC me); integer CC_getMinimumNumberOfCoefficients (CC me, integer startframe, integer endframe); integer CC_getMaximumNumberOfCoefficients (CC me, integer startframe, integer endframe); Loading dwtools/CCs_to_DTW.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ autoDTW CCs_to_DTW (CC me, CC thee, double coefficientWeight, double logEnergyWe integer nr = Melder_ifloor (regressionWindowLength / my dx); Melder_require (my maximumNumberOfCoefficients == thy maximumNumberOfCoefficients, U"CC orders should be equal."); U"The maximum number of coefficients should be equal."); Melder_require (! (coefficientRegressionWeight != 0.0 && nr < 2), U"Time window for regression is too small."); Loading dwtools/Sound_and_Spectrogram_extensions.cpp +7 −5 Original line number Diff line number Diff line /* Sound_and_Spectrogram_extensions.cpp * * Copyright (C) 1993-2018 David Weenink * Copyright (C) 1993-2019 David Weenink * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Loading Loading @@ -166,7 +166,7 @@ static void Sound_into_MelSpectrogram_frame (Sound me, MelSpectrogram thee, inte autoSpectrum him = Sound_to_Spectrum_power (me); for (integer ifilter = 1; ifilter <= thy ny; ifilter ++) { double power = 0; longdouble power = 0.0; double fc_mel = thy y1 + (ifilter - 1) * thy dy; double fc_hz = thy v_frequencyToHertz (fc_mel); double fl_hz = thy v_frequencyToHertz (fc_mel - thy dy); Loading @@ -180,7 +180,7 @@ static void Sound_into_MelSpectrogram_frame (Sound me, MelSpectrogram thee, inte double a = NUMtriangularfilter_amplitude (fl_hz, fc_hz, fh_hz, f); power += a * his z [1] [i]; } thy z [ifilter] [frame] = power; thy z [ifilter] [frame] = double (power); } } Loading @@ -195,8 +195,10 @@ autoMelSpectrogram Sound_to_MelSpectrogram (Sound me, double analysisWidth, doub if (fmax_mel <= 0.0 || fmax_mel > fceiling) fmax_mel = fceiling; if (fmax_mel <= f1_mel) f1_mel = fbottom; fmax_mel = fceiling; if (fmax_mel <= f1_mel) { f1_mel = fbottom; fmax_mel = fceiling; } if (f1_mel <= 0.0) f1_mel = fbottom; if (df_mel <= 0.0) Loading dwtools/praat_David_init.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -4072,6 +4072,12 @@ DO NUMBER_ONE_END (U"") } DIRECT (NUMMAT_PatternList_getAllValues) { NUMMAT_ONE (PatternList) autoMAT result = newMATcopy (my z.all()); NUMMAT_ONE_END } FORM (MODIFY_PatternList_formula, U"PatternList: Formula", nullptr) { LABEL (U"# `col` is the node number, `row` is the pattern number") LABEL (U"for row from 1 to nrow ; for all patterns") Loading Loading @@ -8159,6 +8165,7 @@ void praat_uvafon_David_init () { praat_addAction1 (classPatternList, 0, MODIFY_BUTTON, nullptr, 0, 0); praat_addAction1 (classPatternList, 0, U"Formula...", nullptr, 1, MODIFY_PatternList_formula); praat_addAction1 (classPatternList, 0, U"Set value...", nullptr, 1, MODIFY_PatternList_setValue); praat_addAction1 (classPatternList, 0, U"Get all values", nullptr, 0, NUMMAT_PatternList_getAllValues); praat_addAction1 (classPatternList, 0, U"To Matrix", nullptr, 0, NEW_PatternList_to_Matrix); praat_addAction2 (classPatternList, 1, classCategories, 1, U"To TableOfReal", nullptr, 0, NEW1_Matrix_Categories_to_TableOfReal); Loading Loading
dwtools/CC.cpp +2 −2 Original line number Diff line number Diff line /* CC.cpp * * Copyright (C) 1993-2018 David Weenink * Copyright (C) 1993-2019 David Weenink * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Loading Loading @@ -49,7 +49,7 @@ Thing_implement (CC, Sampled, 1); static integer CC_getMaximumNumberOfCoefficientsUsed (CC me) { integer CC_getMaximumNumberOfCoefficientsUsed (CC me) { integer numberOfCoefficients = 0; for (integer iframe = 1; iframe <= my nx; iframe ++) { CC_Frame cf = & my frame [iframe]; Loading
dwtools/CC.h +3 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ #define _CC_h_ /* CC.h * * Copyright (C) 1993-2017 David Weenink * Copyright (C) 1993-2019 David Weenink * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Loading Loading @@ -34,6 +34,8 @@ void CC_init (CC me, double tmin, double tmax, integer nt, double dt, double t1, void CC_getNumberOfCoefficients_extrema (CC me, integer startframe, integer endframe, integer *min, integer *max); integer CC_getMaximumNumberOfCoefficientsUsed (CC me); integer CC_getMinimumNumberOfCoefficients (CC me, integer startframe, integer endframe); integer CC_getMaximumNumberOfCoefficients (CC me, integer startframe, integer endframe); Loading
dwtools/CCs_to_DTW.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ autoDTW CCs_to_DTW (CC me, CC thee, double coefficientWeight, double logEnergyWe integer nr = Melder_ifloor (regressionWindowLength / my dx); Melder_require (my maximumNumberOfCoefficients == thy maximumNumberOfCoefficients, U"CC orders should be equal."); U"The maximum number of coefficients should be equal."); Melder_require (! (coefficientRegressionWeight != 0.0 && nr < 2), U"Time window for regression is too small."); Loading
dwtools/Sound_and_Spectrogram_extensions.cpp +7 −5 Original line number Diff line number Diff line /* Sound_and_Spectrogram_extensions.cpp * * Copyright (C) 1993-2018 David Weenink * Copyright (C) 1993-2019 David Weenink * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Loading Loading @@ -166,7 +166,7 @@ static void Sound_into_MelSpectrogram_frame (Sound me, MelSpectrogram thee, inte autoSpectrum him = Sound_to_Spectrum_power (me); for (integer ifilter = 1; ifilter <= thy ny; ifilter ++) { double power = 0; longdouble power = 0.0; double fc_mel = thy y1 + (ifilter - 1) * thy dy; double fc_hz = thy v_frequencyToHertz (fc_mel); double fl_hz = thy v_frequencyToHertz (fc_mel - thy dy); Loading @@ -180,7 +180,7 @@ static void Sound_into_MelSpectrogram_frame (Sound me, MelSpectrogram thee, inte double a = NUMtriangularfilter_amplitude (fl_hz, fc_hz, fh_hz, f); power += a * his z [1] [i]; } thy z [ifilter] [frame] = power; thy z [ifilter] [frame] = double (power); } } Loading @@ -195,8 +195,10 @@ autoMelSpectrogram Sound_to_MelSpectrogram (Sound me, double analysisWidth, doub if (fmax_mel <= 0.0 || fmax_mel > fceiling) fmax_mel = fceiling; if (fmax_mel <= f1_mel) f1_mel = fbottom; fmax_mel = fceiling; if (fmax_mel <= f1_mel) { f1_mel = fbottom; fmax_mel = fceiling; } if (f1_mel <= 0.0) f1_mel = fbottom; if (df_mel <= 0.0) Loading
dwtools/praat_David_init.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -4072,6 +4072,12 @@ DO NUMBER_ONE_END (U"") } DIRECT (NUMMAT_PatternList_getAllValues) { NUMMAT_ONE (PatternList) autoMAT result = newMATcopy (my z.all()); NUMMAT_ONE_END } FORM (MODIFY_PatternList_formula, U"PatternList: Formula", nullptr) { LABEL (U"# `col` is the node number, `row` is the pattern number") LABEL (U"for row from 1 to nrow ; for all patterns") Loading Loading @@ -8159,6 +8165,7 @@ void praat_uvafon_David_init () { praat_addAction1 (classPatternList, 0, MODIFY_BUTTON, nullptr, 0, 0); praat_addAction1 (classPatternList, 0, U"Formula...", nullptr, 1, MODIFY_PatternList_formula); praat_addAction1 (classPatternList, 0, U"Set value...", nullptr, 1, MODIFY_PatternList_setValue); praat_addAction1 (classPatternList, 0, U"Get all values", nullptr, 0, NUMMAT_PatternList_getAllValues); praat_addAction1 (classPatternList, 0, U"To Matrix", nullptr, 0, NEW_PatternList_to_Matrix); praat_addAction2 (classPatternList, 1, classCategories, 1, U"To TableOfReal", nullptr, 0, NEW1_Matrix_Categories_to_TableOfReal); Loading