Working codec2 support

This commit is contained in:
Brian West
2010-09-21 12:35:41 -05:00
parent 549b2356d6
commit 62b55523c2
150 changed files with 14078 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
AM_CFLAGS = -I../src -g -DFLOATING_POINT -DVAR_ARRAYS
AUTOMAKE_OPTS = gnu
NAME = libcodec2
AM_CPPFLAGS = $(AM_CFLAGS)
bin_PROGRAMS = genres genlsp extract vqtrain tnlp tinterp tquant tcodec2
genres_SOURCES = genres.c ../src/lpc.c ../src/codebook.c
genres_LDADD = $(lib_LTLIBRARIES)
genres_LDFLAGS = $(LIBS)
genlsp_SOURCES = genlsp.c ../src/lpc.c ../src/lsp.c ../src/codebook.c
genlsp_LDADD = $(lib_LTLIBRARIES)
genlsp_LDFLAGS = $(LIBS)
extract_SOURCES = extract.c ../src/codebook.c
extract_LDADD = $(lib_LTLIBRARIES)
extract_LDFLAGS = $(LIBS)
vqtrain_SOURCES = vqtrain.c ../src/codebook.c
vqtrain_LDADD = $(lib_LTLIBRARIES)
vqtrain_LDFLAGS = $(LIBS)
tnlp_SOURCES = tnlp.c ../src/sine.c ../src/nlp.c ../src/four1.c ../src/dump.c ../src/codebook.c
tnlp_LDADD = $(lib_LTLIBRARIES)
tnlp_LDFLAGS = $(LIBS)
tinterp_SOURCES = tinterp.c ../src/sine.c ../src/four1.c ../src/interp.c ../src/codebook.c
tinterp_LDADD = $(lib_LTLIBRARIES)
tinterp_LDFLAGS = $(LIBS)
tquant_SOURCES = tquant.c ../src/quantise.c ../src/lpc.c ../src/lsp.c ../src/dump.c ../src/four1.c ../src/codebook.c
tquant_LDADD = $(lib_LTLIBRARIES)
tquant_LDFLAGS = $(LIBS)
tcodec2_SOURCES = tcodec2.c ../src/quantise.c ../src/lpc.c ../src/lsp.c ../src/dump.c ../src/four1.c \
../src/codec2.c ../src/sine.c ../src/nlp.c ../src/postfilter.c ../src/phase.c ../src/interp.c ../src/pack.c ../src/codebook.c
tcodec2_LDADD = $(lib_LTLIBRARIES)
tcodec2_LDFLAGS = $(LIBS)

View File

