/*--------------------------------------------------------------------------*\ FILE........: genlsp.c AUTHOR......: David Rowe DATE CREATED: 23/2/95 This program genrates a text file of LSP vectors from an input speech file. \*--------------------------------------------------------------------------*/ /* Copyright (C) 2009 David Rowe All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ #define P 12 /* LP order */ #define LSP_DELTA1 0.01 /* grid spacing for LSP root searches */ #define NW 279 /* frame size in samples */ #define N 80 /* frame to frame shift */ #define THRESH 40.0 /* threshold energy/sample for frame inclusion */ #define PI 3.141592654 /* mathematical constant */ #include #include #include #include #include "lpc.h" /* LPC analysis functions */ #include "lsp.h" /* LSP encode/decode functions */ int switch_present(sw,argc,argv) char sw[]; /* switch in string form */ int argc; /* number of command line arguments */ char *argv[]; /* array of command line arguments in string form */ { int i; /* loop variable */ for(i=1; i THRESH) { af++; printf("Active Frame: %ld unstables: %d\n",af, unstables); find_aks(Sn, ak, NW, P, &Eres); roots = lpc_to_lsp(ak, P , lsp, 5, LSP_DELTA1); if (roots == P) { if (lspd) { if (log) { fprintf(flsp,"%f ",log10(lsp[0])); for(i=1; i