From: Takenori Y. <tak...@us...> - 2017-04-06 09:46:52
|
Update of /cvsroot/sp-tk/SPTK4/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8050 Modified Files: Makefile mgc2mgc.cc mgc2sp.cc Log Message: rename class names Index: mgc2mgc.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/mgc2mgc.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mgc2mgc.cc 15 Mar 2017 13:38:04 -0000 1.5 --- mgc2mgc.cc 6 Apr 2017 09:46:50 -0000 1.6 *************** *** 49,53 **** #include <vector> ! #include "generalized_cepstrum_transform.h" #include "sptk_utils.h" --- 49,53 ---- #include <vector> ! #include "mel_generalized_cepstrum_transform.h" #include "sptk_utils.h" *************** *** 245,254 **** // prepare for gain normalization ! sptk::GeneralizedCepstrumTransform generalized_cepstrum_transform( input_num_order, input_alpha, input_gamma, input_normalization_flag, input_multiplication_flag, output_num_order, output_alpha, output_gamma, output_normalization_flag, output_multiplication_flag); ! sptk::GeneralizedCepstrumTransform::Buffer buffer; ! if (!generalized_cepstrum_transform.IsValid()) { std::ostringstream error_message; error_message << "Failed to set the condition"; --- 245,254 ---- // prepare for gain normalization ! sptk::MelGeneralizedCepstrumTransform mel_generalized_cepstrum_transform( input_num_order, input_alpha, input_gamma, input_normalization_flag, input_multiplication_flag, output_num_order, output_alpha, output_gamma, output_normalization_flag, output_multiplication_flag); ! sptk::MelGeneralizedCepstrumTransform::Buffer buffer; ! if (!mel_generalized_cepstrum_transform.IsValid()) { std::ostringstream error_message; error_message << "Failed to set the condition"; *************** *** 259,276 **** const int input_length(input_num_order + 1); const int output_length(output_num_order + 1); ! std::vector<double> generalized_cepstrum(input_length); ! std::vector<double> transformed_generalized_cepstrum(output_length); ! while (sptk::ReadStream(false, 0, 0, input_length, &generalized_cepstrum, &input_stream)) { // input modification: 1+g*mgc[0] -> mgc[0] if (!input_normalization_flag && input_multiplication_flag) ! (*generalized_cepstrum.begin()) = ! (*(generalized_cepstrum.begin()) - 1.0) / input_gamma; // transform ! if (!generalized_cepstrum_transform.Run( ! generalized_cepstrum, &transformed_generalized_cepstrum, &buffer)) { std::ostringstream error_message; ! error_message << "Failed to run generalized cepstral transformation"; sptk::PrintErrorMessage("mgc2mgc", error_message); return 1; --- 259,277 ---- const int input_length(input_num_order + 1); const int output_length(output_num_order + 1); ! std::vector<double> mel_generalized_cepstrum(input_length); ! std::vector<double> transformed_mel_generalized_cepstrum(output_length); ! while (sptk::ReadStream(false, 0, 0, input_length, &mel_generalized_cepstrum, &input_stream)) { // input modification: 1+g*mgc[0] -> mgc[0] if (!input_normalization_flag && input_multiplication_flag) ! (*mel_generalized_cepstrum.begin()) = ! (*(mel_generalized_cepstrum.begin()) - 1.0) / input_gamma; // transform ! if (!mel_generalized_cepstrum_transform.Run( ! mel_generalized_cepstrum, &transformed_mel_generalized_cepstrum, ! &buffer)) { std::ostringstream error_message; ! error_message << "Failed to run mel-generalized cepstral transformation"; sptk::PrintErrorMessage("mgc2mgc", error_message); return 1; *************** *** 278,288 **** // output modification: mgc[0] -> 1+g*mgc[0] if (!output_normalization_flag && output_multiplication_flag) ! (*transformed_generalized_cepstrum.begin()) = ! *(transformed_generalized_cepstrum.begin()) * output_gamma + 1.0; // write results ! if (!sptk::WriteStream(0, output_length, transformed_generalized_cepstrum, ! &std::cout)) { std::ostringstream error_message; ! error_message << "Failed to write generalized cepstrum"; sptk::PrintErrorMessage("mgc2mgc", error_message); return 1; --- 279,289 ---- // output modification: mgc[0] -> 1+g*mgc[0] if (!output_normalization_flag && output_multiplication_flag) ! (*transformed_mel_generalized_cepstrum.begin()) = ! *(transformed_mel_generalized_cepstrum.begin()) * output_gamma + 1.0; // write results ! if (!sptk::WriteStream(0, output_length, ! transformed_mel_generalized_cepstrum, &std::cout)) { std::ostringstream error_message; ! error_message << "Failed to write mel-generalized cepstrum"; sptk::PrintErrorMessage("mgc2mgc", error_message); return 1; Index: Makefile =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Makefile 3 Apr 2017 02:03:06 -0000 1.28 --- Makefile 6 Apr 2017 09:46:50 -0000 1.29 *************** *** 56,61 **** generalized_cepstrum_gain_normalization.cc \ generalized_cepstrum_inverse_gain_normalization.cc \ - generalized_cepstrum_to_spectrum.cc \ - generalized_cepstrum_transform.cc \ input_source_from_array.cc \ input_source_from_matrix.cc \ --- 56,59 ---- *************** *** 67,75 **** levinson_durbin_recursion.cc \ line_spectral_pairs_to_linear_predictive_coefficients.cc \ - line_spectral_pairs_to_spectrum.cc \ linear_predictive_coefficients_to_cepstrum.cc \ linear_predictive_coefficients_to_line_spectral_pairs.cc \ linear_predictive_coefficients_to_parcor_coefficients.cc \ m_sequence_generation.cc \ normal_distributed_random_value_generation.cc \ parcor_coefficients_to_linear_predictive_coefficients.cc \ --- 65,75 ---- levinson_durbin_recursion.cc \ line_spectral_pairs_to_linear_predictive_coefficients.cc \ linear_predictive_coefficients_to_cepstrum.cc \ linear_predictive_coefficients_to_line_spectral_pairs.cc \ linear_predictive_coefficients_to_parcor_coefficients.cc \ m_sequence_generation.cc \ + mel_generalized_cepstrum_to_spectrum.cc \ + mel_generalized_cepstrum_transform.cc \ + mel_generalized_line_spectral_pairs_to_spectrum.cc \ normal_distributed_random_value_generation.cc \ parcor_coefficients_to_linear_predictive_coefficients.cc \ Index: mgc2sp.cc =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/mgc2sp.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mgc2sp.cc 15 Mar 2017 13:38:04 -0000 1.3 --- mgc2sp.cc 6 Apr 2017 09:46:50 -0000 1.4 *************** *** 52,56 **** #include <vector> ! #include "generalized_cepstrum_to_spectrum.h" #include "sptk_utils.h" --- 52,56 ---- #include <vector> ! #include "mel_generalized_cepstrum_to_spectrum.h" #include "sptk_utils.h" *************** *** 230,238 **** // prepare for gain normalization ! sptk::GeneralizedCepstrumToSpectrum generalized_cepstrum_to_spectrum( num_order, alpha, gamma, normalization_flag, multiplication_flag, fft_size); ! sptk::GeneralizedCepstrumToSpectrum::Buffer buffer; ! if (!generalized_cepstrum_to_spectrum.IsValid()) { std::ostringstream error_message; error_message << "Failed to set condition for transformation"; --- 230,238 ---- // prepare for gain normalization ! sptk::MelGeneralizedCepstrumToSpectrum mel_generalized_cepstrum_to_spectrum( num_order, alpha, gamma, normalization_flag, multiplication_flag, fft_size); ! sptk::MelGeneralizedCepstrumToSpectrum::Buffer buffer; ! if (!mel_generalized_cepstrum_to_spectrum.IsValid()) { std::ostringstream error_message; error_message << "Failed to set condition for transformation"; *************** *** 243,260 **** const int input_length(num_order + 1); const int output_length(fft_size / 2 + 1); ! std::vector<double> generalized_cepstrum(input_length); std::vector<double> amplitude_spectrum(fft_size); std::vector<double> phase_spectrum(fft_size); ! while (sptk::ReadStream(false, 0, 0, input_length, &generalized_cepstrum, &input_stream)) { // input modification if (!normalization_flag && multiplication_flag) { ! (*generalized_cepstrum.begin()) = ! (*(generalized_cepstrum.begin()) - 1.0) / gamma; } // transform ! if (!generalized_cepstrum_to_spectrum.Run(generalized_cepstrum, &litude_spectrum, &phase_spectrum, &buffer)) { --- 243,260 ---- const int input_length(num_order + 1); const int output_length(fft_size / 2 + 1); ! std::vector<double> mel_generalized_cepstrum(input_length); std::vector<double> amplitude_spectrum(fft_size); std::vector<double> phase_spectrum(fft_size); ! while (sptk::ReadStream(false, 0, 0, input_length, &mel_generalized_cepstrum, &input_stream)) { // input modification if (!normalization_flag && multiplication_flag) { ! (*mel_generalized_cepstrum.begin()) = ! (*(mel_generalized_cepstrum.begin()) - 1.0) / gamma; } // transform ! if (!mel_generalized_cepstrum_to_spectrum.Run(mel_generalized_cepstrum, &litude_spectrum, &phase_spectrum, &buffer)) { |