@@ -0,0 +1,735 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = genres$(EXEEXT) genlsp$(EXEEXT) extract$(EXEEXT) \
vqtrain$(EXEEXT) tnlp$(EXEEXT) tinterp$(EXEEXT) \
tquant$(EXEEXT) tcodec2$(EXEEXT)
subdir = unittest
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_extract_OBJECTS = extract.$(OBJEXT) codebook.$(OBJEXT)
extract_OBJECTS = $(am_extract_OBJECTS)
extract_DEPENDENCIES =
am_genlsp_OBJECTS = genlsp.$(OBJEXT) lpc.$(OBJEXT) lsp.$(OBJEXT) \
codebook.$(OBJEXT)
genlsp_OBJECTS = $(am_genlsp_OBJECTS)
genlsp_DEPENDENCIES =
am_genres_OBJECTS = genres.$(OBJEXT) lpc.$(OBJEXT) codebook.$(OBJEXT)
genres_OBJECTS = $(am_genres_OBJECTS)
genres_DEPENDENCIES =
am_tcodec2_OBJECTS = tcodec2.$(OBJEXT) quantise.$(OBJEXT) \
lpc.$(OBJEXT) lsp.$(OBJEXT) dump.$(OBJEXT) four1.$(OBJEXT) \
codec2.$(OBJEXT) sine.$(OBJEXT) nlp.$(OBJEXT) \
postfilter.$(OBJEXT) phase.$(OBJEXT) interp.$(OBJEXT) \
pack.$(OBJEXT) codebook.$(OBJEXT)
tcodec2_OBJECTS = $(am_tcodec2_OBJECTS)
tcodec2_DEPENDENCIES =
am_tinterp_OBJECTS = tinterp.$(OBJEXT) sine.$(OBJEXT) four1.$(OBJEXT) \
interp.$(OBJEXT) codebook.$(OBJEXT)
tinterp_OBJECTS = $(am_tinterp_OBJECTS)
tinterp_DEPENDENCIES =
am_tnlp_OBJECTS = tnlp.$(OBJEXT) sine.$(OBJEXT) nlp.$(OBJEXT) \
four1.$(OBJEXT) dump.$(OBJEXT) codebook.$(OBJEXT)
tnlp_OBJECTS = $(am_tnlp_OBJECTS)
tnlp_DEPENDENCIES =
am_tquant_OBJECTS = tquant.$(OBJEXT) quantise.$(OBJEXT) lpc.$(OBJEXT) \
lsp.$(OBJEXT) dump.$(OBJEXT) four1.$(OBJEXT) \
codebook.$(OBJEXT)
tquant_OBJECTS = $(am_tquant_OBJECTS)
tquant_DEPENDENCIES =
am_vqtrain_OBJECTS = vqtrain.$(OBJEXT) codebook.$(OBJEXT)
vqtrain_OBJECTS = $(am_vqtrain_OBJECTS)
vqtrain_DEPENDENCIES =
DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(extract_SOURCES) $(genlsp_SOURCES) $(genres_SOURCES) \
$(tcodec2_SOURCES) $(tinterp_SOURCES) $(tnlp_SOURCES) \
$(tquant_SOURCES) $(vqtrain_SOURCES)
DIST_SOURCES = $(extract_SOURCES) $(genlsp_SOURCES) $(genres_SOURCES) \
$(tcodec2_SOURCES) $(tinterp_SOURCES) $(tnlp_SOURCES) \
$(tquant_SOURCES) $(vqtrain_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AM_CFLAGS = -I../src -g -DFLOATING_POINT -DVAR_ARRAYS
AUTOMAKE_OPTS = gnu
NAME = libcodec2
AM_CPPFLAGS = $(AM_CFLAGS)
genres_SOURCES = genres.c ../src/lpc.c ../src/codebook.c
genres_LDADD = $(lib_LTLIBRARIES)
genres_LDFLAGS = $(LIBS)
genlsp_SOURCES = genlsp.c ../src/lpc.c ../src/lsp.c ../src/codebook.c
genlsp_LDADD = $(lib_LTLIBRARIES)
genlsp_LDFLAGS = $(LIBS)
extract_SOURCES = extract.c ../src/codebook.c
extract_LDADD = $(lib_LTLIBRARIES)
extract_LDFLAGS = $(LIBS)
vqtrain_SOURCES = vqtrain.c ../src/codebook.c
vqtrain_LDADD = $(lib_LTLIBRARIES)
vqtrain_LDFLAGS = $(LIBS)
tnlp_SOURCES = tnlp.c ../src/sine.c ../src/nlp.c ../src/four1.c ../src/dump.c ../src/codebook.c
tnlp_LDADD = $(lib_LTLIBRARIES)
tnlp_LDFLAGS = $(LIBS)
tinterp_SOURCES = tinterp.c ../src/sine.c ../src/four1.c ../src/interp.c ../src/codebook.c
tinterp_LDADD = $(lib_LTLIBRARIES)
tinterp_LDFLAGS = $(LIBS)
tquant_SOURCES = tquant.c ../src/quantise.c ../src/lpc.c ../src/lsp.c ../src/dump.c ../src/four1.c ../src/codebook.c
tquant_LDADD = $(lib_LTLIBRARIES)
tquant_LDFLAGS = $(LIBS)
tcodec2_SOURCES = tcodec2.c ../src/quantise.c ../src/lpc.c ../src/lsp.c ../src/dump.c ../src/four1.c \
../src/codec2.c ../src/sine.c ../src/nlp.c ../src/postfilter.c ../src/phase.c ../src/interp.c ../src/pack.c ../src/codebook.c
tcodec2_LDADD = $(lib_LTLIBRARIES)
tcodec2_LDFLAGS = $(LIBS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu unittest/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu unittest/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
extract$(EXEEXT): $(extract_OBJECTS) $(extract_DEPENDENCIES)
@rm -f extract$(EXEEXT)
$(LINK) $(extract_LDFLAGS) $(extract_OBJECTS) $(extract_LDADD) $(LIBS)
genlsp$(EXEEXT): $(genlsp_OBJECTS) $(genlsp_DEPENDENCIES)
@rm -f genlsp$(EXEEXT)
$(LINK) $(genlsp_LDFLAGS) $(genlsp_OBJECTS) $(genlsp_LDADD) $(LIBS)
genres$(EXEEXT): $(genres_OBJECTS) $(genres_DEPENDENCIES)
@rm -f genres$(EXEEXT)
$(LINK) $(genres_LDFLAGS) $(genres_OBJECTS) $(genres_LDADD) $(LIBS)
tcodec2$(EXEEXT): $(tcodec2_OBJECTS) $(tcodec2_DEPENDENCIES)
@rm -f tcodec2$(EXEEXT)
$(LINK) $(tcodec2_LDFLAGS) $(tcodec2_OBJECTS) $(tcodec2_LDADD) $(LIBS)
tinterp$(EXEEXT): $(tinterp_OBJECTS) $(tinterp_DEPENDENCIES)
@rm -f tinterp$(EXEEXT)
$(LINK) $(tinterp_LDFLAGS) $(tinterp_OBJECTS) $(tinterp_LDADD) $(LIBS)
tnlp$(EXEEXT): $(tnlp_OBJECTS) $(tnlp_DEPENDENCIES)
@rm -f tnlp$(EXEEXT)
$(LINK) $(tnlp_LDFLAGS) $(tnlp_OBJECTS) $(tnlp_LDADD) $(LIBS)
tquant$(EXEEXT): $(tquant_OBJECTS) $(tquant_DEPENDENCIES)
@rm -f tquant$(EXEEXT)
$(LINK) $(tquant_LDFLAGS) $(tquant_OBJECTS) $(tquant_LDADD) $(LIBS)
vqtrain$(EXEEXT): $(vqtrain_OBJECTS) $(vqtrain_DEPENDENCIES)
@rm -f vqtrain$(EXEEXT)
$(LINK) $(vqtrain_LDFLAGS) $(vqtrain_OBJECTS) $(vqtrain_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codebook.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codec2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/four1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genlsp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genres.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lsp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/phase.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postfilter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quantise.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sine.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcodec2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinterp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnlp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tquant.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vqtrain.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
codebook.o: ../src/codebook.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codebook.o -MD -MP -MF "$(DEPDIR)/codebook.Tpo" -c -o codebook.o `test -f '../src/codebook.c' || echo '$(srcdir)/'`../src/codebook.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/codebook.Tpo" "$(DEPDIR)/codebook.Po"; else rm -f "$(DEPDIR)/codebook.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/codebook.c' object='codebook.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codebook.o `test -f '../src/codebook.c' || echo '$(srcdir)/'`../src/codebook.c
codebook.obj: ../src/codebook.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codebook.obj -MD -MP -MF "$(DEPDIR)/codebook.Tpo" -c -o codebook.obj `if test -f '../src/codebook.c'; then $(CYGPATH_W) '../src/codebook.c'; else $(CYGPATH_W) '$(srcdir)/../src/codebook.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/codebook.Tpo" "$(DEPDIR)/codebook.Po"; else rm -f "$(DEPDIR)/codebook.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/codebook.c' object='codebook.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codebook.obj `if test -f '../src/codebook.c'; then $(CYGPATH_W) '../src/codebook.c'; else $(CYGPATH_W) '$(srcdir)/../src/codebook.c'; fi`
lpc.o: ../src/lpc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lpc.o -MD -MP -MF "$(DEPDIR)/lpc.Tpo" -c -o lpc.o `test -f '../src/lpc.c' || echo '$(srcdir)/'`../src/lpc.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lpc.Tpo" "$(DEPDIR)/lpc.Po"; else rm -f "$(DEPDIR)/lpc.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/lpc.c' object='lpc.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lpc.o `test -f '../src/lpc.c' || echo '$(srcdir)/'`../src/lpc.c
lpc.obj: ../src/lpc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lpc.obj -MD -MP -MF "$(DEPDIR)/lpc.Tpo" -c -o lpc.obj `if test -f '../src/lpc.c'; then $(CYGPATH_W) '../src/lpc.c'; else $(CYGPATH_W) '$(srcdir)/../src/lpc.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lpc.Tpo" "$(DEPDIR)/lpc.Po"; else rm -f "$(DEPDIR)/lpc.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/lpc.c' object='lpc.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lpc.obj `if test -f '../src/lpc.c'; then $(CYGPATH_W) '../src/lpc.c'; else $(CYGPATH_W) '$(srcdir)/../src/lpc.c'; fi`
lsp.o: ../src/lsp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lsp.o -MD -MP -MF "$(DEPDIR)/lsp.Tpo" -c -o lsp.o `test -f '../src/lsp.c' || echo '$(srcdir)/'`../src/lsp.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lsp.Tpo" "$(DEPDIR)/lsp.Po"; else rm -f "$(DEPDIR)/lsp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/lsp.c' object='lsp.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lsp.o `test -f '../src/lsp.c' || echo '$(srcdir)/'`../src/lsp.c
lsp.obj: ../src/lsp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lsp.obj -MD -MP -MF "$(DEPDIR)/lsp.Tpo" -c -o lsp.obj `if test -f '../src/lsp.c'; then $(CYGPATH_W) '../src/lsp.c'; else $(CYGPATH_W) '$(srcdir)/../src/lsp.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lsp.Tpo" "$(DEPDIR)/lsp.Po"; else rm -f "$(DEPDIR)/lsp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/lsp.c' object='lsp.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lsp.obj `if test -f '../src/lsp.c'; then $(CYGPATH_W) '../src/lsp.c'; else $(CYGPATH_W) '$(srcdir)/../src/lsp.c'; fi`
quantise.o: ../src/quantise.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT quantise.o -MD -MP -MF "$(DEPDIR)/quantise.Tpo" -c -o quantise.o `test -f '../src/quantise.c' || echo '$(srcdir)/'`../src/quantise.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/quantise.Tpo" "$(DEPDIR)/quantise.Po"; else rm -f "$(DEPDIR)/quantise.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/quantise.c' object='quantise.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o quantise.o `test -f '../src/quantise.c' || echo '$(srcdir)/'`../src/quantise.c
quantise.obj: ../src/quantise.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT quantise.obj -MD -MP -MF "$(DEPDIR)/quantise.Tpo" -c -o quantise.obj `if test -f '../src/quantise.c'; then $(CYGPATH_W) '../src/quantise.c'; else $(CYGPATH_W) '$(srcdir)/../src/quantise.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/quantise.Tpo" "$(DEPDIR)/quantise.Po"; else rm -f "$(DEPDIR)/quantise.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/quantise.c' object='quantise.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o quantise.obj `if test -f '../src/quantise.c'; then $(CYGPATH_W) '../src/quantise.c'; else $(CYGPATH_W) '$(srcdir)/../src/quantise.c'; fi`
dump.o: ../src/dump.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump.o -MD -MP -MF "$(DEPDIR)/dump.Tpo" -c -o dump.o `test -f '../src/dump.c' || echo '$(srcdir)/'`../src/dump.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dump.Tpo" "$(DEPDIR)/dump.Po"; else rm -f "$(DEPDIR)/dump.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/dump.c' object='dump.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump.o `test -f '../src/dump.c' || echo '$(srcdir)/'`../src/dump.c
dump.obj: ../src/dump.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump.obj -MD -MP -MF "$(DEPDIR)/dump.Tpo" -c -o dump.obj `if test -f '../src/dump.c'; then $(CYGPATH_W) '../src/dump.c'; else $(CYGPATH_W) '$(srcdir)/../src/dump.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dump.Tpo" "$(DEPDIR)/dump.Po"; else rm -f "$(DEPDIR)/dump.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/dump.c' object='dump.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump.obj `if test -f '../src/dump.c'; then $(CYGPATH_W) '../src/dump.c'; else $(CYGPATH_W) '$(srcdir)/../src/dump.c'; fi`
four1.o: ../src/four1.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT four1.o -MD -MP -MF "$(DEPDIR)/four1.Tpo" -c -o four1.o `test -f '../src/four1.c' || echo '$(srcdir)/'`../src/four1.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/four1.Tpo" "$(DEPDIR)/four1.Po"; else rm -f "$(DEPDIR)/four1.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/four1.c' object='four1.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o four1.o `test -f '../src/four1.c' || echo '$(srcdir)/'`../src/four1.c
four1.obj: ../src/four1.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT four1.obj -MD -MP -MF "$(DEPDIR)/four1.Tpo" -c -o four1.obj `if test -f '../src/four1.c'; then $(CYGPATH_W) '../src/four1.c'; else $(CYGPATH_W) '$(srcdir)/../src/four1.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/four1.Tpo" "$(DEPDIR)/four1.Po"; else rm -f "$(DEPDIR)/four1.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/four1.c' object='four1.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o four1.obj `if test -f '../src/four1.c'; then $(CYGPATH_W) '../src/four1.c'; else $(CYGPATH_W) '$(srcdir)/../src/four1.c'; fi`
codec2.o: ../src/codec2.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codec2.o -MD -MP -MF "$(DEPDIR)/codec2.Tpo" -c -o codec2.o `test -f '../src/codec2.c' || echo '$(srcdir)/'`../src/codec2.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/codec2.Tpo" "$(DEPDIR)/codec2.Po"; else rm -f "$(DEPDIR)/codec2.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/codec2.c' object='codec2.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codec2.o `test -f '../src/codec2.c' || echo '$(srcdir)/'`../src/codec2.c
codec2.obj: ../src/codec2.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codec2.obj -MD -MP -MF "$(DEPDIR)/codec2.Tpo" -c -o codec2.obj `if test -f '../src/codec2.c'; then $(CYGPATH_W) '../src/codec2.c'; else $(CYGPATH_W) '$(srcdir)/../src/codec2.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/codec2.Tpo" "$(DEPDIR)/codec2.Po"; else rm -f "$(DEPDIR)/codec2.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/codec2.c' object='codec2.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codec2.obj `if test -f '../src/codec2.c'; then $(CYGPATH_W) '../src/codec2.c'; else $(CYGPATH_W) '$(srcdir)/../src/codec2.c'; fi`
sine.o: ../src/sine.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sine.o -MD -MP -MF "$(DEPDIR)/sine.Tpo" -c -o sine.o `test -f '../src/sine.c' || echo '$(srcdir)/'`../src/sine.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sine.Tpo" "$(DEPDIR)/sine.Po"; else rm -f "$(DEPDIR)/sine.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/sine.c' object='sine.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sine.o `test -f '../src/sine.c' || echo '$(srcdir)/'`../src/sine.c
sine.obj: ../src/sine.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sine.obj -MD -MP -MF "$(DEPDIR)/sine.Tpo" -c -o sine.obj `if test -f '../src/sine.c'; then $(CYGPATH_W) '../src/sine.c'; else $(CYGPATH_W) '$(srcdir)/../src/sine.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sine.Tpo" "$(DEPDIR)/sine.Po"; else rm -f "$(DEPDIR)/sine.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/sine.c' object='sine.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sine.obj `if test -f '../src/sine.c'; then $(CYGPATH_W) '../src/sine.c'; else $(CYGPATH_W) '$(srcdir)/../src/sine.c'; fi`
nlp.o: ../src/nlp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nlp.o -MD -MP -MF "$(DEPDIR)/nlp.Tpo" -c -o nlp.o `test -f '../src/nlp.c' || echo '$(srcdir)/'`../src/nlp.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/nlp.Tpo" "$(DEPDIR)/nlp.Po"; else rm -f "$(DEPDIR)/nlp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/nlp.c' object='nlp.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nlp.o `test -f '../src/nlp.c' || echo '$(srcdir)/'`../src/nlp.c
nlp.obj: ../src/nlp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nlp.obj -MD -MP -MF "$(DEPDIR)/nlp.Tpo" -c -o nlp.obj `if test -f '../src/nlp.c'; then $(CYGPATH_W) '../src/nlp.c'; else $(CYGPATH_W) '$(srcdir)/../src/nlp.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/nlp.Tpo" "$(DEPDIR)/nlp.Po"; else rm -f "$(DEPDIR)/nlp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/nlp.c' object='nlp.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nlp.obj `if test -f '../src/nlp.c'; then $(CYGPATH_W) '../src/nlp.c'; else $(CYGPATH_W) '$(srcdir)/../src/nlp.c'; fi`
postfilter.o: ../src/postfilter.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT postfilter.o -MD -MP -MF "$(DEPDIR)/postfilter.Tpo" -c -o postfilter.o `test -f '../src/postfilter.c' || echo '$(srcdir)/'`../src/postfilter.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/postfilter.Tpo" "$(DEPDIR)/postfilter.Po"; else rm -f "$(DEPDIR)/postfilter.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/postfilter.c' object='postfilter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o postfilter.o `test -f '../src/postfilter.c' || echo '$(srcdir)/'`../src/postfilter.c
postfilter.obj: ../src/postfilter.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT postfilter.obj -MD -MP -MF "$(DEPDIR)/postfilter.Tpo" -c -o postfilter.obj `if test -f '../src/postfilter.c'; then $(CYGPATH_W) '../src/postfilter.c'; else $(CYGPATH_W) '$(srcdir)/../src/postfilter.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/postfilter.Tpo" "$(DEPDIR)/postfilter.Po"; else rm -f "$(DEPDIR)/postfilter.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/postfilter.c' object='postfilter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o postfilter.obj `if test -f '../src/postfilter.c'; then $(CYGPATH_W) '../src/postfilter.c'; else $(CYGPATH_W) '$(srcdir)/../src/postfilter.c'; fi`
phase.o: ../src/phase.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT phase.o -MD -MP -MF "$(DEPDIR)/phase.Tpo" -c -o phase.o `test -f '../src/phase.c' || echo '$(srcdir)/'`../src/phase.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/phase.Tpo" "$(DEPDIR)/phase.Po"; else rm -f "$(DEPDIR)/phase.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/phase.c' object='phase.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o phase.o `test -f '../src/phase.c' || echo '$(srcdir)/'`../src/phase.c
phase.obj: ../src/phase.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT phase.obj -MD -MP -MF "$(DEPDIR)/phase.Tpo" -c -o phase.obj `if test -f '../src/phase.c'; then $(CYGPATH_W) '../src/phase.c'; else $(CYGPATH_W) '$(srcdir)/../src/phase.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/phase.Tpo" "$(DEPDIR)/phase.Po"; else rm -f "$(DEPDIR)/phase.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/phase.c' object='phase.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o phase.obj `if test -f '../src/phase.c'; then $(CYGPATH_W) '../src/phase.c'; else $(CYGPATH_W) '$(srcdir)/../src/phase.c'; fi`
interp.o: ../src/interp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interp.o -MD -MP -MF "$(DEPDIR)/interp.Tpo" -c -o interp.o `test -f '../src/interp.c' || echo '$(srcdir)/'`../src/interp.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/interp.Tpo" "$(DEPDIR)/interp.Po"; else rm -f "$(DEPDIR)/interp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/interp.c' object='interp.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interp.o `test -f '../src/interp.c' || echo '$(srcdir)/'`../src/interp.c
interp.obj: ../src/interp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interp.obj -MD -MP -MF "$(DEPDIR)/interp.Tpo" -c -o interp.obj `if test -f '../src/interp.c'; then $(CYGPATH_W) '../src/interp.c'; else $(CYGPATH_W) '$(srcdir)/../src/interp.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/interp.Tpo" "$(DEPDIR)/interp.Po"; else rm -f "$(DEPDIR)/interp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/interp.c' object='interp.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interp.obj `if test -f '../src/interp.c'; then $(CYGPATH_W) '../src/interp.c'; else $(CYGPATH_W) '$(srcdir)/../src/interp.c'; fi`
pack.o: ../src/pack.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack.o -MD -MP -MF "$(DEPDIR)/pack.Tpo" -c -o pack.o `test -f '../src/pack.c' || echo '$(srcdir)/'`../src/pack.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pack.Tpo" "$(DEPDIR)/pack.Po"; else rm -f "$(DEPDIR)/pack.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/pack.c' object='pack.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack.o `test -f '../src/pack.c' || echo '$(srcdir)/'`../src/pack.c
pack.obj: ../src/pack.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack.obj -MD -MP -MF "$(DEPDIR)/pack.Tpo" -c -o pack.obj `if test -f '../src/pack.c'; then $(CYGPATH_W) '../src/pack.c'; else $(CYGPATH_W) '$(srcdir)/../src/pack.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pack.Tpo" "$(DEPDIR)/pack.Po"; else rm -f "$(DEPDIR)/pack.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/pack.c' object='pack.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack.obj `if test -f '../src/pack.c'; then $(CYGPATH_W) '../src/pack.c'; else $(CYGPATH_W) '$(srcdir)/../src/pack.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,121 @@
/*--------------------------------------------------------------------------*\
FILE........: extract.c
AUTHOR......: David Rowe
DATE CREATED: 23/2/95
This program extracts a float file of vectors from a text file
of vectors. The float files are easier to process quickly
during VQ training. A subset of the text file VQ may be
extracted to faciltate split VQ of scaler VQ design.
\*--------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define MAX_STR 256 /* maximum string length */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
void scan_line(FILE *fp, float f[], int n);
int main(int argc, char *argv[]) {
FILE *ftext; /* text file of vectors */
FILE *ffloat; /* float file of vectors */
int st,en; /* start and end values of vector to copy */
float *buf; /* ptr to vector read from ftext */
long lines; /* lines read so far */
if (argc != 5) {
printf("usage: extract TextFile FloatFile start end\n");
exit(0);
}
/* read command line arguments and open files */
ftext = fopen(argv[1],"rt");
if (ftext == NULL) {
printf("Error opening text file: %s\n",argv[1]);
exit(1);
}
ffloat = fopen(argv[2],"wb");
if (ffloat == NULL) {
printf("Error opening float file: %s\n",argv[2]);
exit(1);
}
st = atoi(argv[3]);
en = atoi(argv[4]);
buf = (float*)malloc(en*sizeof(float));
if (buf == NULL) {
printf("Error in malloc()\n");
exit(1);
}
lines = 0;
while(!feof(ftext)) {
scan_line(ftext, buf, en);
fwrite(&buf[st-1], sizeof(float), en-st+1, ffloat);
printf("\r%ld lines",lines++);
}
printf("\n");
/* clean up and exit */
free(buf);
fclose(ftext);
fclose(ffloat);
return 0;
}
/*---------------------------------------------------------------------------*\
FUNCTION....: scan_line()
AUTHOR......: David Rowe
DATE CREATED: 20/2/95
This function reads a vector of floats from a line in a text file.
\*---------------------------------------------------------------------------*/
void scan_line(FILE *fp, float f[], int n)
/* FILE *fp; file ptr to text file */
/* float f[]; array of floats to return */
/* int n; number of floats in line */
{
char s[MAX_STR];
char *ps,*pe;
int i;
fgets(s,MAX_STR,fp);
ps = pe = s;
for(i=0; i<n; i++) {
while( isspace(*pe)) pe++;
while( !isspace(*pe)) pe++;
sscanf(ps,"%f",&f[i]);
ps = pe;
}
}

View File

@@ -0,0 +1,149 @@
/*--------------------------------------------------------------------------*\
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define P 10 /* LP order */
#define LSP_DELTA1 0.05 /* 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 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#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<argc; i++)
if (!strcmp(sw,argv[i]))
return(i);
return 0;
}
int main(int argc, char *argv[]) {
FILE *fspc; /* input file ptr for test database */
FILE *flsp; /* output text file of LSPs */
short buf[N]; /* input frame of speech samples */
float Sn[NW]; /* float input speech samples */
float ak[P+1]; /* LPCs for current frame */
float lsp[P]; /* LSPs for current frame */
float E; /* frame energy */
long af; /* number frames with "active" speech */
float Eres; /* LPC residual energy */
int i;
int roots;
int unstables;
int lspd;
/* Initialise ------------------------------------------------------*/
if (argc < 3) {
printf("usage: gentest RawFile LSPTextFile [--lspd]\n");
exit(0);
}
/* Open files */
fspc = fopen(argv[1],"rb");
if (fspc == NULL) {
printf("Error opening input SPC file: %s",argv[1]);
exit(1);
}
flsp = fopen(argv[2],"wt");
if (flsp == NULL) {
printf("Error opening output LSP file: %s",argv[2]);
exit(1);
}
lspd = switch_present("--lspd", argc, argv);
for(i=0; i<NW; i++)
Sn[i] = 0.0;
/* Read SPC file, and determine aks[] for each frame ------------------*/
af = 0;
unstables = 0;
while(fread(buf,sizeof(short),N,fspc) == N) {
for(i=0; i<NW-N; i++)
Sn[i] = Sn[i+N];
E = 0.0;
for(i=0; i<N; i++) {
Sn[i+NW-N] = buf[i];
E += Sn[i]*Sn[i];
}
E = 0.0;
for(i=0; i<NW; i++) {
E += Sn[i]*Sn[i];
}
E = 10.0*log10(E/NW);
/* If energy high enough, include this frame */
if (E > THRESH) {
af++;
printf("Active Frame: %ld unstables: %d\n",af, unstables);
find_aks(Sn, ak, NW, P, &Eres);
roots = lpc_to_lsp(&ak[1], P , lsp, 5, LSP_DELTA1);
if (roots == P) {
if (lspd) {
fprintf(flsp,"%f ",lsp[0]);
for(i=1; i<P; i++)
fprintf(flsp,"%f ",lsp[i]-lsp[i-1]);
fprintf(flsp,"\n");
}
else {
for(i=0; i<P; i++)
fprintf(flsp,"%f ",lsp[i]);
fprintf(flsp,"\n");
}
}
else
unstables++;
}
}
fclose(fspc);
fclose(flsp);
return 0;
}

View File

@@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
FILE........: genres.c
AUTHOR......: David Rowe
DATE CREATED: 24/8/09
Generates a file of LPC residual samples from original speech.
\*---------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <lpc.h>
#define N 160
#define P 10
int main(int argc, char *argv[])
{
FILE *fin,*fres; /* input and output files */
short buf[N]; /* buffer of 16 bit speech samples */
float Sn[P+N]; /* input speech samples */
float res[N]; /* residual after LPC filtering */
float E;
float ak[P+1]; /* LP coeffs */
int frames; /* frames processed so far */
int i; /* loop variables */
if (argc < 3) {
printf("usage: %s InputFile ResidualFile\n", argv[0]);
exit(0);
}
/* Open files */
if ((fin = fopen(argv[1],"rb")) == NULL) {
printf("Error opening input file: %s\n",argv[1]);
exit(0);
}
if ((fres = fopen(argv[2],"wb")) == NULL) {
printf("Error opening output residual file: %s\n",argv[2]);
exit(0);
}
/* Initialise */
frames = 0;
for(i=0; i<P; i++) {
Sn[i] = 0.0;
}
/* Main loop */
while( (fread(buf,sizeof(short),N,fin)) == N) {
frames++;
for(i=0; i<N; i++)
Sn[P+i] = (float)buf[i];
/* Determine {ak} and filter to find residual */
find_aks(&Sn[P], ak, N, P, &E);
inverse_filter(&Sn[P], ak, N, res, P);
for(i=0; i<N; i++)
buf[i] = (short)res[i];
fwrite(buf,sizeof(short),N,fres);
}
fclose(fin);
fclose(fres);
return 0;
}

View File

@@ -0,0 +1,16 @@
225
250
275
300
325
350
375
400
425
450
475
500
525
550
575
600

View File

@@ -0,0 +1,5 @@
2900
3100
3300
3500

View File

@@ -0,0 +1,16 @@
325
350
375
400
425
450
475
500
525
550
575
600
625
650
675
700

View File

@@ -0,0 +1,16 @@
500
550
600
650
700
750
800
850
900
950
1000
1050
1100
1150
1200
1250

View File

@@ -0,0 +1,16 @@
700
800
900
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200

View File

@@ -0,0 +1,18 @@
950
1050
1150
1250
1350
1450
1550
1650
1750
1850
1950
2050
2150
2250
2350
2450

View File

@@ -0,0 +1,18 @@
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2500
2600

View File

@@ -0,0 +1,18 @@
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2500
2600
2700
2800
2900
3000

View File

@@ -0,0 +1,10 @@
2300
2400
2500
2600
2700
2800
2900
3000

View File

@@ -0,0 +1,10 @@
2500
2600
2700
2800
2900
3000
3100
3200

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,64 @@
0.281245 0.072824
0.339645 0.060014
0.409277 0.064576
0.523095 0.061305
0.230096 0.211887
0.207683 0.332701
0.284308 0.308783
0.140378 0.711570
0.174527 0.127827
0.352952 0.235323
0.370502 0.190103
0.402932 0.159641
0.347927 0.146360
0.296583 0.131013
0.223266 0.153607
0.197020 0.420964
0.116898 0.516163
0.119488 0.109699
0.111778 0.278792
0.578302 0.202919
0.414620 0.214613
0.305886 0.397131
0.332819 0.101995
0.378387 0.086890
0.382898 0.121331
0.453255 0.063910
0.426851 0.114357
0.460512 0.099039
0.479185 0.134529
0.496434 0.084061
0.573538 0.071989
0.531672 0.120071
0.591529 0.134458
0.511033 0.180023
0.448004 0.171478
0.322286 0.187786
0.297869 0.238597
0.242424 0.263223
0.175075 0.260064
0.201034 0.074025
0.268571 0.522305
0.344104 0.296771
0.409613 0.271732
0.173676 0.190087
0.115603 0.193700
0.115269 0.373202
0.407643 0.637929
0.439428 0.478964
0.567749 0.389060
0.551502 0.271892
0.639284 0.075639
0.665511 0.286926
0.720983 0.084070
0.795786 0.214436
0.832583 0.095102
0.671796 0.164706
0.983554 0.136778
0.812831 0.368808
0.644281 0.515306
0.480389 0.316998
0.403689 0.360441
0.476736 0.232898
0.248084 0.111421
0.273953 0.180184

View File

@@ -0,0 +1,64 @@
0.678062 0.043120
0.472775 0.257353
0.522878 0.127961
0.628034 0.038788
0.480545 0.057725
0.437201 0.064479
0.327854 0.073645
0.308168 0.135691
0.390919 0.172150
0.362940 0.121889
0.384688 0.065511
0.419078 0.117947
0.468913 0.116759
0.507838 0.089601
0.555567 0.052196
0.521040 0.052787
0.589645 0.043616
0.985285 0.088227
0.724020 0.177911
0.129928 0.130564
0.120671 0.249971
0.266520 0.077658
0.685157 0.083387
0.673088 0.130951
0.726463 0.107217
0.779587 0.130439
0.652097 0.060232
0.616365 0.062903
0.614893 0.095188
0.671203 0.264629
0.657805 0.188243
0.647995 0.095077
0.581225 0.110398
0.573894 0.254912
0.531176 0.201073
0.544230 0.353796
0.621094 0.138556
0.717028 0.053894
0.890269 0.071236
1.100420 0.115118
0.492946 0.167302
0.387836 0.249419
0.929411 0.210459
0.389735 0.351413
0.273341 0.443161
0.453321 0.457227
0.303206 0.300360
0.563261 0.148813
0.789479 0.244432
0.817080 0.062843
0.852058 0.150352
0.760492 0.059787
0.711233 0.355546
0.598869 0.189758
0.583624 0.073653
0.548949 0.089569
0.445394 0.183962
0.333115 0.197087
0.246232 0.142290
0.263973 0.216087
0.185969 0.192135
0.205425 0.302232
0.195923 0.088343
0.148277 0.406699

View File

@@ -0,0 +1,177 @@
/*---------------------------------------------------------------------------*\
FILE........: lsptest.c
AUTHOR......: David Rowe
DATE CREATED: 24/8/09
Test Speech LPC to LSP conversion and quantisation.
\*---------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <lpc.h>
#include <lsp.h>
#include <sd.h>
#define N 160
#define P 10
#define LPC_FLOOR 0.0002 /* autocorrelation floor */
#define LSP_DELTA1 0.2 /* grid spacing for LSP root searches */
#define NDFT 256 /* DFT size for SD calculation */
/* Speex lag window */
const float lag_window[11] = {
1.00000, 0.99716, 0.98869, 0.97474, 0.95554, 0.93140, 0.90273, 0.86998,
0.83367, 0.79434, 0.75258
};
/*---------------------------------------------------------------------------*\
find_aks_for_lsp()
This function takes a frame of samples, and determines the linear
prediction coefficients for that frame of samples. Modified version of
find_aks from lpc.c to include autocorrelation noise floor and lag window
to match Speex processing steps prior to LSP conversion.
\*---------------------------------------------------------------------------*/
void find_aks_for_lsp(
float Sn[], /* Nsam samples with order sample memory */
float a[], /* order+1 LPCs with first coeff 1.0 */
int Nsam, /* number of input speech samples */
int order, /* order of the LPC analysis */
float *E /* residual energy */
)
{
float Wn[N]; /* windowed frame of Nsam speech samples */
float R[P+1]; /* order+1 autocorrelation values of Sn[] */
int i;
hanning_window(Sn,Wn,Nsam);
autocorrelate(Wn,R,Nsam,order);
R[0] += LPC_FLOOR;
assert(order == 10); /* lag window only defined for order == 10 */
for(i=0; i<=order; i++)
R[i] *= lag_window[i];
levinson_durbin(R,a,order);
*E = 0.0;
for(i=0; i<=order; i++)
*E += a[i]*R[i];
if (*E < 0.0)
*E = 1E-12;
}
/*---------------------------------------------------------------------------*\
MAIN
\*---------------------------------------------------------------------------*/
int main(int argc, char *argv[])
{
FILE *fin; /* input speech files */
short buf[N]; /* buffer of 16 bit speech samples */
float Sn[P+N]; /* input speech samples */
float E;
float ak[P+1]; /* LP coeffs */
float ak_[P+1]; /* quantised LP coeffs */
float lsp[P];
float lsp_[P]; /* quantised LSPs */
int roots; /* number of LSP roots found */
int frames; /* frames processed so far */
int i; /* loop variables */
SpeexBits bits;
float sd; /* SD for this frame */
float totsd; /* accumulated SD so far */
int gt2,gt4; /* number of frames > 2 and 4 dB SD */
int unstables; /* number of unstable LSP frames */
if (argc < 2) {
printf("usage: %s InputFile\n", argv[0]);
exit(0);
}
/* Open files */
if ((fin = fopen(argv[1],"rb")) == NULL) {
printf("Error opening input file: %s\n",argv[1]);
exit(0);
}
/* Initialise */
frames = 0;
for(i=0; i<P; i++) {
Sn[i] = 0.0;
}
ak_[0] = 1.0;
speex_bits_init(&bits);
totsd = 0.0;
unstables = 0;
gt2 = 0; gt4 = 0;
/* Main loop */
while( (fread(buf,sizeof(short),N,fin)) == N) {
frames++;
for(i=0; i<N; i++)
Sn[P+i] = (float)buf[i];
/* convert to LSP domain and back */
find_aks(&Sn[P], ak, N, P, &E);
roots = lpc_to_lsp(&ak[1], P , lsp, 10, LSP_DELTA1, NULL);
if (roots == P) {
speex_bits_reset(&bits);
lsp_quant_lbr(lsp, lsp_, P, &bits);
lsp_to_lpc(lsp_, &ak_[1], P, NULL);
/* measure spectral distortion */
sd = spectral_dist(ak, ak_, P, NDFT);
if (sd > 2.0) gt2++;
if (sd > 4.0) gt4++;
totsd += sd;
}
else
unstables++;
}
fclose(fin);
printf("frames = %d Av sd = %3.2f dB", frames, totsd/frames);
printf(" >2 dB %3.2f%% >4 dB %3.2f%% unstables: %d\n",gt2*100.0/frames,
gt4*100.0/frames, unstables);
return 0;
}

View File

@@ -0,0 +1,84 @@
/*--------------------------------------------------------------------------*\
FILE........: sd.c
AUTHOR......: David Rowe
DATE CREATED: 20/7/93
Function to determine spectral distortion between two sets of LPCs.
\*--------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define MAX_N 2048 /* maximum DFT size */
#include <math.h>
#include "four1.h"
#include "comp.h"
#include "sd.h"
/*---------------------------------------------------------------------------*\
FUNCTION....: spectral_dist()
AUTHOR......: David Rowe
DATE CREATED: 20/7/93
This function returns the soectral distoertion between two
sets of LPCs.
\*---------------------------------------------------------------------------*/
float spectral_dist(float ak1[], float ak2[], int p, int n)
/* float ak1[]; unquantised set of p+1 LPCs */
/* float ak2[]; quantised set of p+1 LPCs */
/* int p; LP order */
/* int n; DFT size to use for SD calculations (power of 2) */
{
COMP A1[MAX_N]; /* DFT of ak1[] */
COMP A2[MAX_N]; /* DFT of ak2[] */
float P1,P2; /* power of current bin */
float sd;
int i;
for(i=0; i<n; i++) {
A1[i].real = 0.0;
A1[i].imag = 0.0;
A2[i].real = 0.0;
A2[i].imag = 0.0;
}
for(i=0; i<p+1; i++) {
A1[i].real = ak1[i];
A2[i].real = ak2[i];
}
four1(&A1[-1].imag,n,-1);
four1(&A2[-1].imag,n,-1);
sd = 0.0;
for(i=0; i<n; i++) {
P1 = A1[i].real*A1[i].real + A1[i].imag*A1[i].imag;
P2 = A2[i].real*A2[i].real + A2[i].imag*A2[i].imag;
sd += pow(log10(P2/P1),2.0);
}
sd = 10.0*sqrt(sd/n); /* sd in dB */
return(sd);
}

View File

@@ -0,0 +1,215 @@
/*---------------------------------------------------------------------------*\
FILE........: tcodec2.c
AUTHOR......: David Rowe
DATE CREATED: 24/8/10
Test program for codec2.c functions.
\*---------------------------------------------------------------------------*/
/*
Copyright (C) 2010 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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "defines.h"
#include "codec2.h"
#include "quantise.h"
#include "interp.h"
/* CODEC2 struct copies from codec2.c to help with testing */
typedef struct {
float Sn[M]; /* input speech */
float w[M]; /* time domain hamming window */
COMP W[FFT_ENC]; /* DFT of w[] */
float Pn[2*N]; /* trapezoidal synthesis window */
float Sn_[2*N]; /* synthesised speech */
float prev_Wo; /* previous frame's pitch estimate */
float ex_phase; /* excitation model phase track */
float bg_est; /* background noise estimate for post filter */
MODEL prev_model; /* model parameters from 20ms ago */
} CODEC2;
void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]);
void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model, float ak[]);
int test1()
{
FILE *fin, *fout;
short buf[N];
void *c2;
CODEC2 *c3;
MODEL model;
float ak[LPC_ORD+1];
float lsps[LPC_ORD];
c2 = codec2_create();
c3 = (CODEC2*)c2;
fin = fopen("../raw/hts1a.raw", "rb");
assert(fin != NULL);
fout = fopen("hts1a_test.raw", "wb");
assert(fout != NULL);
while(fread(buf, sizeof(short), N, fin) == N) {
analyse_one_frame(c3, &model, buf);
speech_to_uq_lsps(lsps, ak, c3->Sn, c3->w, LPC_ORD);
synthesise_one_frame(c3, buf, &model, ak);
fwrite(buf, sizeof(short), N, fout);
}
codec2_destroy(c2);
fclose(fin);
fclose(fout);
return 0;
}
int test2()
{
FILE *fin, *fout;
short buf[2*N];
void *c2;
CODEC2 *c3;
MODEL model, model_interp;
float ak[LPC_ORD+1];
int voiced1, voiced2;
int lsp_indexes[LPC_ORD];
int lpc_correction;
int energy_index;
int Wo_index;
char bits[CODEC2_BITS_PER_FRAME];
int nbit;
int i;
c2 = codec2_create();
c3 = (CODEC2*)c2;
fin = fopen("../raw/hts1a.raw", "rb");
assert(fin != NULL);
fout = fopen("hts1a_test.raw", "wb");
assert(fout != NULL);
while(fread(buf, sizeof(short), 2*N, fin) == 2*N) {
/* first 10ms analysis frame - we just want voicing */
analyse_one_frame(c3, &model, buf);
voiced1 = model.voiced;
/* second 10ms analysis frame */
analyse_one_frame(c3, &model, &buf[N]);
voiced2 = model.voiced;
Wo_index = encode_Wo(model.Wo);
encode_amplitudes(lsp_indexes,
&lpc_correction,
&energy_index,
&model,
c3->Sn,
c3->w);
nbit = 0;
pack(bits, &nbit, Wo_index, WO_BITS);
for(i=0; i<LPC_ORD; i++) {
pack(bits, &nbit, lsp_indexes[i], lsp_bits(i));
}
pack(bits, &nbit, lpc_correction, 1);
pack(bits, &nbit, energy_index, E_BITS);
pack(bits, &nbit, voiced1, 1);
pack(bits, &nbit, voiced2, 1);
nbit = 0;
Wo_index = unpack(bits, &nbit, WO_BITS);
for(i=0; i<LPC_ORD; i++) {
lsp_indexes[i] = unpack(bits, &nbit, lsp_bits(i));
}
lpc_correction = unpack(bits, &nbit, 1);
energy_index = unpack(bits, &nbit, E_BITS);
voiced1 = unpack(bits, &nbit, 1);
voiced2 = unpack(bits, &nbit, 1);
model.Wo = decode_Wo(Wo_index);
model.L = PI/model.Wo;
decode_amplitudes(&model,
ak,
lsp_indexes,
lpc_correction,
energy_index);
model.voiced = voiced2;
model_interp.voiced = voiced1;
interpolate(&model_interp, &c3->prev_model, &model);
synthesise_one_frame(c3, buf, &model_interp, ak);
synthesise_one_frame(c3, &buf[N], &model, ak);
memcpy(&c3->prev_model, &model, sizeof(MODEL));
fwrite(buf, sizeof(short), 2*N, fout);
}
codec2_destroy(c2);
fclose(fin);
fclose(fout);
return 0;
}
int test3()
{
FILE *fin, *fout, *fbits;
short buf1[2*N];
short buf2[2*N];
char bits[CODEC2_BITS_PER_FRAME];
void *c2;
c2 = codec2_create();
fin = fopen("../raw/hts1a.raw", "rb");
assert(fin != NULL);
fout = fopen("hts1a_test.raw", "wb");
assert(fout != NULL);
fbits = fopen("hts1a_test3.bit", "wb");
assert(fout != NULL);
while(fread(buf1, sizeof(short), 2*N, fin) == 2*N) {
codec2_encode(c2, bits, buf1);
fwrite(bits, sizeof(char), CODEC2_BITS_PER_FRAME, fbits);
codec2_decode(c2, buf2, bits);
fwrite(buf2, sizeof(short), CODEC2_SAMPLES_PER_FRAME, fout);
}
codec2_destroy(c2);
fclose(fin);
fclose(fout);
fclose(fbits);
return 0;
}
int main() {
test3();
return 0;
}

