Sound_to_MFCC.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Sound_to_MFCC.cpp
  2. *
  3. * Copyright (C) 1993-2017 David Weenink
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. djmw 20010410
  20. djmw 20020813 GPL header
  21. */
  22. #include "Sound_to_MFCC.h"
  23. #include "Sound_and_Spectrogram_extensions.h"
  24. autoMFCC Sound_to_MFCC (Sound me, integer numberOfCoefficients, double analysisWidth, double dt, double f1_mel, double fmax_mel, double df_mel) {
  25. try {
  26. autoMelSpectrogram mf = Sound_to_MelSpectrogram (me, analysisWidth, dt, f1_mel, fmax_mel, df_mel);
  27. autoMFCC mfcc = MelSpectrogram_to_MFCC (mf.get(), numberOfCoefficients);
  28. return mfcc;
  29. } catch (MelderError) {
  30. Melder_throw (me, U": no MFCC created.");
  31. }
  32. }
  33. /* End of file Sound_to_MFCC.cpp */