You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(125) |
Nov
(7) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(9) |
Jun
(150) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(15) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(183) |
2010 |
Jan
|
Feb
(1) |
Mar
(26) |
Apr
(23) |
May
(4) |
Jun
(8) |
Jul
(9) |
Aug
(19) |
Sep
(6) |
Oct
(27) |
Nov
(5) |
Dec
(135) |
2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
(22) |
May
(8) |
Jun
(8) |
Jul
(2) |
Aug
(12) |
Sep
(3) |
Oct
(13) |
Nov
(31) |
Dec
(40) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
(27) |
Jul
(6) |
Aug
(19) |
Sep
(14) |
Oct
(8) |
Nov
(10) |
Dec
(82) |
2013 |
Jan
(12) |
Feb
(14) |
Mar
(11) |
Apr
(4) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(11) |
Sep
(16) |
Oct
(2) |
Nov
(23) |
Dec
(86) |
2014 |
Jan
(1) |
Feb
(18) |
Mar
(5) |
Apr
(13) |
May
(2) |
Jun
(8) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(65) |
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
(41) |
2016 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(5) |
Aug
(8) |
Sep
(3) |
Oct
(26) |
Nov
(11) |
Dec
(45) |
2017 |
Jan
(12) |
Feb
(9) |
Mar
(4) |
Apr
(8) |
May
(20) |
Jun
(13) |
Jul
(18) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
From: Natsumi K. <koi...@us...> - 2017-10-06 03:43:17
|
Update of /cvsroot/sp-tk/SPTK/src/bin/csm2acr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29233 Modified Files: csm2acr.c _csm2acr.c Log Message: modify csm2acr command Index: _csm2acr.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/csm2acr/_csm2acr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _csm2acr.c 25 Jul 2017 10:40:24 -0000 1.1 --- _csm2acr.c 6 Oct 2017 03:43:14 -0000 1.2 *************** *** 53,57 **** double *csm : CSM parameters double *r : autocorrelation coefficients ! int m : order of autocorrelation ****************************************************************/ --- 53,57 ---- double *csm : CSM parameters double *r : autocorrelation coefficients ! int m : number of sine waves ****************************************************************/ *************** *** 72,83 **** double *frequencies, *intensities; ! n = (m + 1) / 2; frequencies = csm; ! intensities = csm + n; ! for (l = 0; l <= m; l++) { r[l] = 0.0; ! for (i = 0; i < n; i++) { r[l] += intensities[i] * cos(l * frequencies[i]); } --- 72,83 ---- double *frequencies, *intensities; ! n = 2 * m - 1; frequencies = csm; ! intensities = csm + m; ! for (l = 0; l <= n; l++) { r[l] = 0.0; ! for (i = 0; i < m; i++) { r[l] += intensities[i] * cos(l * frequencies[i]); } Index: csm2acr.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/csm2acr/csm2acr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** csm2acr.c 25 Jul 2017 10:40:24 -0000 1.1 --- csm2acr.c 6 Oct 2017 03:43:14 -0000 1.2 *************** *** 52,62 **** * csm2acr [ options ] [ infile ] > stdout * * options: * ! * -m M : order of autocorrelation [25] * * infile: * * Composite Sinusoidal Modeling * ! * , w(1), ..., w((M+1)/2), m(1), ..., m((M+1)/2), * * stdout: * * autocorrelation coefficeints * ! * , r(0), r(1), ..., r(M), * * require: * * csm2acr() * --- 52,62 ---- * csm2acr [ options ] [ infile ] > stdout * * options: * ! * -m M : number of sine waves [13] * * infile: * * Composite Sinusoidal Modeling * ! * , w(1), ..., w(M), m(1), ..., m(M), * * stdout: * * autocorrelation coefficeints * ! * , r(0), r(1), ..., r(2M-1), * * require: * * csm2acr() * *************** *** 86,90 **** /* Default Values */ ! #define ORDER 25 /* Command Name */ --- 86,90 ---- /* Default Values */ ! #define DEF_M 13 /* Command Name */ *************** *** 100,105 **** fprintf(stderr, " %s [ options ] [ infile ] > stdout\n", cmnd); fprintf(stderr, " options:\n"); ! fprintf(stderr, " -m m : order of autocorrelation [%d]\n", ! ORDER); fprintf(stderr, " -h : print this message\n"); fprintf(stderr, " infile:\n"); --- 100,105 ---- fprintf(stderr, " %s [ options ] [ infile ] > stdout\n", cmnd); fprintf(stderr, " options:\n"); ! fprintf(stderr, " -m m : number of sine waves [%d]\n", ! DEF_M); fprintf(stderr, " -h : print this message\n"); fprintf(stderr, " infile:\n"); *************** *** 119,123 **** int main(int argc, char **argv) { ! int m = ORDER; FILE *fp = stdin; double *csm, *r; --- 119,123 ---- int main(int argc, char **argv) { ! int m = DEF_M; FILE *fp = stdin; double *csm, *r; *************** *** 143,157 **** fp = getfp(*argv, "rb"); ! if (m % 2 == 0) { ! fprintf(stderr, "%s : Order of autocorrelation must be odd!\n", cmnd); ! return 1; ! } ! ! csm = dgetmem(m + 1 + m + 1); ! r = csm + m + 1; ! while (freadf(csm, sizeof(*csm), m + 1, fp) == m + 1) { csm2acr(csm, r, m); ! fwritef(r, sizeof(*r), m + 1, stdout); } --- 143,152 ---- fp = getfp(*argv, "rb"); ! csm = dgetmem(2 * m + 2 * m); ! r = csm + 2 * m; ! while (freadf(csm, sizeof(*csm), 2 * m, fp) == 2 * m) { csm2acr(csm, r, m); ! fwritef(r, sizeof(*r), 2 * m, stdout); } |
From: Natsumi K. <koi...@us...> - 2017-09-29 10:16:59
|
Update of /cvsroot/sp-tk/SPTK/doc/ref_e In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15760 Modified Files: Makefile.in main.tex levdur.tex Added Files: rlevdur.tex Log Message: add manual of rlevdur command and modify manual of levdur command Index: Makefile.in =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/Makefile.in,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Makefile.in 31 Jul 2017 06:09:47 -0000 1.37 --- Makefile.in 29 Sep 2017 10:16:57 -0000 1.38 *************** *** 151,154 **** --- 151,155 ---- ramp.tex \ reverse.tex \ + rlevdur.tex \ rmse.tex \ root_pol.tex \ Index: levdur.tex =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/levdur.tex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** levdur.tex 16 May 2017 10:58:48 -0000 1.25 --- levdur.tex 29 Sep 2017 10:16:57 -0000 1.26 *************** *** 43,57 **** % ----------------------------------------------------------------- % \hypertarget{levdur}{} ! \name{levdur}{solve an autocorrelation normal equation using Levinson-Durbin method}{signal processing} \begin{synopsis} ! \item [levdur] [ --m $M$ ] [ --f $F$ ] [ {\em infile} ] \end{synopsis} \begin{qsection}{DESCRIPTION} ! {\em levdur} calculates linear prediction coefficients (LPC) ! from the autocorrelation matrix from {\em infile} (or standard input), sending the result to standard output. --- 43,57 ---- % ----------------------------------------------------------------- % \hypertarget{levdur}{} ! \name{levdur}{solve an autocorrelation normal equation using Levinson-Durbin method}{signal processing} \begin{synopsis} ! \item [levdur] [ --m $M$ ] [ --f $F$ ] [ {\em infile} ] \end{synopsis} \begin{qsection}{DESCRIPTION} ! {\em levdur} calculates linear prediction coefficients (LPC) ! from the autocorrelation matrix from {\em infile} (or standard input), sending the result to standard output. *************** *** 60,64 **** r(0),r(1),\dots,r(M). \end{displaymath} ! {\em levdur} uses the Levinson-Durbin algorithm to solve a system of linear equations obtained from the autocorrelation matrix. --- 60,64 ---- r(0),r(1),\dots,r(M). \end{displaymath} ! {\em levdur} uses the Levinson-Durbin algorithm to solve a system of linear equations obtained from the autocorrelation matrix. *************** *** 69,73 **** $K, a(1), \dots, a(M)$ of an all-pole digital filter \begin{displaymath} ! H(z) = \frac{K}{\displaystyle{1+\sum_{i=1}^{M}a(k)z^{-i}}}. \end{displaymath} The linear prediction coefficients are evaluated by solving --- 69,73 ---- $K, a(1), \dots, a(M)$ of an all-pole digital filter \begin{displaymath} ! H(z) = \frac{K}{\displaystyle{1+\sum_{i=1}^{M}a(i)z^{-i}}}. \end{displaymath} The linear prediction coefficients are evaluated by solving *************** *** 87,91 **** a(M) \\ \end{pmatrix} ! = - \begin{pmatrix} r(1) \\ --- 87,91 ---- a(M) \\ \end{pmatrix} ! = - \begin{pmatrix} r(1) \\ *************** *** 103,107 **** {E^{(i-1)}} \label{eqn:lev_dur_k}\notag\\ a^{(i)}(i) &= k(i) \notag\\ ! a^{(i)}(j) &= a^{(i-1)}(j) + k(i) a^{(i-1)}(i-j), \qquad 1\leq j \leq i-1\\ E^{(i)} &= (1-k^2(i)) E^{(i-1)} \label{eqn:lev_dur_E} --- 103,107 ---- {E^{(i-1)}} \label{eqn:lev_dur_k}\notag\\ a^{(i)}(i) &= k(i) \notag\\ ! a^{(i)}(j) &= a^{(i-1)}(j) + k(i) a^{(i-1)}(i-j), \qquad 1\leq j \leq i-1\\ E^{(i)} &= (1-k^2(i)) E^{(i-1)} \label{eqn:lev_dur_E} *************** *** 126,134 **** \begin{quote} \verb!frame < data.f | window | acorr -m 25 | levdur > data.lpc! ! \end{quote} \end{qsection} \begin{qsection}{NOTICE} ! The default value for -f option is zero as a trial. In the previous version, the default value is 1.0E-6. \end{qsection} --- 126,134 ---- \begin{quote} \verb!frame < data.f | window | acorr -m 25 | levdur > data.lpc! ! \end{quote} \end{qsection} \begin{qsection}{NOTICE} ! The default value for -f option is zero as a trial. In the previous version, the default value is 1.0E-6. \end{qsection} *************** *** 136,139 **** \begin{qsection}{SEE ALSO} \hyperlink{acorr}{acorr}, ! \hyperlink{lpc}{lpc} \end{qsection} --- 136,140 ---- \begin{qsection}{SEE ALSO} \hyperlink{acorr}{acorr}, ! \hyperlink{lpc}{lpc}, ! \hyperlink{rlevdur}{rlevdur} \end{qsection} --- NEW FILE: rlevdur.tex --- % ----------------------------------------------------------------- % % The Speech Signal Processing Toolkit (SPTK) % % developed by SPTK Working Group % % http://sp-tk.sourceforge.net/ % % ----------------------------------------------------------------- % % % % Copyright (c) 1984-2007 Tokyo Institute of Technology % % Interdisciplinary Graduate School of % % Science and Engineering % % % % 1996-2017 Nagoya Institute of Technology % % Department of Computer Science % % % % All rights reserved. % % % % Redistribution and use in source and binary forms, with or % % without modification, are permitted provided that the following % % conditions are met: % % % % - Redistributions of source code must retain the above copyright % % notice, this list of conditions and the following disclaimer. % % - Redistributions in binary form must reproduce the above % % copyright notice, this list of conditions and the following % % disclaimer in the documentation and/or other materials provided % % with the distribution. % % - Neither the name of the SPTK working group nor the names of its % % contributors may be used to endorse or promote products derived % % from this software without specific prior written permission. % % % % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND % % CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, % % INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF % % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE % % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS % % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, % % EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED % % TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, % % DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON % % ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, % % OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY % % OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % % POSSIBILITY OF SUCH DAMAGE. % % ----------------------------------------------------------------- % \hypertarget{rlevdur}{} \name{rlevdur}{solve an autocorrelation normal equation using reverse Levinson-Durbin method}{signal processing} \begin{synopsis} \item [rlevdur] [ --m $M$ ] [ {\em infile} ] \end{synopsis} \begin{qsection}{DESCRIPTION} {\em rlevdur} calculates the autocorrelation matrix from the linear prediction coefficients (LPC) from {\em infile} (or standard input), sending the result to standard output. The input is the $M$-th order linear prediction coefficients which are the set of coefficients $K, a(1), \dots, a(M)$ of an all-pole digital filter \begin{displaymath} H(z) = \frac{K}{\displaystyle{1+\sum_{i=1}^{M}a(i)z^{-i}}}. \end{displaymath} {\em rlevdur} uses the reverse Levinson-Durbin algorithm to solve a system of linear equations obtained from linear prediction coefficients. Input and output data are in float format. The output is the $M$-th order autocorrelation matrix \begin{displaymath} r(0),r(1),\dots,r(M). \end{displaymath} The autocorrelation matrix are evaluated by solving the following set of linear equations, which were obtained through the autocorrelation method, \begin{displaymath} \begin{pmatrix} r(0) & r(1) & \dots & r(M-1) \\ r(1) & r(0) & & \vdots \\ \vdots & & \ddots & \\ r(M-1) & & \dots & r(0) \\ \end{pmatrix} \begin{pmatrix} a(1) \\ a(2) \\ \vdots \\ a(M) \\ \end{pmatrix} = - \begin{pmatrix} r(1) \\ r(2) \\ \vdots \\ r(M) \\ \end{pmatrix} \end{displaymath} The Durbin iterative and efficient algorithm is used to solve the system above. It takes advantage of the Toeplitz characteristic of the autocorrelation matrix. \end{qsection} \begin{options} \argm{m}{M}{order of correlation}{25} \end{options} \begin{qsection}{EXAMPLE} In this example, the linear prediction coefficients in float format are read from {\em data.lpc} and the CSM coefficients are written to {\em data.csm}: \begin{quote} \verb!lpc < data.lpc | rlevdur | acr2csm > data.csm! \end{quote} \end{qsection} \begin{qsection}{SEE ALSO} \hyperlink{lpc}{lpc}, \hyperlink{acr2csm}{acr2csm}, \hyperlink{levdur}{levdur} \end{qsection} Index: main.tex =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/main.tex,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** main.tex 31 Jul 2017 06:09:47 -0000 1.59 --- main.tex 29 Sep 2017 10:16:57 -0000 1.60 *************** *** 274,277 **** --- 274,278 ---- \include{raw2wav} \include{reverse} + \include{rlevdur} \include{rmse} \include{root_pol} |
From: fujishita t. <fjs...@us...> - 2017-08-28 09:18:38
|
Update of /cvsroot/sp-tk/SPTK/doc/ref_e In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30843 Modified Files: da.tex Log Message: modify reference of da command Index: da.tex =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/da.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** da.tex 10 May 2017 07:09:59 -0000 1.28 --- da.tex 28 Aug 2017 09:18:36 -0000 1.29 *************** *** 106,109 **** --- 106,114 ---- \verb! da +s -s 8 -o h data.s! \end{quote} + If you get the error that /dev/dsp is not exist, + please use padsp command as follows. + \begin{quote} + \verb! padsp da +s -s 8 -o h data.s! + \end{quote} \end{qsection} |
From: Natsumi K. <koi...@us...> - 2017-08-03 09:11:36
|
Update of /cvsroot/sp-tk/SPTK/src/include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13756 Modified Files: SPTK.h Log Message: add rlevdur command Index: SPTK.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/include/SPTK.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** SPTK.h 26 Jul 2017 06:24:14 -0000 1.69 --- SPTK.h 3 Aug 2017 09:11:34 -0000 1.70 *************** *** 350,353 **** --- 350,354 ---- double poledft(double x, double *a, int m, double *d); void reverse(double *x, const int l); + int rlevdur(double *a, double *r, const int m, double eps); double rmse(double *x, double *y, const int n); void output_root_pol(complex * x, int odr, int form); |
From: Natsumi K. <koi...@us...> - 2017-08-03 09:07:46
|
Update of /cvsroot/sp-tk/SPTK/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13190 Modified Files: configure.ac Log Message: add rlevdur command Index: configure.ac =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/configure.ac,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** configure.ac 26 Jul 2017 06:23:51 -0000 1.59 --- configure.ac 3 Aug 2017 09:07:43 -0000 1.60 *************** *** 255,258 **** --- 255,259 ---- bin/rawtowav/Makefile bin/reverse/Makefile + bin/rlevdur/Makefile bin/rmse/Makefile bin/root_pol/Makefile |
From: Natsumi K. <koi...@us...> - 2017-08-03 09:05:26
|
Update of /cvsroot/sp-tk/SPTK/src/bin In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12848 Modified Files: Makefile.am Log Message: add rlevdur command Index: Makefile.am =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/Makefile.am,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Makefile.am 26 Jul 2017 06:22:50 -0000 1.31 --- Makefile.am 3 Aug 2017 09:05:24 -0000 1.32 *************** *** 95,98 **** --- 95,99 ---- rawtowav \ reverse \ + rlevdur \ rmse \ root_pol \ |
From: Natsumi K. <koi...@us...> - 2017-08-03 09:03:03
|
Update of /cvsroot/sp-tk/SPTK/src/bin/rlevdur In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12513 Added Files: Makefile.am _rlevdur.c rlevdur.c .cvsignore Log Message: add rlevdur command --- NEW FILE: .cvsignore --- Makefile rlevdur Makefile.in .deps --- NEW FILE: rlevdur.c --- /* ----------------------------------------------------------------- */ /* The Speech Signal Processing Toolkit (SPTK) */ /* developed by SPTK Working Group */ /* http://sp-tk.sourceforge.net/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 1984-2007 Tokyo Institute of Technology */ /* Interdisciplinary Graduate School of */ /* Science and Engineering */ /* */ /* 1996-2017 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the SPTK working group nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /************************************************************************ * * * Solve an Autocorrelation Normal Equation * * Using Reverse Levinson-Durbin Method * * * * 2017.6 T.Yoshimura * * * * usage: * * rlevdur [ options ] [ infile ] > stdout * * options: * * -m m : order of correlation [25] * * infile: * * LP Coefficeints * * , K, a(1), ..., a(m), * * stdout: * * autocorrelation * * , r(0), r(1), ..., r(m), * * require: * * rlevdur() * * * ************************************************************************/ static char *rcs_id = "$Id: rlevdur.c,v 1.1 2017/08/03 09:03:00 koikenatsumi Exp $"; /* Standard C Libraries */ #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H #include <string.h> #else #include <strings.h> #ifndef HAVE_STRRCHR #define strrchr rindex #endif #endif #if defined(WIN32) #include "SPTK.h" #else #include <SPTK.h> #endif /* Default Values */ #define ORDER 25 #define MINDET 0.0 /* Command Name */ char *cmnd; void usage(int status) { fprintf(stderr, "\n"); fprintf(stderr, " %s - solve an autocorrelation normal equation\n", cmnd); fprintf(stderr, " using reverse Levinson-Durbin method\n"); fprintf(stderr, "\n"); fprintf(stderr, " usage:\n"); fprintf(stderr, " %s [ options ] [ infile ] > stdout\n", cmnd); fprintf(stderr, " options:\n"); fprintf(stderr, " -m m : order of correlation [%d]\n", ORDER); fprintf(stderr, " -h : print this message\n"); fprintf(stderr, " infile:\n"); fprintf(stderr, " LP coefficients (%s) [stdin]\n", FORMAT); fprintf(stderr, " stdout:\n"); fprintf(stderr, " autocorrelation (%s)\n", FORMAT); #ifdef PACKAGE_VERSION fprintf(stderr, "\n"); fprintf(stderr, " SPTK: version %s\n", PACKAGE_VERSION); fprintf(stderr, " CVS Info: %s", rcs_id); #endif fprintf(stderr, "\n"); exit(status); } int main(int argc, char **argv) { int m = ORDER; FILE *fp = stdin; double *a, *r, f = MINDET; if ((cmnd = strrchr(argv[0], '/')) == NULL) cmnd = argv[0]; else cmnd++; while (--argc) if (**++argv == '-') { switch (*(*argv + 1)) { case 'm': m = atoi(*++argv); --argc; break; case 'h': usage(0); default: fprintf(stderr, "%s : Invalid option '%c'!\n", cmnd, *(*argv + 1)); usage(1); } } else fp = getfp(*argv, "rb"); a = dgetmem(m + m + 2); r = a + m + 1; while (freadf(a, sizeof(*a), m + 1, fp) == m + 1) { rlevdur(a, r, m, f); fwritef(r, sizeof(*r), m + 1, stdout); } return (0); } --- NEW FILE: _rlevdur.c --- /* ----------------------------------------------------------------- */ /* The Speech Signal Processing Toolkit (SPTK) */ /* developed by SPTK Working Group */ /* http://sp-tk.sourceforge.net/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 1984-2007 Tokyo Institute of Technology */ /* Interdisciplinary Graduate School of */ /* Science and Engineering */ /* */ /* 1996-2017 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the SPTK working group nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /**************************************************************** $Id: _rlevdur.c,v 1.1 2017/08/03 09:03:00 koikenatsumi Exp $ Solve an Autocorrelation Normal Equation Using Reverse Levinson-Durbin Method int rlevdur(a, r, m, eps); double *a : LP coefficients double *r : autocorrelation sequence int m : order of LPC double eps : singular check return value : 0 -> normally completed -1 -> abnormally completed ******************************************************************/ #include <stdio.h> #include <stdlib.h> #include <math.h> #if defined(WIN32) #include "SPTK.h" #else #include <SPTK.h> #endif int rlevdur(double *a, double *r, const int m, double eps) { int i, j; double rmd, sum; static double **u = NULL, *e = NULL; static int size; if (u == NULL && e == NULL) { u = ddgetmem(m + 1, m + 1); e = dgetmem(m + 1); size = m; } if (m > size) { free(u); free(e); u = ddgetmem(m + 1, m + 1); e = dgetmem(m + 1); size = m; } for (j = 0; j <= m; j++) { u[j][j] = 1.0; } for (j = 0; j < m; j++) { u[m][j] = a[m - j]; } e[m] = a[0] * a[0]; for (i = m - 1; i > 0; i--) { rmd = (1.0 - u[i + 1][0] * u[i + 1][0]); if ((rmd < 0.0) ? -rmd : rmd <= eps) return (-1); for (j = 0; j < i; j++) { u[i][i - j - 1] = (u[i + 1][i - j] - u[i + 1][0] * u[i + 1][j + 1]) / rmd; } e[i] = e[i + 1] / rmd; } e[0] = e[1] / (1.0 - u[1][0] * u[1][0]); r[0] = e[0]; for (i = 1; i <= m; i++) { sum = 0.0; for (j = 1; j < i; j++) { sum -= u[i - 1][i - j - 1] * r[i - j]; } r[i] = sum - u[i][0] * e[i - 1]; } return (0); } --- NEW FILE: Makefile.am --- AM_CPPFLAGS = -I @top_srcdir@/include bin_PROGRAMS = rlevdur rlevdur_SOURCES = rlevdur.c _rlevdur.c rlevdur_LDADD = @top_builddir@/lib/libSPTK.a |
From: Natsumi K. <koi...@us...> - 2017-08-03 08:55:50
|
Update of /cvsroot/sp-tk/SPTK/src/bin/rlevdur In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11433/rlevdur Log Message: Directory /cvsroot/sp-tk/SPTK/src/bin/rlevdur added to the repository |
From: Natsumi K. <koi...@us...> - 2017-07-31 06:12:24
|
Update of /cvsroot/sp-tk/SPTK/doc/ref_e In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21248 Modified Files: lsp2lpc.tex Log Message: modify manual of lsp2lpc command Index: lsp2lpc.tex =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/lsp2lpc.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** lsp2lpc.tex 22 Dec 2016 10:52:58 -0000 1.23 --- lsp2lpc.tex 31 Jul 2017 06:12:21 -0000 1.24 *************** *** 55,59 **** sending the result to standard output. ! The LSP input input format is \begin{displaymath} [ K ], l(1), \dots , l(M), --- 55,59 ---- sending the result to standard output. ! The LSP input format is \begin{displaymath} [ K ], l(1), \dots , l(M), |
From: Natsumi K. <koi...@us...> - 2017-07-31 06:09:50
|
Update of /cvsroot/sp-tk/SPTK/doc/ref_e In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20741 Modified Files: Makefile.in main.tex Added Files: acr2csm.tex Log Message: add manual of acr2csm command Index: Makefile.in =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/Makefile.in,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Makefile.in 25 Jul 2017 10:47:26 -0000 1.36 --- Makefile.in 31 Jul 2017 06:09:47 -0000 1.37 *************** *** 55,58 **** --- 55,59 ---- acep.tex \ acorr.tex \ + acr2csm.tex \ agcep.tex \ amcep.tex \ --- NEW FILE: acr2csm.tex --- % ----------------------------------------------------------------- % % The Speech Signal Processing Toolkit (SPTK) % % developed by SPTK Working Group % % http://sp-tk.sourceforge.net/ % % ----------------------------------------------------------------- % % % % Copyright (c) 1984-2007 Tokyo Institute of Technology % % Interdisciplinary Graduate School of % % Science and Engineering % % % % 1996-2016 Nagoya Institute of Technology % % Department of Computer Science % % % % All rights reserved. % % % % Redistribution and use in source and binary forms, with or % % without modification, are permitted provided that the following % % conditions are met: % % % % - Redistributions of source code must retain the above copyright % % notice, this list of conditions and the following disclaimer. % % - Redistributions in binary form must reproduce the above % % copyright notice, this list of conditions and the following % % disclaimer in the documentation and/or other materials provided % % with the distribution. % % - Neither the name of the SPTK working group nor the names of its % % contributors may be used to endorse or promote products derived % % from this software without specific prior written permission. % % % % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND % % CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, % % INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF % % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE % % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS % % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, % % EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED % % TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, % % DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON % % ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, % % OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY % % OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % % POSSIBILITY OF SUCH DAMAGE. % % ----------------------------------------------------------------- % \hypertarget{acr2csm}{} \name{acr2csm}{transform autocorrelation to CSM}{speech parameter transformation} \begin{synopsis} \item [acr2csm] [ --m $M$ ] [ {\em infile} ] \end{synopsis} \begin{qsection}{DESCRIPTION} {\em acr2csm} calculates composite sinusoidal modeling (CSM) parameters from $M$-th order autocorrelation coefficients from {\em infile} (or standard input), sending the result to standard output. The input is the following autocorrelation coefficients, \begin{displaymath} r(0) , r(1), \dots , r(M). \end{displaymath} The CSM parameters $\omega(i)$ and $m(i)$ are obtained from autocorrelation function $r(k)$ based on the following equation: \begin{displaymath} r(k)=\sum_{i=1}^{\frac{M+1}{2}}m(i)\cos(k\cdot\omega(i)), \qquad k=0,1,\dots,M, \end{displaymath} And the CSM output format is \begin{displaymath} \omega(1), \dots , \omega\biggl(\frac{M+1}{2}\biggr), m(1), \dots , m\biggl(\frac{M+1}{2}\biggr). \end{displaymath} Both input and output files are in float format. \end{qsection} \begin{options} \argm{m}{M}{order of CSM}{25} \end{options} \begin{qsection}{EXAMPLE} In the example below, the 15-th order autocorrelation coefficients in float format are read from {\em data.acorr}, and then the CSM coefficients are written to {\em data.csm}: \begin{quote} \verb! acr2csm -m 15 data.acorr > data.csm! \end{quote} \end{qsection} \begin{qsection}{NOTICE} If $M > 30$, cannot compute reliable CSM due to computational accuracy. \end{qsection} \begin{qsection}{SEE ALSO} \hyperlink{acorr}{acorr}, \hyperlink{csm2acr}{csm2acr} \end{qsection} Index: main.tex =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/main.tex,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** main.tex 25 Jul 2017 10:47:26 -0000 1.58 --- main.tex 31 Jul 2017 06:09:47 -0000 1.59 *************** *** 45,50 **** \usepackage[dvipdfmx]{graphicx} \usepackage{fleqn} ! \usepackage{makeidx} ! \usepackage[square,sort,comma,numbers]{natbib} \usepackage{cmndref} \usepackage[dvipdfmx, --- 45,50 ---- \usepackage[dvipdfmx]{graphicx} \usepackage{fleqn} ! \usepackage{makeidx} ! \usepackage[square,sort,comma,numbers]{natbib} \usepackage{cmndref} \usepackage[dvipdfmx, *************** *** 56,66 **** pdftitle={SPTK-3.10 Reference Manual}] {hyperref} ! \usepackage{times} ! \usepackage{amsmath} ! \usepackage{txfonts} ! \usepackage{bm} \setlength{\textwidth}{6.5in} ! \setlength{\textheight}{9in} \setlength{\oddsidemargin}{0mm} \setlength{\evensidemargin}{-8mm} --- 56,66 ---- pdftitle={SPTK-3.10 Reference Manual}] {hyperref} ! \usepackage{times} ! \usepackage{amsmath} ! \usepackage{txfonts} ! \usepackage{bm} \setlength{\textwidth}{6.5in} ! \setlength{\textheight}{9in} \setlength{\oddsidemargin}{0mm} \setlength{\evensidemargin}{-8mm} *************** *** 71,75 **** \renewcommand{\textfraction}{0} \renewcommand{\dbltopfraction}{1} ! \makeindex --- 71,75 ---- \renewcommand{\textfraction}{0} \renewcommand{\dbltopfraction}{1} ! \makeindex *************** *** 91,95 **** parameter generation,% others% ! } \begin{document} --- 91,95 ---- parameter generation,% others% ! } \begin{document} *************** *** 97,101 **** \input{bmdefines} ! \begin{titlepage} \vspace*{\fill} \begin{center} --- 97,101 ---- \input{bmdefines} ! \begin{titlepage} \vspace*{\fill} \begin{center} *************** *** 114,118 **** The help message for every command can be obtained with the option ``-h''. ! The help message brings explanation of the command, how to use, as well as its options. --- 114,118 ---- The help message for every command can be obtained with the option ``-h''. ! The help message brings explanation of the command, how to use, as well as its options. *************** *** 121,127 **** \begin{verbatim} > % mcep -h ! > > mcep - mel cepstral analysis ! > > usage: > mcep [ options ] [ infile ] > stdout --- 121,127 ---- \begin{verbatim} > % mcep -h ! > > mcep - mel cepstral analysis ! > > usage: > mcep [ options ] [ infile ] > stdout *************** *** 169,173 **** %BEGIN COMMANDS \include{acep} ! \include{acorr} \include{agcep} \include{amcep} --- 169,174 ---- %BEGIN COMMANDS \include{acep} ! \include{acorr} ! \include{acr2csm} \include{agcep} \include{amcep} *************** *** 191,195 **** \include{delta} \include{df2} ! \include{dfs} \include{dmp} \include{dtw} --- 192,196 ---- \include{delta} \include{df2} ! \include{dfs} \include{dmp} \include{dtw} *************** *** 204,208 **** \include{fftcep} \include{fftr} ! \include{fftr2} \include{fig} \include{frame} --- 205,209 ---- \include{fftcep} \include{fftr} ! \include{fftr2} \include{fig} \include{frame} |
From: fujishita t. <fjs...@us...> - 2017-07-31 04:31:33
|
Update of /cvsroot/sp-tk/SPTK/src/bin/mfcc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5508 Modified Files: _mfcc.c Log Message: remove unused function Index: _mfcc.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/mfcc/_mfcc.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** _mfcc.c 26 Apr 2017 03:59:06 -0000 1.17 --- _mfcc.c 31 Jul 2017 04:31:31 -0000 1.18 *************** *** 106,119 **** } - void hamming(double *x, const int leng) - { - int k; - double arg; - - arg = M_2PI / (leng - 1); - for (k = 0; k < leng; k++) - x[k] *= (0.54 - 0.46 * cos(k * arg)); - } - void pre_emph(double *x, double *y, const double alpha, const int leng) { --- 106,109 ---- |
From: Natsumi K. <koi...@us...> - 2017-07-26 06:24:16
|
Update of /cvsroot/sp-tk/SPTK/src/include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6049 Modified Files: SPTK.h Log Message: add acr2csm command Index: SPTK.h =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/include/SPTK.h,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** SPTK.h 25 Jul 2017 10:43:14 -0000 1.68 --- SPTK.h 26 Jul 2017 06:24:14 -0000 1.69 *************** *** 44,49 **** /*********************************************************** ! $Id$ ! Speech Signal Processing Toolkit SPTK.h --- 44,49 ---- /*********************************************************** ! $Id$ ! Speech Signal Processing Toolkit SPTK.h *************** *** 189,192 **** --- 189,193 ---- const double eps); void acorr(double *x, int l, double *r, const int np); + int acr2csm(double *r, double *csm, const int m); double agcep(double x, double *c, const int m, const int stage, const double lambda, const double step, const double tau, |
From: Natsumi K. <koi...@us...> - 2017-07-26 06:23:53
|
Update of /cvsroot/sp-tk/SPTK/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5977 Modified Files: configure.ac Log Message: add acr2csm command Index: configure.ac =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/configure.ac,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** configure.ac 25 Jul 2017 10:43:14 -0000 1.58 --- configure.ac 26 Jul 2017 06:23:51 -0000 1.59 *************** *** 70,74 **** fi ! # Checks for double use_double=no IO_SYMBOL='f' --- 70,74 ---- fi ! # Checks for double use_double=no IO_SYMBOL='f' *************** *** 161,164 **** --- 161,165 ---- bin/acep/Makefile bin/acorr/Makefile + bin/acr2csm/Makefile bin/agcep/Makefile bin/amcep/Makefile *************** *** 269,273 **** bin/ulaw/Makefile bin/us/Makefile ! bin/vc/Makefile bin/vopr/Makefile bin/vq/Makefile --- 270,274 ---- bin/ulaw/Makefile bin/us/Makefile ! bin/vc/Makefile bin/vopr/Makefile bin/vq/Makefile |
From: Natsumi K. <koi...@us...> - 2017-07-26 06:22:52
|
Update of /cvsroot/sp-tk/SPTK/src/bin In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5800 Modified Files: Makefile.am Log Message: add acr2csm command Index: Makefile.am =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/Makefile.am,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Makefile.am 25 Jul 2017 10:43:14 -0000 1.30 --- Makefile.am 26 Jul 2017 06:22:50 -0000 1.31 *************** *** 1,4 **** --- 1,5 ---- SUBDIRS = acep \ acorr \ + acr2csm \ agcep \ amcep \ |
From: Natsumi K. <koi...@us...> - 2017-07-26 06:16:14
|
Update of /cvsroot/sp-tk/SPTK/src/bin/acr2csm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4892 Added Files: Makefile.am _acr2csm.c acr2csm.c .cvsignore Log Message: add acr2csm command --- NEW FILE: .cvsignore --- Makefile acr2csm Makefile.in .deps --- NEW FILE: acr2csm.c --- /* ----------------------------------------------------------------- */ /* The Speech Signal Processing Toolkit (SPTK) */ /* developed by SPTK Working Group */ /* http://sp-tk.sourceforge.net/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 1984-2007 Tokyo Institute of Technology */ /* Interdisciplinary Graduate School of */ /* Science and Engineering */ /* */ /* 1996-2017 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the SPTK working group nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /************************************************************************ * * * Transform Autocorrelation to CSM * * * * 2017.7 T.Yoshimura * * * * usage: * * acr2csm [ options ] [ infile ] > stdout * * options: * * -m M : order of autocorrelation [25] * * infile: * * autocorrelation coefficients * * , r(0), r(1), ..., r(M), * * stdout: * * composite sinusoidal modeling * * , w(1), ..., w((M+1)/2), m(1), ..., m((M+1)/2), * * require: * * acr2csm() * * * ************************************************************************/ static char *rcs_id = "$Id: acr2csm.c,v 1.1 2017/07/26 06:16:12 koikenatsumi Exp $"; /* Standard C Libraries */ #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H #include <string.h> #else #include <strings.h> #ifndef HAVE_STRRCHR #define strrchr rindex #endif #endif #if defined(WIN32) #include "SPTK.h" #else #include <SPTK.h> #endif /* Default Values */ #define ORDER 25 /* Command Name */ char *cmnd; void usage(int status) { fprintf(stderr, "\n"); fprintf(stderr, " %s - transform autocorrelation to CSM\n", cmnd); fprintf(stderr, "\n"); fprintf(stderr, " usage:\n"); fprintf(stderr, " %s [ options ] [ infile ] > stdout\n", cmnd); fprintf(stderr, " options:\n"); fprintf(stderr, " -m m : order of autocorrelation [%d]\n", ORDER); fprintf(stderr, " -h : print this message\n"); fprintf(stderr, " infile:\n"); fprintf(stderr, " autocorrelation (%s) [stdin]\n", FORMAT); fprintf(stderr, " stdout:\n"); fprintf(stderr, " CSM (%s)\n", FORMAT); fprintf(stderr, " notice:\n"); fprintf(stderr, " if m>30, cannot compute reliable CSM\n"); fprintf(stderr, " due to computational accuracy.\n"); #ifdef PACKAGE_VERSION fprintf(stderr, "\n"); fprintf(stderr, " SPTK: version %s\n", PACKAGE_VERSION); fprintf(stderr, " CVS Info: %s", rcs_id); #endif fprintf(stderr, "\n"); exit(status); } int main(int argc, char **argv) { int m = ORDER; FILE *fp = stdin; double *r, *csm; if ((cmnd = strrchr(argv[0], '/')) == NULL) cmnd = argv[0]; else cmnd++; while (--argc) if (**++argv == '-') { switch (*(*argv + 1)) { case 'm': m = atoi(*++argv); --argc; break; case 'h': usage(0); default: fprintf(stderr, "%s : Invalid option '%c'!\n", cmnd, *(*argv + 1)); usage(1); } } else fp = getfp(*argv, "rb"); if (m % 2 == 0) { fprintf(stderr, "%s : Order of autocorrelation must be odd!\n", cmnd); return 1; } r = dgetmem(m + 1 + m + 1); csm = r + m + 1; while (freadf(r, sizeof(*r), m + 1, fp) == m + 1) { acr2csm(r, csm, m); fwritef(csm, sizeof(*csm), m + 1, stdout); } return 0; } --- NEW FILE: _acr2csm.c --- /* ----------------------------------------------------------------- */ /* The Speech Signal Processing Toolkit (SPTK) */ /* developed by SPTK Working Group */ /* http://sp-tk.sourceforge.net/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 1984-2007 Tokyo Institute of Technology */ /* Interdisciplinary Graduate School of */ /* Science and Engineering */ /* */ /* 1996-2017 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the SPTK working group nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /*************************************************************** $Id: _acr2csm.c,v 1.1 2017/07/26 06:16:12 koikenatsumi Exp $ Transformation Autocorrelation to CSM void acr2csm(r, csm, m) double *r : Autocorrelation coefficients double *csm : CSM parameters int m : order of autocorrelation ****************************************************************/ #include <stdio.h> #include <stdlib.h> #include <math.h> #if defined(WIN32) #include "SPTK.h" #else #include <SPTK.h> #endif void quicksort(double *x, int left, int right) { int i, j; double pivot; double tmp; i = left; j = right; pivot = x[(left + right) / 2]; while (1) { while (x[i] > pivot) i++; while (pivot > x[j]) j--; if (i >= j) break; tmp = x[i]; x[i] = x[j]; x[j] = tmp; i++; j--; } if (left < i - 1) quicksort(x, left, i - 1); if (j + 1 < right) quicksort(x, j + 1, right); } int vander(double *c, double *a, double *b, const int n, double eps) { int i, j; double e, numer, denom; static double *d = NULL; static int size; if (d == NULL) { d = dgetmem(n); size = n; } if (n > size) { free(d); d = dgetmem(n); size = n; } if (eps < 0.0) eps = 1.0e-6; fillz(d, sizeof(*d), n); for (j = 0; j < n; j++) { for (i = n - j - 1; i < n - 1; i++) { d[i] += -c[j] * d[i + 1]; } d[n - 1] += -c[j]; } for (j = 0; j < n; j++) { e = 1.0; numer = b[n - 1]; denom = 1.0; for (i = n - 2; i >= 0; i--) { e = d[i + 1] + c[j] * e; numer = numer + b[i] * e; denom = denom * c[j] + e; } if (fabs(denom) <= eps) return -1; a[j] = numer / denom; } return 0; } unsigned long long nck(int n, int k) { int i; unsigned long long p = 1; if (2 * k > n) k = n - k; for (i = 1; i <= k; i++) { p *= n--; p /= i; } return p; } int acr2csm(double *r, double *csm, const int m) { int i, k, l, n = (m + 1) / 2; double sum, tmp; static complex *z = NULL; static double *u = NULL, *h, *p, *x, *q; static int size; if (u == NULL || x == NULL) { u = dgetmem(m + 1 + n * n + n + 1 + n + n); h = u + m + 1; p = h + n * n; x = p + n + 1; q = x + n; z = cplx_getmem(n + 1); size = m; } if (m > size) { free(u); free(z); u = dgetmem(m + 1 + n * n + n + 1 + n + n); h = u + m + 1; p = h + n * n; x = p + n + 1; q = x + n; z = cplx_getmem(n + 1); size = m; } for (l = 0; l <= m; l++) { sum = 0.0; for (k = 0; k <= l; k++) { sum += nck(l, k) * r[abs(2 * k - l)]; } u[l] = sum / pow(2.0, l); } for (i = 0; i < n * n; i++) h[i] = u[i % n + i / n]; /* solve a Hankel system */ if (cholesky(h, p, &(u[n]), n, 1.0e-6) == -1) return -1; for (i = 0; i < n; i++) { p[i] *= -1.0; } p[n] = 1.0; for (i = 0; i < (n + 1) / 2; i++) { tmp = p[i]; p[i] = p[n - i]; p[n - i] = tmp; } /* solve roots of a polynomial equation */ root_pol(p, n, z, 1, 1e-12, 1000); for (i = 1; i <= n; i++) x[i - 1] = z[i].re; quicksort(x, 0, n - 1); /* save CSM frequencies */ for (i = 0; i < n; i++) { if (fabs(x[i]) > 1.0) return -1; csm[i] = acos(x[i]); } /* solve a Van der Monde system */ if (vander(x, q, &(u[0]), n, 0.0) == -1) return -1; /* save CSM intensities */ for (i = 0; i < n; i++) csm[i + n] = q[i]; return 0; } --- NEW FILE: Makefile.am --- AM_CPPFLAGS = -I @top_srcdir@/include bin_PROGRAMS = acr2csm acr2csm_SOURCES = acr2csm.c _acr2csm.c acr2csm_LDADD = @top_builddir@/lib/libSPTK.a |
From: Natsumi K. <koi...@us...> - 2017-07-26 06:09:33
|
Update of /cvsroot/sp-tk/SPTK/src/bin/acr2csm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3873/acr2csm Log Message: Directory /cvsroot/sp-tk/SPTK/src/bin/acr2csm added to the repository |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:49:16
|
Update of /cvsroot/sp-tk/SPTK/doc/ref_e In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1018 Removed Files: csm2lpc.tex Log Message: remove manual of csm2lpc command --- csm2lpc.tex DELETED --- |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:47:28
|
Update of /cvsroot/sp-tk/SPTK/doc/ref_e In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv916 Modified Files: main.tex Makefile.in Added Files: csm2acr.tex Log Message: add manual of csm2acr command Index: Makefile.in =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/Makefile.in,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Makefile.in 23 Jun 2017 05:44:34 -0000 1.35 --- Makefile.in 25 Jul 2017 10:47:26 -0000 1.36 *************** *** 68,72 **** cdist.tex \ clip.tex \ ! csm2lpc.tex \ da.tex \ dct.tex \ --- 68,72 ---- cdist.tex \ clip.tex \ ! csm2acr.tex \ da.tex \ dct.tex \ --- NEW FILE: csm2acr.tex --- % ----------------------------------------------------------------- % % The Speech Signal Processing Toolkit (SPTK) % % developed by SPTK Working Group % % http://sp-tk.sourceforge.net/ % % ----------------------------------------------------------------- % % % % Copyright (c) 1984-2007 Tokyo Institute of Technology % % Interdisciplinary Graduate School of % % Science and Engineering % % % % 1996-2016 Nagoya Institute of Technology % % Department of Computer Science % % % % All rights reserved. % % % % Redistribution and use in source and binary forms, with or % % without modification, are permitted provided that the following % % conditions are met: % % % % - Redistributions of source code must retain the above copyright % % notice, this list of conditions and the following disclaimer. % % - Redistributions in binary form must reproduce the above % % copyright notice, this list of conditions and the following % % disclaimer in the documentation and/or other materials provided % % with the distribution. % % - Neither the name of the SPTK working group nor the names of its % % contributors may be used to endorse or promote products derived % % from this software without specific prior written permission. % % % % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND % % CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, % % INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF % % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE % % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS % % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, % % EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED % % TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, % % DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON % % ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, % % OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY % % OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % % POSSIBILITY OF SUCH DAMAGE. % % ----------------------------------------------------------------- % \hypertarget{csm2acr}{} \name{csm2acr}{transform CSM to autocorrelation}{speech parameter transformation} \begin{synopsis} \item [csm2acr] [ --m $M$ ] [ {\em infile} ] \end{synopsis} \begin{qsection}{DESCRIPTION} {\em csm2acr} calculates autocorrelation coefficients from $M$-th order composite sinusoidal modeling (CSM) parameters from {\em infile} (or standard input), sending the result to standard output. The CSM input format is \begin{displaymath} \omega(1), \dots , \omega\biggl(\frac{M+1}{2}\biggr), m(1), \dots , m\biggl(\frac{M+1}{2}\biggr). \end{displaymath} The autocorrelation function $r(k)$ is obtained from the CSM parameters: \begin{displaymath} r(k)=\sum_{i=1}^{\frac{M+1}{2}}m(i)\cos(k\cdot\omega(i)), \qquad k=0,1,\dots,M, \end{displaymath} And the output is the following autocorrelation coefficients, \begin{displaymath} r(0) , r(1), \dots , r(M). \end{displaymath} Both input and output files are in float format. \end{qsection} \begin{options} \argm{m}{M}{order of autocorrelation}{25} \end{options} \begin{qsection}{EXAMPLE} In the example below, 15-th order CSM coefficients in float format are read from {\em data.csm}, and then the autocorrelation coefficients are written to {\em data.acorr}: \begin{quote} \verb! csm2acr -m 15 data.csm > data.acorr! \end{quote} \end{qsection} \begin{qsection}{SEE ALSO} \hyperlink{acorr}{acorr}, \hyperlink{acr2csm}{acr2csm} \end{qsection} Index: main.tex =================================================================== RCS file: /cvsroot/sp-tk/SPTK/doc/ref_e/main.tex,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** main.tex 23 Jun 2017 05:44:34 -0000 1.57 --- main.tex 25 Jul 2017 10:47:26 -0000 1.58 *************** *** 183,187 **** \include{cdist} \include{clip} ! \include{csm2lpc} \include{da} %\include{dawrite} --- 183,187 ---- \include{cdist} \include{clip} ! \include{csm2acr} \include{da} %\include{dawrite} |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:43:17
|
Update of /cvsroot/sp-tk/SPTK/src/bin In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv690/bin Modified Files: Makefile.am Log Message: add csm2acr command Index: Makefile.am =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/Makefile.am,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Makefile.am 19 Jun 2017 02:06:05 -0000 1.29 --- Makefile.am 25 Jul 2017 10:43:14 -0000 1.30 *************** *** 14,18 **** cdist \ clip \ ! csm2lpc \ da \ dct \ --- 14,18 ---- cdist \ clip \ ! csm2acr \ da \ dct \ |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:43:16
|
Update of /cvsroot/sp-tk/SPTK/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv690 Modified Files: configure.ac Log Message: add csm2acr command Index: configure.ac =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/configure.ac,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** configure.ac 19 Jun 2017 02:06:04 -0000 1.57 --- configure.ac 25 Jul 2017 10:43:14 -0000 1.58 *************** *** 174,178 **** bin/cdist/Makefile bin/clip/Makefile ! bin/csm2lpc/Makefile bin/da/Makefile bin/dct/Makefile --- 174,178 ---- bin/cdist/Makefile bin/clip/Makefile ! bin/csm2acr/Makefile bin/da/Makefile bin/dct/Makefile |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:40:27
|
Update of /cvsroot/sp-tk/SPTK/src/bin/csm2acr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv527 Added Files: csm2acr.c _csm2acr.c .cvsignore Makefile.am Log Message: add csm2acr command --- NEW FILE: .cvsignore --- Makefile csm2acr Makefile.in .deps --- NEW FILE: _csm2acr.c --- /* ----------------------------------------------------------------- */ /* The Speech Signal Processing Toolkit (SPTK) */ /* developed by SPTK Working Group */ /* http://sp-tk.sourceforge.net/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 1984-2007 Tokyo Institute of Technology */ /* Interdisciplinary Graduate School of */ /* Science and Engineering */ /* */ /* 1996-2017 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the SPTK working group nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /*************************************************************** $Id: _csm2acr.c,v 1.1 2017/07/25 10:40:24 fjst15124 Exp $ Transformation CSM to autocorrelation void csm2acr(csm, r, m) double *csm : CSM parameters double *r : autocorrelation coefficients int m : order of autocorrelation ****************************************************************/ #include <stdio.h> #include <stdlib.h> #include <math.h> #if defined(WIN32) #include "SPTK.h" #else #include <SPTK.h> #endif void csm2acr(double *csm, double *r, const int m) { int i, l, n; double *frequencies, *intensities; n = (m + 1) / 2; frequencies = csm; intensities = csm + n; for (l = 0; l <= m; l++) { r[l] = 0.0; for (i = 0; i < n; i++) { r[l] += intensities[i] * cos(l * frequencies[i]); } } return; } --- NEW FILE: Makefile.am --- AM_CPPFLAGS = -I @top_srcdir@/include bin_PROGRAMS = csm2acr csm2acr_SOURCES = csm2acr.c _csm2acr.c csm2acr_LDADD = @top_builddir@/lib/libSPTK.a --- NEW FILE: csm2acr.c --- /* ----------------------------------------------------------------- */ /* The Speech Signal Processing Toolkit (SPTK) */ /* developed by SPTK Working Group */ /* http://sp-tk.sourceforge.net/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 1984-2007 Tokyo Institute of Technology */ /* Interdisciplinary Graduate School of */ /* Science and Engineering */ /* */ /* 1996-2017 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the SPTK working group nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /************************************************************************ * * * Transform CSM to Autocorrelation * * * * 2013.12 T.Aritake * * * * usage: * * csm2acr [ options ] [ infile ] > stdout * * options: * * -m M : order of autocorrelation [25] * * infile: * * Composite Sinusoidal Modeling * * , w(1), ..., w((M+1)/2), m(1), ..., m((M+1)/2), * * stdout: * * autocorrelation coefficeints * * , r(0), r(1), ..., r(M), * * require: * * csm2acr() * * * ************************************************************************/ static char *rcs_id = "$Id: csm2acr.c,v 1.1 2017/07/25 10:40:24 fjst15124 Exp $"; /* Standard C Libraries */ #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H #include <string.h> #else #include <strings.h> #ifndef HAVE_STRRCHR #define strrchr rindex #endif #endif #if defined(WIN32) #include "SPTK.h" #else #include <SPTK.h> #endif /* Default Values */ #define ORDER 25 /* Command Name */ char *cmnd; void usage(int status) { fprintf(stderr, "\n"); fprintf(stderr, " %s - transform CSM to autocorrelation\n", cmnd); fprintf(stderr, "\n"); fprintf(stderr, " usage:\n"); fprintf(stderr, " %s [ options ] [ infile ] > stdout\n", cmnd); fprintf(stderr, " options:\n"); fprintf(stderr, " -m m : order of autocorrelation [%d]\n", ORDER); fprintf(stderr, " -h : print this message\n"); fprintf(stderr, " infile:\n"); fprintf(stderr, " CSM (%s) [stdin]\n", FORMAT); fprintf(stderr, " stdout:\n"); fprintf(stderr, " autocorrelation (%s)\n", FORMAT); #ifdef PACKAGE_VERSION fprintf(stderr, "\n"); fprintf(stderr, " SPTK: version %s\n", PACKAGE_VERSION); fprintf(stderr, " CVS Info: %s", rcs_id); #endif fprintf(stderr, "\n"); exit(status); } int main(int argc, char **argv) { int m = ORDER; FILE *fp = stdin; double *csm, *r; if ((cmnd = strrchr(argv[0], '/')) == NULL) cmnd = argv[0]; else cmnd++; while (--argc) if (**++argv == '-') { switch (*(*argv + 1)) { case 'm': m = atoi(*++argv); --argc; break; case 'h': usage(0); default: fprintf(stderr, "%s : Invalid option '%c'!\n", cmnd, *(*argv + 1)); usage(1); } } else fp = getfp(*argv, "rb"); if (m % 2 == 0) { fprintf(stderr, "%s : Order of autocorrelation must be odd!\n", cmnd); return 1; } csm = dgetmem(m + 1 + m + 1); r = csm + m + 1; while (freadf(csm, sizeof(*csm), m + 1, fp) == m + 1) { csm2acr(csm, r, m); fwritef(r, sizeof(*r), m + 1, stdout); } return 0; } |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:36:21
|
Update of /cvsroot/sp-tk/SPTK/src/bin/csm2acr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv339/csm2acr Log Message: Directory /cvsroot/sp-tk/SPTK/src/bin/csm2acr added to the repository |
From: fujishita t. <fjs...@us...> - 2017-07-25 10:35:25
|
Update of /cvsroot/sp-tk/SPTK/src/bin/csm2lpc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32750 Removed Files: Makefile.am _csm2lpc.c csm2lpc.c Log Message: remove csm2lpc command --- _csm2lpc.c DELETED --- --- Makefile.am DELETED --- --- csm2lpc.c DELETED --- |
From: Natsumi K. <koi...@us...> - 2017-07-16 07:28:20
|
Update of /cvsroot/sp-tk/SPTK4/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv333 Modified Files: Makefile Added Files: filter_coefficient_normalization.h filter_coefficient_normalization.cc norm0.cc Log Message: add norm0 command Index: Makefile =================================================================== RCS file: /cvsroot/sp-tk/SPTK4/src/Makefile,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Makefile 16 Jun 2017 08:04:49 -0000 1.36 --- Makefile 16 Jul 2017 07:28:18 -0000 1.37 *************** *** 55,58 **** --- 55,59 ---- fast_fourier_transform.cc \ fast_fourier_transform_for_real_sequence.cc \ + filter_coefficient_normalization.cc \ frequency_transform.cc \ generalized_cepstrum_gain_normalization.cc \ --- NEW FILE: filter_coefficient_normalization.cc --- // ----------------------------------------------------------------- // // The Speech Signal Processing Toolkit (SPTK) // // developed by SPTK Working Group // // http://sp-tk.sourceforge.net/ // // ----------------------------------------------------------------- // // // // Copyright (c) 1984-2007 Tokyo Institute of Technology // // Interdisciplinary Graduate School of // // Science and Engineering // // // // 1996-2017 Nagoya Institute of Technology // // Department of Computer Science // // // // All rights reserved. // // // // Redistribution and use in source and binary forms, with or // // without modification, are permitted provided that the following // // conditions are met: // // // // - Redistributions of source code must retain the above copyright // // notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above // // copyright notice, this list of conditions and the following // // disclaimer in the documentation and/or other materials provided // // with the distribution. // // - Neither the name of the SPTK working group nor the names of its // // contributors may be used to endorse or promote products derived // // from this software without specific prior written permission. // // // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND // // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, // // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS // // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // // POSSIBILITY OF SUCH DAMAGE. // // ----------------------------------------------------------------- // #include "filter_coefficient_normalization.h" #include <algorithm> // std::transform #include <functional> // std::bind1st, std::multiplies namespace sptk { FilterCoefficientNormalization::FilterCoefficientNormalization(int num_order) : num_order_(num_order), is_valid_(true) { if (num_order_ < 0) { is_valid_ = false; } } bool FilterCoefficientNormalization::Run( const std::vector<double>& filter_coefficients, std::vector<double>* normalized_filter_coefficients) const { // check inputs if (!is_valid_ || filter_coefficients.size() != static_cast<std::size_t>(num_order_ + 1) || 0.0 == filter_coefficients[0] || NULL == normalized_filter_coefficients) { return false; } // prepare memory if (normalized_filter_coefficients->size() < static_cast<std::size_t>(num_order_ + 1)) { normalized_filter_coefficients->resize(num_order_ + 1); } // normarize (*normalized_filter_coefficients)[0] = 1.0 / filter_coefficients[0]; std::transform(filter_coefficients.begin() + 1, filter_coefficients.end(), normalized_filter_coefficients->begin() + 1, std::bind1st(std::multiplies<double>(), (*normalized_filter_coefficients)[0])); return true; } } // namespace sptk --- NEW FILE: norm0.cc --- // ----------------------------------------------------------------- // // The Speech Signal Processing Toolkit (SPTK) // // developed by SPTK Working Group // // http://sp-tk.sourceforge.net/ // // ----------------------------------------------------------------- // // // // Copyright (c) 1984-2007 Tokyo Institute of Technology // // Interdisciplinary Graduate School of // // Science and Engineering // // // // 1996-2017 Nagoya Institute of Technology // // Department of Computer Science // // // // All rights reserved. // // // // Redistribution and use in source and binary forms, with or // // without modification, are permitted provided that the following // // conditions are met: // // // // - Redistributions of source code must retain the above copyright // // notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above // // copyright notice, this list of conditions and the following // // disclaimer in the documentation and/or other materials provided // // with the distribution. // // - Neither the name of the SPTK working group nor the names of its // // contributors may be used to endorse or promote products derived // // from this software without specific prior written permission. // // // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND // // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, // // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS // // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // // POSSIBILITY OF SUCH DAMAGE. // // ----------------------------------------------------------------- // #include <getopt.h> #include <fstream> #include <iomanip> #include <iostream> #include <sstream> #include <vector> #include "filter_coefficient_normalization.h" #include "sptk_utils.h" namespace { const int kDefaultNumOrder(25); void PrintUsage(std::ostream* stream) { // clang-format off *stream << std::endl; *stream << " norm0 - normalize coefficients" << std::endl; // NOLINT *stream << std::endl; *stream << " usage:" << std::endl; *stream << " norm0 [ options ] [ infile ] > stdout" << std::endl; *stream << " options:" << std::endl; *stream << " -m m : order ( int)[" << std::setw(5) << std::right << kDefaultNumOrder << "][ 0 <= m <= ]" << std::endl; // NOLINT *stream << " -h : print this message" << std::endl; *stream << " infile:" << std::endl; *stream << " coefficients (double)[stdin]" << std::endl; // NOLINT *stream << " stdout:" << std::endl; *stream << " normalized coefficients (double)" << std::endl; *stream << std::endl; *stream << " SPTK: version " << sptk::kVersion << std::endl; *stream << std::endl; // clang-format on } } // namespace int main(int argc, char* argv[]) { int num_order(kDefaultNumOrder); for (;;) { const int option_char(getopt_long(argc, argv, "m:h", NULL, NULL)); if (-1 == option_char) break; switch (option_char) { case 'm': { if (!sptk::ConvertStringToInteger(optarg, &num_order) || num_order < 0) { std::ostringstream error_message; error_message << "The argument for the -m option must be a " << "non-negative integer"; sptk::PrintErrorMessage("norm0", error_message); return 1; } break; } case 'h': { PrintUsage(&std::cout); return 0; } default: { PrintUsage(&std::cerr); return 1; } } } // get input file const char* input_file((optind < argc) ? argv[argc - 1] : NULL); // open stream std::ifstream ifs; ifs.open(input_file, std::ios::in | std::ios::binary); if (ifs.fail() && NULL != input_file) { std::ostringstream error_message; error_message << "Cannot open file " << input_file; sptk::PrintErrorMessage("norm0", error_message); return 1; } std::istream& input_stream(ifs.fail() ? std::cin : ifs); // prepare for normalization sptk::FilterCoefficientNormalization filter_coefficient_normalization( num_order); if (!filter_coefficient_normalization.IsValid()) { std::ostringstream error_message; error_message << "Failed to set the condition"; sptk::PrintErrorMessage("norm0", error_message); return 1; } const int length(num_order + 1); std::vector<double> filter_coefficients(length); std::vector<double> normalized_filter_coefficients(length); while (sptk::ReadStream(false, 0, 0, length, &filter_coefficients, &input_stream)) { if (!filter_coefficient_normalization.Run( filter_coefficients, &normalized_filter_coefficients)) { std::ostringstream error_message; error_message << "Failed to normalize filter coefficients"; sptk::PrintErrorMessage("norm0", error_message); return 1; } if (!sptk::WriteStream(0, length, normalized_filter_coefficients, &std::cout)) { std::ostringstream error_message; error_message << "Failed to write normalized filter coefficients"; sptk::PrintErrorMessage("norm0", error_message); return 1; } } return 0; } --- NEW FILE: filter_coefficient_normalization.h --- // ----------------------------------------------------------------- // // The Speech Signal Processing Toolkit (SPTK) // // developed by SPTK Working Group // // http://sp-tk.sourceforge.net/ // // ----------------------------------------------------------------- // // // // Copyright (c) 1984-2007 Tokyo Institute of Technology // // Interdisciplinary Graduate School of // // Science and Engineering // // // // 1996-2017 Nagoya Institute of Technology // // Department of Computer Science // // // // All rights reserved. // // // // Redistribution and use in source and binary forms, with or // // without modification, are permitted provided that the following // // conditions are met: // // // // - Redistributions of source code must retain the above copyright // // notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above // // copyright notice, this list of conditions and the following // // disclaimer in the documentation and/or other materials provided // // with the distribution. // // - Neither the name of the SPTK working group nor the names of its // // contributors may be used to endorse or promote products derived // // from this software without specific prior written permission. // // // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND // // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, // // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS // // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // // POSSIBILITY OF SUCH DAMAGE. // // ----------------------------------------------------------------- // #ifndef SPTK_SRC_FILTER_COEFFICIENT_NORMALIZATION_H_ #define SPTK_SRC_FILTER_COEFFICIENT_NORMALIZATION_H_ #include <vector> // std::vector #include "sptk_utils.h" namespace sptk { class FilterCoefficientNormalization { public: // explicit FilterCoefficientNormalization(int num_order); // virtual ~FilterCoefficientNormalization() { } // int GetNumOrder() const { return num_order_; } // bool IsValid() const { return is_valid_; } // bool Run(const std::vector<double>& filter_coefficients, std::vector<double>* normalized_filter_coefficients) const; private: // const int num_order_; // bool is_valid_; // DISALLOW_COPY_AND_ASSIGN(FilterCoefficientNormalization); }; } // namespace sptk #endif // SPTK_SRC_FILTER_COEFFICIENT_NORMALIZATION_H_ |
From: fujishita t. <fjs...@us...> - 2017-07-11 10:33:20
|
Update of /cvsroot/sp-tk/SPTK/src/bin/us In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15133/bin/us Modified Files: Makefile.am Log Message: modify a way to compile: suggested by Giulio Paci Index: Makefile.am =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/us/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.am 4 Dec 2014 01:46:39 -0000 1.14 --- Makefile.am 11 Jul 2017 10:33:17 -0000 1.15 *************** *** 26,34 **** -e 's,[@]io_format[@],$(IO_FORMAT),g' ! us16: us16.in ! $(replace_path) < us16.in > $@ chmod +x $@ ! uscd: uscd.in ! $(replace_path) < uscd.in > $@ chmod +x $@ --- 26,34 ---- -e 's,[@]io_format[@],$(IO_FORMAT),g' ! us16: @srcdir@/us16.in ! $(replace_path) < "$<" > $@ chmod +x $@ ! uscd: @srcdir@/uscd.in ! $(replace_path) < "$<" > $@ chmod +x $@ |