View File

@@ -0,0 +1,187 @@
/*---------------------------------------------------------------------------*\
FILE........: tcontphase.c
AUTHOR......: David Rowe
DATE CREATED: 11/9/09
Test program for developing continuous phase track synthesis algorithm.
However while developing this it was discovered that synthesis_mixed()
worked just as well.
\*---------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define N 80 /* frame size */
#define F 160 /* frames to synthesis */
#define P 10 /* LPC order */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "sine.h"
#include "dump.h"
#include "synth.h"
#include "phase.h"
int frames;
float ak[] = {
1.000000,
-1.455836,
1.361841,
-0.879267,
0.915985,
-1.002202,
0.944103,
-0.743094,
1.053356,
-0.817491,
0.431222
};
/*---------------------------------------------------------------------------*\
switch_present()
Searches the command line arguments for a "switch". If the switch is
found, returns the command line argument where it ws found, else returns
NULL.
\*---------------------------------------------------------------------------*/
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<argc; i++)
if (!strcmp(sw,argv[i]))
return(i);
return 0;
}
/*---------------------------------------------------------------------------*\
MAIN
\*---------------------------------------------------------------------------*/
int main(argc,argv)
int argc;
char *argv[];
{
FILE *fout;
short buf[N];
int i,j;
int dump;
float phi_prev[MAX_AMP];
float Wo_prev, ex_phase, G;
//float ak[P+1];
COMP H[MAX_AMP];
float f0;
if (argc < 3) {
printf("\nusage: tcontphase OutputRawSpeechFile F0\n");
exit(0);
}
/* Output file */
if ((fout = fopen(argv[1],"wb")) == NULL) {
printf("Error opening output speech file: %s\n",argv[1]);
exit(1);
}
f0 = atof(argv[2]);
dump = switch_present("--dump",argc,argv);
if (dump)
dump_on(argv[dump+1]);
init_decoder();
for(i=0; i<MAX_AMP; i++)
phi_prev[i] = 0.0;
Wo_prev = 0.0;
model.Wo = PI*(f0/4000.0);
G = 1000.0;
model.L = floor(PI/model.Wo);
//aks_to_H(&model, ak, G , H, P);
//for(i=1; i<=model.L; i++)
model.A[i] = sqrt(H[i].real*H[i].real + H[i].imag*H[i].imag);
//printf("L = %d\n", model.L);
//model.L = 10;
for(i=1; i<=model.L; i++) {
model.A[i] = 1000/model.L;
model.phi[i] = 0;
H[i].real = 1.0; H[i].imag = 0.0;
}
//ak[0] = 1.0;
//for(i=1; i<=P; i++)
// ak[i] = 0.0;
frames = 0;
for(j=0; j<F; j++) {
frames++;
#ifdef SWAP
/* lets make phases bounce around from frame to frame. This
could happen if H[m] is varying, for example due to frame
to frame Wo variations, or non-stationary speech.
Continous model generally results in smooth phase track
under these circumstances. */
if (j%2){
H[1].real = 1.0; H[1].imag = 0.0;
model.phi[1] = 0.0;
}
else {
H[1].real = 0.0; H[1].imag = 1.0;
model.phi[1] = PI/2;
}
#endif
//#define CONT
#ifdef CONT
synthesise_continuous_phase(Pn, &model, Sn_, 1, &Wo_prev, phi_prev);
#else
phase_synth_zero_order(5.0, H, &Wo_prev, &ex_phase);
synthesise_mixed(Pn,&model,Sn_,1);
#endif
for(i=0; i<N; i++)
buf[i] = Sn_[i];
fwrite(buf,sizeof(short),N,fout);
}
fclose(fout);
if (dump) dump_off();
return 0;
}

View File

@@ -0,0 +1,128 @@
/*---------------------------------------------------------------------------*\
FILE........: tinterp.c
AUTHOR......: David Rowe
DATE CREATED: 22/8/10
Tests interpolation functions.
\*---------------------------------------------------------------------------*/
/*
Copyright (C) 2010 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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include "defines.h"
#include "sine.h"
#include "interp.h"
void make_amp(MODEL *model, float f0, float cdB, float mdBHz)
{
int i;
float mdBrad = mdBHz*FS/TWO_PI;
model->Wo = f0*TWO_PI/FS;
model->L = PI/model->Wo;
for(i=0; i<=model->L; i++)
model->A[i] = pow(10.0,(cdB + (float)i*model->Wo*mdBrad)/20.0);
model->voiced = 1;
}
void write_amp(char file[], MODEL *model)
{
FILE *f;
int i;
f = fopen(file,"wt");
for(i=1; i<=model->L; i++)
fprintf(f, "%f\t%f\n", model->Wo*i, model->A[i]);
fclose(f);
}
char *get_next_float(char *s, float *num)
{
char *p = s;
char tmp[MAX_STR];
while(*p && !isspace(*p))
p++;
memcpy(tmp, s, p-s);
tmp[p-s] = 0;
*num = atof(tmp);
return p+1;
}
char *get_next_int(char *s, int *num)
{
char *p = s;
char tmp[MAX_STR];
while(*p && !isspace(*p))
p++;
memcpy(tmp, s, p-s);
tmp[p-s] = 0;
*num = atoi(tmp);
return p+1;
}
void load_amp(MODEL *model, char file[], int frame)
{
FILE *f;
int i;
char s[1024];
char *ps;
f = fopen(file,"rt");
for(i=0; i<frame; i++)
fgets(s, 1023, f);
ps = s;
ps = get_next_float(ps, &model->Wo);
ps = get_next_int(ps, &model->L);
for(i=1; i<=model->L; i++)
ps = get_next_float(ps, &model->A[i]);
fclose(f);
}
int main() {
MODEL prev, next, interp;
//make_amp(&prev, 50.0, 60.0, 6E-3);
//make_amp(&next, 50.0, 40.0, 6E-3);
load_amp(&prev, "../src/hts1a_model.txt", 32);
load_amp(&next, "../src/hts1a_model.txt", 34);
interp.voiced = 1;
interpolate(&interp, &prev, &next);
write_amp("tinterp_prev.txt", &prev);
write_amp("tinterp_interp.txt", &interp);
write_amp("tinterp_next.txt", &next);
return 0;
}

View File

@@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
FILE........: tnlp.c
AUTHOR......: David Rowe
DATE CREATED: 23/3/93
Test program for non linear pitch estimation functions.
\*---------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define N 80 /* frame size */
#define M 320 /* pitch analysis window size */
#define PITCH_MIN 20
#define PITCH_MAX 160
#define TNLP
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "defines.h"
#include "dump.h"
#include "sine.h"
#include "nlp.h"
int frames;
/*---------------------------------------------------------------------------*\
switch_present()
Searches the command line arguments for a "switch". If the switch is
found, returns the command line argument where it ws found, else returns
NULL.
\*---------------------------------------------------------------------------*/
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<argc; i++)
if (!strcmp(sw,argv[i]))
return(i);
return 0;
}
/*---------------------------------------------------------------------------*\
MAIN
\*---------------------------------------------------------------------------*/
int main(argc,argv)
int argc;
char *argv[];
{
FILE *fin,*fout;
short buf[N];
float Sn[M]; /* float input speech samples */
COMP Sw[FFT_ENC]; /* DFT of Sn[] */
float w[M]; /* time domain hamming window */
COMP W[FFT_ENC]; /* DFT of w[] */
float pitch;
int i;
int dump;
float prev_Wo;
void *nlp_states;
if (argc < 3) {
printf("\nusage: tnlp InputRawSpeechFile OutputPitchTextFile "
"[--dump DumpFile]\n");
exit(0);
}
/* Input file */
if ((fin = fopen(argv[1],"rb")) == NULL) {
printf("Error opening input speech file: %s\n",argv[1]);
exit(1);
}
/* Output file */
if ((fout = fopen(argv[2],"wt")) == NULL) {
printf("Error opening output text file: %s\n",argv[2]);
exit(1);
}
dump = switch_present("--dump",argc,argv);
if (dump)
dump_on(argv[dump+1]);
nlp_states = nlp_create();
make_analysis_window(w,W);
frames = 0;
prev_Wo = 0;
while(fread(buf,sizeof(short),N,fin)) {
printf("%d\n", frames++);
/* Update input speech buffers */
for(i=0; i<M-N; i++)
Sn[i] = Sn[i+N];
for(i=0; i<N; i++)
Sn[i+M-N] = buf[i];
dft_speech(Sw, Sn, w);
dump_Sn(Sn); dump_Sw(Sw);
nlp(nlp_states,Sn,N,M,PITCH_MIN,PITCH_MAX,&pitch,Sw,&prev_Wo);
prev_Wo = TWO_PI/pitch;
fprintf(fout,"%f\n",pitch);
}
fclose(fin);
fclose(fout);
if (dump) dump_off();
nlp_destroy(nlp_states);
return 0;
}

View File

@@ -0,0 +1,215 @@
/*---------------------------------------------------------------------------*\
FILE........: tquant.c
AUTHOR......: David Rowe
DATE CREATED: 22/8/10
Generates quantisation curves for plotting on Octave.
\*---------------------------------------------------------------------------*/
/*
Copyright (C) 2010 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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "defines.h"
#include "dump.h"
#include "quantise.h"
int test_Wo_quant();
int test_lsp_quant();
int test_lsp(int lsp_number, int levels, float max_error_hz);
int test_energy_quant(int levels, float max_error_dB);
int main() {
quantise_init();
test_Wo_quant();
test_lsp_quant();
test_energy_quant(E_LEVELS, 0.5*(E_MAX_DB - E_MIN_DB)/E_LEVELS);
return 0;
}
int test_lsp_quant() {
test_lsp( 1, 16, 12.5);
test_lsp( 2, 16, 12.5);
test_lsp( 3, 16, 25);
test_lsp( 4, 16, 50);
test_lsp( 5, 16, 50);
test_lsp( 6, 16, 50);
test_lsp( 7, 16, 50);
test_lsp( 8, 8, 50);
test_lsp( 9, 8, 50);
test_lsp(10, 4, 100);
return 0;
}
int test_energy_quant(int levels, float max_error_dB) {
FILE *fe;
float e,e_dec, error, low_e, high_e;
int index, index_in, index_out, i;
/* check 1:1 match between input and output levels */
for(i=0; i<levels; i++) {
index_in = i;
e = decode_energy(index_in);
index_out = encode_energy(e);
if (index_in != index_out) {
printf("edB: %f index_in: %d index_out: %d\n",
10.0*log10(e), index_in, index_out);
exit(0);
}
}
/* check error over range of quantiser */
low_e = decode_energy(0);
high_e = decode_energy(levels-1);
fe = fopen("energy_err.txt", "wt");
for(e=low_e; e<high_e; e +=(high_e-low_e)/1000.0) {
index = encode_energy(e);
e_dec = decode_energy(index);
error = 10.0*log10(e) - 10.0*log10(e_dec);
fprintf(fe, "%f\n", error);
if (fabs(error) > max_error_dB) {
printf("error: %f %f\n", error, max_error_dB);
exit(0);
}
}
fclose(fe);
return 0;
}
int test_lsp(int lsp_number, int levels, float max_error_hz) {
float lsp[LPC_ORD];
int indexes_in[LPC_ORD];
int indexes_out[LPC_ORD];
int indexes[LPC_ORD];
int i;
float lowf, highf, f, error;
char s[MAX_STR];
FILE *flsp;
float max_error_rads;
lsp_number--;
max_error_rads = max_error_hz*TWO_PI/FS;
for(i=0; i<LPC_ORD; i++)
indexes_in[i] = 0;
for(i=0; i<levels; i++) {
indexes_in[lsp_number] = i;
decode_lsps(lsp, indexes_in, LPC_ORD);
encode_lsps(indexes_out, lsp,LPC_ORD);
if (indexes_in[lsp_number] != indexes_out[lsp_number]) {
printf("freq: %f index_in: %d index_out: %d\n",
lsp[lsp_number]+1, indexes_in[lsp_number],
indexes_out[lsp_number]);
exit(0);
}
}
for(i=0; i<LPC_ORD; i++)
indexes[i] = 0;
indexes[lsp_number] = 0;
decode_lsps(lsp, indexes, LPC_ORD);
lowf = lsp[lsp_number];
indexes[lsp_number] = levels - 1;
decode_lsps(lsp, indexes, LPC_ORD);
highf = lsp[lsp_number];
sprintf(s,"lsp%d_err.txt", lsp_number+1);
flsp = fopen(s, "wt");
for(f=lowf; f<highf; f +=(highf-lowf)/1000.0) {
lsp[lsp_number] = f;
encode_lsps(indexes, lsp, LPC_ORD);
decode_lsps(lsp, indexes, LPC_ORD);
error = f - lsp[lsp_number];
fprintf(flsp, "%f\n", error);
if (fabs(error) > max_error_rads) {
printf("%d error: %f %f\n", lsp_number+1, error, max_error_rads);
exit(0);
}
}
fclose(flsp);
printf("OK\n");
return 0;
}
int test_Wo_quant() {
int c;
FILE *f;
float Wo,Wo_dec, error, step_size;
int index, index_in, index_out;
/* output Wo quant curve for plotting */
f = fopen("quant_pitch.txt","wt");
for(Wo=0.9*(TWO_PI/P_MAX); Wo<=1.1*(TWO_PI/P_MIN); Wo += 0.001) {
index = encode_Wo(Wo);
fprintf(f, "%f %d\n", Wo, index);
}
fclose(f);
/* check for all Wo codes we get 1:1 match between encoder
and decoder Wo levels */
for(c=0; c<WO_LEVELS; c++) {
index_in = c;
Wo = decode_Wo(index_in);
index_out = encode_Wo(Wo);
if (index_in != index_out)
printf(" Wo %f index_in %d index_out %d\n", Wo,
index_in, index_out);
}
/* measure quantisation error stats and compare to expected. Also
plot histogram of error file to check. */
f = fopen("quant_pitch_err.txt","wt");
step_size = ((TWO_PI/P_MIN) - (TWO_PI/P_MAX))/WO_LEVELS;
for(Wo=TWO_PI/P_MAX; Wo<0.99*TWO_PI/P_MIN; Wo += 0.0001) {
index = encode_Wo(Wo);
Wo_dec = decode_Wo(index);
error = Wo - Wo_dec;
if (fabs(error) > (step_size/2.0)) {
printf("error: %f step_size/2: %f\n", error, step_size/2.0);
exit(0);
}
fprintf(f,"%f\n",error);
}
printf("OK\n");
fclose(f);
return 0;
}

View File

@@ -0,0 +1,297 @@
/*--------------------------------------------------------------------------*\
FILE........: VQTRAIN.C
AUTHOR......: David Rowe
DATE CREATED: 23/2/95
This program trains vector quantisers using K dimensional Lloyd-Max
method.
\*--------------------------------------------------------------------------*/
/*
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*-----------------------------------------------------------------------*\
INCLUDES
\*-----------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
/*-----------------------------------------------------------------------*\
DEFINES
\*-----------------------------------------------------------------------*/
#define DELTAQ 0.01 /* quiting distortion */
#define MAX_STR 80 /* maximum string length */
/*-----------------------------------------------------------------------*\
FUNCTION PROTOTYPES
\*-----------------------------------------------------------------------*/
void zero(float v[], int k);
void acc(float v1[], float v2[], int k);
void norm(float v[], int k, long n);
long quantise(float cb[], float vec[], int k, int m, float *se);
/*-----------------------------------------------------------------------*\
MAIN
\*-----------------------------------------------------------------------*/
int main(int argc, char *argv[]) {
long k,m; /* dimension and codebook size */
float *vec; /* current vector */
float *cb; /* vector codebook */
float *cent; /* centroids for each codebook entry */
long *n; /* number of vectors in this interval */
long J; /* number of vectors in training set */
long i,j;
long ind; /* index of current vector */
float se; /* squared error for this iteration */
float Dn,Dn_1; /* current and previous iterations distortion */
float delta; /* improvement in distortion */
FILE *ftrain; /* file containing training set */
FILE *fvq; /* file containing vector quantiser */
/* Interpret command line arguments */
if (argc != 5) {
printf("usage: vqtrain TrainFile K M VQFile\n");
exit(0);
}
/* Open training file */
ftrain = fopen(argv[1],"rb");
if (ftrain == NULL) {
printf("Error opening training database file: %s\n",argv[1]);
exit(1);
}
/* determine k and m, and allocate arrays */
k = atol(argv[2]);
m = atol(argv[3]);
printf("dimension K=%ld number of entries M=%ld\n", k,m);
vec = (float*)malloc(sizeof(float)*k);
cb = (float*)malloc(sizeof(float)*k*m);
cent = (float*)malloc(sizeof(float)*k*m);
n = (long*)malloc(sizeof(long)*m);
if (cb == NULL || cb == NULL || cent == NULL || vec == NULL) {
printf("Error in malloc.\n");
exit(1);
}
/* determine size of training set */
J = 0;
while(fread(vec, sizeof(float), k, ftrain) == k)
J++;
printf("J=%ld entries in training set\n", J);
/* set up initial codebook state from samples of training set */
rewind(ftrain);
fread(cb, sizeof(float), k*m, ftrain);
/* main loop */
Dn = 1E32;
j = 1;
do {
Dn_1 = Dn;
/* zero centroids */
for(i=0; i<m; i++) {
zero(&cent[i*k], k);
n[i] = 0;
}
/* quantise training set */
se = 0.0;
rewind(ftrain);
for(i=0; i<J; i++) {
fread(vec, sizeof(float), k, ftrain);
ind = quantise(cb, vec, k, m, &se);
n[ind]++;
acc(&cent[ind*k], vec, k);
}
Dn = se/J;
delta = (Dn_1-Dn)/Dn;
printf("\r Iteration %ld, Dn = %f, Delta = %e\n", j, Dn, delta);
j++;
/* determine new codebook from centriods */
if (delta > DELTAQ)
for(i=0; i<m; i++) {
if (n[i] != 0) {
norm(&cent[i*k], k, n[i]);
memcpy(&cb[i*k], &cent[i*k], k*sizeof(float));
}
}
} while (delta > DELTAQ);
/* save codebook to disk */
fvq = fopen(argv[4],"wt");
if (fvq == NULL) {
printf("Error opening VQ file: %s\n",argv[4]);
exit(1);
}
for(j=0; j<m; j++) {
for(i=0; i<k; i++)
fprintf(fvq,"%f ",cb[j*k+i]);
fprintf(fvq,"\n");
}
fclose(fvq);
return 0;
}
/*-----------------------------------------------------------------------*\
FUNCTIONS
\*-----------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
FUNCTION....: zero()
AUTHOR......: David Rowe
DATE CREATED: 23/2/95
Zeros a vector of length k.
\*---------------------------------------------------------------------------*/
void zero(float v[], int k)
/* float v[]; ptr to start of vector */
/* int k; lngth of vector */
{
int i;
for(i=0; i<k; i++)
v[i] = 0.0;
}
/*---------------------------------------------------------------------------*\
FUNCTION....: acc()
AUTHOR......: David Rowe
DATE CREATED: 23/2/95
Adds k dimensional vectors v1 to v2 and stores the result back in v1.
\*---------------------------------------------------------------------------*/
void acc(float v1[], float v2[], int k)
/* float v1[]; ptr to start of vector to accumulate */
/* float v2[]; ptr to start of vector to add */
/* int k; dimension of vectors */
{
int i;
for(i=0; i<k; i++)
v1[i] += v2[i];
}
/*---------------------------------------------------------------------------*\
FUNCTION....: norm()
AUTHOR......: David Rowe
DATE CREATED: 23/2/95
Divides each element in k dimensional vector v by n.
\*---------------------------------------------------------------------------*/
void norm(float v[], int k, long n)
/* float v[]; ptr to start of vector */
/* int k; dimension of vectors */
/* int n; normalising factor */
{
int i;
for(i=0; i<k; i++)
v[i] /= n;
}
/*---------------------------------------------------------------------------*\
FUNCTION....: quantise()
AUTHOR......: David Rowe
DATE CREATED: 23/2/95
Quantises vec by choosing the nearest vector in codebook cb, and
returns the vector index. The squared error of the quantised vector
is added to se.
\*---------------------------------------------------------------------------*/
long quantise(float cb[], float vec[], int k, int m, float *se)
/* float cb[][K]; current VQ codebook */
/* float vec[]; vector to quantise */
/* int k; dimension of vectors */
/* int m; size of codebook */
/* float *se; accumulated squared error */
{
float e; /* current error */
long besti; /* best index so far */
float beste; /* best error so far */
long j;
int i;
besti = 0;
beste = 1E32;
for(j=0; j<m; j++) {
e = 0.0;
for(i=0; i<k; i++)
e += pow(cb[j*k+i]-vec[i],2.0);
if (e < beste) {
beste = e;
besti = j;
}
}
*se += beste;
return(besti);
}