[RavenclawDev 367] [2035] trunk/Libraries: Added sphinxVAD, a toolkit to perform GMM-based VAD , based on Ziad Al Bawab's work

antoine@edam.speech.cs.cmu.edu antoine at edam.speech.cs.cmu.edu
Wed Sep 12 15:24:18 EDT 2007


An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070912/8e8cd143/attachment-0001.html
-------------- next part --------------
Added: trunk/Libraries/sphinxVAD/ReadMe.txt
===================================================================
--- trunk/Libraries/sphinxVAD/ReadMe.txt	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/ReadMe.txt	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,21 @@
+========================================================================
+    STATIC LIBRARY : sphinxVAD Project Overview
+========================================================================
+
+AppWizard has created this sphinxVAD library project for you. 
+No source files were created as part of your project.
+
+
+sphinxVAD.vcproj
+    This is the main project file for VC++ projects generated using an Application Wizard. 
+    It contains information about the version of Visual C++ that generated the file, and 
+    information about the platforms, configurations, and project features selected with the
+    Application Wizard.
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" comments to indicate parts of the source code you
+should add to or customize.
+
+/////////////////////////////////////////////////////////////////////////////

Added: trunk/Libraries/sphinxVAD/include/new_fe.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/new_fe.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/new_fe.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,177 @@
+/* ====================================================================
+ * Copyright (c) 1996-2000 Carnegie Mellon University.  All rights 
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. 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.
+ *
+ * 3. The names "Sphinx" and "Carnegie Mellon" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. To obtain permission, contact 
+ *    sphinx at cs.cmu.edu.
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Carnegie
+ *    Mellon University (http://www.speech.cs.cmu.edu/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
+ * ANY EXPRESSED 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 CARNEGIE MELLON UNIVERSITY
+ * NOR ITS EMPLOYEES 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 __NEW_FE_H__
+#define __NEW_FE_H__
+
+#define int32 int
+#define int16 short
+#define float32 float
+#define float64 double
+
+#include <snr/snrlib.h>
+
+typedef struct{
+    float32 SAMPLING_RATE;
+    int32 FRAME_RATE;
+    float32 WINDOW_LENGTH;
+    int32 FB_TYPE;
+    int32 NUM_CEPSTRA;
+    int32 NUM_FILTERS;
+    int32 FFT_SIZE;
+    float32 LOWER_FILT_FREQ;
+    float32 UPPER_FILT_FREQ;
+    float32 PRE_EMPHASIS_ALPHA;
+
+    char *wavfile;
+    char *cepfile;
+    char *ncepfile;
+    char *ctlfile;
+    char *wavdir;
+    char *cepdir;
+    char *wavext;
+    char *cepext;
+    char *ncepext;
+    int32 input_format;
+    int32 is_batch;
+    int32 is_single;
+    int32 blocksize;
+    int32 verbose;
+    int32 machine_endian;
+    int32 input_endian;
+    int32 output_endian;
+    int32 dither;
+    int32 logspec;
+    int32 doublebw;
+    int32 nchans;
+    int32 whichchan;
+} param_t;
+
+
+typedef struct{
+    float32 sampling_rate;
+    int32 num_cepstra;
+    int32 num_filters;
+    int32 fft_size;
+    float32 lower_filt_freq;
+    float32 upper_filt_freq;
+    float32 **filter_coeffs;
+    float32 **mel_cosine;
+    float32 *left_apex;
+    int32 *width;
+}melfb_t;
+
+
+typedef struct{
+    HIST **C0_hist;	
+    float32 SAMPLING_RATE;
+    int32 FRAME_RATE;
+    int32 FRAME_SHIFT;
+    float32 WINDOW_LENGTH;
+    int32 FRAME_SIZE;
+    int32 FFT_SIZE;
+    int32 FB_TYPE;
+    int32 NUM_CEPSTRA;
+    float32 PRE_EMPHASIS_ALPHA;
+    int16 *OVERFLOW_SAMPS;
+    int32 NUM_OVERFLOW_SAMPS;    
+    melfb_t *MEL_FB;
+    int32 START_FLAG;
+    int16 PRIOR;
+    float64 *HAMMING_WINDOW;
+    
+} fe_t;
+
+
+
+#define MEL_SCALE 1
+#define LOG_LINEAR 2
+
+/* Default values */
+#define DEFAULT_SAMPLING_RATE 16000.0f
+#define DEFAULT_FRAME_RATE 100
+#define DEFAULT_FRAME_SHIFT 160
+#define DEFAULT_WINDOW_LENGTH 0.025625f
+#define DEFAULT_FFT_SIZE 512
+#define DEFAULT_FB_TYPE MEL_SCALE
+#define DEFAULT_NUM_CEPSTRA 13
+#define DEFAULT_NUM_FILTERS 40
+#define DEFAULT_LOWER_FILT_FREQ 133.33334f
+#define DEFAULT_UPPER_FILT_FREQ 6855.4976f
+#define DEFAULT_PRE_EMPHASIS_ALPHA 0.97f
+#define DEFAULT_START_FLAG 0
+#define DEFAULT_BLOCKSIZE 200000
+
+/************* Histogram Stuff ****************************
+
+#define MILI_SEC 20.0
+#define PEAK_LEVEL 0.95
+
+#define BINS 500
+#define SMOOTH_BINS 7
+#define CODEC_SMOOTH_BINS 15
+//#define LOW -28.125
+#define LOW 0
+#define HIGH 30
+//#define HIGH 96.875
+
+#define BLOCKSIZE 2048
+
+/************* Histogram Stuff ****************************/
+
+
+
+/* Functions */
+
+fe_t *fe_init(param_t *P);
+
+int32 fe_start_utt(fe_t *FE);
+
+int32 fe_end_utt(fe_t *FE, float32 *cepvector);
+
+int32 fe_close(fe_t *FE);
+
+int32 fe_process(fe_t *FE, int16 *spch, int32 nsamps, float32 ***cep_block);
+
+int32 fe_process_utt(fe_t *FE, int16 *spch, int32 nsamps,float32 ***cep_block);
+
+#endif // __NEW_FE_H__
\ No newline at end of file

Added: trunk/Libraries/sphinxVAD/include/new_fe_sp.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/new_fe_sp.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/new_fe_sp.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,79 @@
+/* ====================================================================
+ * Copyright (c) 1996-2000 Carnegie Mellon University.  All rights 
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. 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.
+ *
+ * 3. The names "Sphinx" and "Carnegie Mellon" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. To obtain permission, contact 
+ *    sphinx at cs.cmu.edu.
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Carnegie
+ *    Mellon University (http://www.speech.cs.cmu.edu/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
+ * ANY EXPRESSED 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 CARNEGIE MELLON UNIVERSITY
+ * NOR ITS EMPLOYEES 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 __NEW_FE_SP_H__
+#define __NEW_FE_SP_H__
+
+#ifndef	M_PI
+#define M_PI	(3.14159265358979323846)
+#endif	/* M_PI */
+
+#define FORWARD_FFT 1
+#define INVERSE_FFT -1
+
+typedef struct { float64 r, i; } complexfe;
+
+/* functions */
+int32 fe_build_melfilters(melfb_t *MEL_FB);
+int32 fe_compute_melcosine(melfb_t *MEL_FB);
+float32 fe_mel(float32 x);
+float32 fe_melinv(float32 x);
+void fe_pre_emphasis(int16 *in, float64 *out, int32 len, float32 factor, int16 prior);
+void fe_create_hamming(float64 *in, int32 in_len);
+void fe_hamming_window(float64 *in, float64 *window, int32 in_len);
+void fe_init_hamming(float64 *win, int32 len);
+void fe_spec_magnitude(float64 *data, int32 data_len, float64 *spec, int32 fftsize);
+void fe_frame_to_fea(fe_t *FE, float64 *in, float64 *fea);
+void fe_mel_spec(fe_t *FE, float64 *spec, float64 *mfspec);
+void fe_mel_cep(fe_t *FE, float64 *mfspec, float64 *mfcep);
+int32 fe_fft(complexfe *in, complexfe *out, int32 N, int32 invert);
+void fe_short_to_double(int16 *in, float64 *out, int32 len);
+char **fe_create_2d(int32 d1, int32 d2, int32 elem_size);
+void fe_free_2d(void **arr);
+void fe_print_current(fe_t *FE);
+void fe_parse_general_params(param_t *P, fe_t *FE);
+void fe_parse_melfb_params(param_t *P, melfb_t *MEL);
+
+#endif // __NEW_FE_SP_H__
+
+
+

Added: trunk/Libraries/sphinxVAD/include/snr/complex.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/complex.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/complex.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,29 @@
+
+
+#ifndef _COMPLEX_H_
+#define _COMPLEX_H_
+
+typedef struct dude {
+	float	re;
+	float	im;
+} complex;
+
+/* complex.c */	complex cAdd PROTO((complex a, complex b));
+/* complex.c */	complex cSub PROTO((complex a, complex b));
+/* complex.c */	complex cMul PROTO((complex a, complex b));
+/* complex.c */	complex cDiv PROTO((complex a, complex b));
+/* complex.c */	complex cConj PROTO((complex a));
+/* complex.c */	complex cConjSquare PROTO((complex a));
+/* complex.c */	complex cSquare PROTO((complex a));
+/* complex.c */	complex cInvert PROTO((complex a));
+/* complex.c */	void cPrint PROTO((complex a));
+/* complex.c */	complex cPolar PROTO((double r, double w));
+/* complex.c */	complex cUnit PROTO((double w));
+/* complex.c */	complex cNum PROTO((double re, double im));
+/* complex.c */	complex cPolyZ PROTO((double w, int n, float *coeff));
+/* complex.c */	double cAngle PROTO((complex a));
+/* complex.c */	double cMagSquare PROTO((complex a));
+/* complex.c */	double cMag PROTO((complex a));
+
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/fft.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/fft.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/fft.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,46 @@
+
+/*
+ * FFT include file.
+ */
+#ifndef _FFT_H_
+#define _FFT_H_
+
+#ifndef PI
+#define PI 3.1415926535
+#endif
+
+#ifndef _COMPLEX_H_
+#include	"complex.h"
+#endif
+
+typedef struct lnode {
+	struct lnode *next;
+	long size;
+	complex *table;
+} LNODE;
+
+/* fft.c */	complex *FindTable PROTO((long int n));
+/* fft.c */	complex *AssignBasis PROTO((complex *ex, long int n));
+/* fft.c */	void reverseDig PROTO((complex *x, long int n, long int skip));
+/* fft.c */	void FFT2dimensional PROTO((complex *x, long int w, long int h, complex *ex));
+/* fft.c */	void FFT2torl PROTO((complex *x, long int n, long int skip, double scale, complex *ex));
+/* fft.c */	void FFT2torl_pack PROTO((complex *x, long int n, long int skip, double scale, complex *ex));
+/* fft.c */	void ConjScale PROTO((complex *x, long int n, double scale));
+/* fft.c */	void FFT2real PROTO((complex *x, long int n, long int skip, complex *ex));
+/* fft.c */	void Reals PROTO((complex *x, long int n, long int skip, int sign, complex *ex));
+/* fft.c */	void FFT2 PROTO((complex *x, long int n, long int skip, complex *ex));
+/* fft.c */	void FFT2raw PROTO((complex *x, long int n, long int dilate, long int skip, complex *ex));
+/* fft.c */	void DFT PROTO((complex *data, complex *result, long int n, complex *ex));
+/* fft.c */	void fft_real PROTO((complex *x, long int n));
+/* fft.c */	void ifft_real PROTO((complex *x, long int n));
+/* fft.c */	void fft_skip PROTO((complex *x, long int n, long int skip));
+/* fft.c */	void fft PROTO((complex *x, long int n));
+/* fft.c */	void ifft_skip PROTO((complex *x, long int n, long int skip));
+/* fft.c */	void ifft PROTO((complex *x, long int n));
+/* fft.c */	void fft_2d PROTO((complex *x, long int n1, long int n2));
+/* fft.c */	void ifft_2d PROTO((complex *x, long int n1, long int n2));
+/* fft.c */	void fft_real_pack PROTO((complex *x, long int n));
+/* fft.c */	void ifft_real_pack PROTO((complex *x, long int n));
+
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/filter.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/filter.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/filter.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,24 @@
+/* filter.h */
+
+/* Contains definition of filterbank structure */
+
+#ifndef _FILTER_H_
+#define _FILTER_H_
+
+#define DONT_FILTER (Filterbank *) NULL
+#define NULL_FILTER (double *) NULL
+
+typedef struct fbank
+{
+  int bands;      /* bands */
+  int *taps;      /* array of number of taps per filter */
+  double *weights; /* array of passband weights */
+  double **coeff; /* array of filter coefficients for each band */
+} Filterbank;
+
+/* filter.c */	void fir_filter_fft  PROTO((short int *input, int size, double *coeff, int taps));
+/* filter.c */	void fft_filter_init PROTO((double *coeff, int size,int taps));
+/* filter.c */	short fir_filter  PROTO((short int sample, double *coeff, int taps, double *memory));
+
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/linear.c
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/linear.c	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/linear.c	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,27 @@
+ /* table of linear values for codec bytes: */
+  static short int linear[256] = {-32124, -31100, -30076, -29052, 
+    -28028, -27004, -25980, -24956, -23932, -22908, -21884, -20860, 
+    -19836, -18812, -17788, -16764, -15996, -15484, -14972, -14460, 
+    -13948, -13436, -12924, -12412, -11900, -11388, -10876, -10364, 
+    -9852, -9340, -8828, -8316, -7932, -7676, -7420, -7164, -6908, 
+    -6652, -6396, -6140, -5884, -5628, -5372, -5116, -4860, -4604, 
+    -4348, -4092, -3900, -3772, -3644, -3516, -3388, -3260, -3132, 
+    -3004, -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, 
+    -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, -1372, 
+    -1308, -1244, -1180, -1116, -1052, -988, -924, -876, -844, -812, 
+    -780, -748, -716, -684, -652, -620, -588, -556, -524, -492, -460, 
+    -428, -396, -372, -356, -340, -324, -308, -292, -276, -260, -244, 
+    -228, -212, -196, -180, -164, -148, -132, -120, -112, -104, -96, 
+    -88, -80, -72, -64, -56, -48, -40, -32, -24, -16, -8, 0, 32124, 
+    31100, 30076, 29052, 28028, 27004, 25980, 24956, 23932, 22908, 
+    21884, 20860, 19836, 18812, 17788, 16764, 15996, 15484, 14972, 
+    14460, 13948, 13436, 12924, 12412, 11900, 11388, 10876, 10364, 
+    9852, 9340, 8828, 8316, 7932, 7676, 7420, 7164, 6908, 6652, 6396, 
+    6140, 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, 3900, 3772, 
+    3644, 3516, 3388, 3260, 3132, 3004, 2876, 2748, 2620, 2492, 2364, 
+    2236, 2108, 1980, 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, 
+    1372, 1308, 1244, 1180, 1116, 1052, 988, 924, 876, 844, 812, 
+    780, 748, 716, 684, 652, 620, 588, 556, 524, 492, 460, 428, 396, 
+    372, 356, 340, 324, 308, 292, 276, 260, 244, 228, 212, 196, 180, 
+    164, 148, 132, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 
+    32, 24, 16, 8, 0};

Added: trunk/Libraries/sphinxVAD/include/snr/power.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/power.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/power.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,10 @@
+
+#ifndef _POWER_H_
+#define _POWER_H_
+
+#define NEGATIVE_INFINITY -20.0
+
+/* power.c */	void pwr_compute PROTO((short int *samples, float **pwr, int sample_count, int *pwr_cnt, int win_size, int win_step));
+/* power.c */	float pwr1 PROTO((short int *win, int len));
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/remez.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/remez.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/remez.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,18 @@
+
+#ifndef _REMEZ_H_
+#define _REMEZ_H_
+
+/* remez.c */	double dw PROTO((double x));
+/* remez.c */	double ds PROTO((double x));
+/* remez.c */	double d PROTO((int k, int n, int m));
+/* remez.c */	double gee PROTO((int k, int n));
+/* remez.c */	double eff PROTO((double temp, double *fx, double *wtx, int lband, int jtype));
+/* remez.c */	double wate PROTO((double temp, double *fx, double *wtx, int lband, int jtype));
+/* remez.c */	int grad PROTO((double dd, double ds, double df));
+/* remez.c */	void fir1 PROTO((double *edge, int nfilt, int nbands, int *error, double *fx, double *wtx, int jtype, double *h));
+/* remez.c */	void design_bandpass_filter PROTO((double *h, double start, double end, int taps, double weight));
+
+
+
+#endif
+

Added: trunk/Libraries/sphinxVAD/include/snr/segment.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/segment.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/segment.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,16 @@
+
+#ifndef _SEGMENT_H_
+#define _SEGMENT_H_
+
+#define FROM 0
+#define TO 1
+
+#define MAX_SEGMENT 500
+
+/* segment.c */	int concatenate_speech PROTO((FILE *in_file, int **list, int segments, FILE *out_file));
+/* segment.c */	void hamming_window PROTO((short int *data, int size, int start));
+/* segment.c */	int window_size PROTO((int sample_rate, float miliseconds));
+/* segment.c */	float dc_offset  PROTO((FILE *fp, SPFILE_CHARS *sp_char));
+/* segment.c */	float rms_power  PROTO((short int *buffer, int start, int size, float offset));
+/* segment.c */	int segment_speech PROTO((FILE *fp, float speech, float noise, int **list));
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/snr.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/snr.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/snr.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,47 @@
+
+#ifndef _SNR_H_
+#define _SNR_H_
+
+#include <snr/filter.h>
+#include <snr/power.h>
+
+
+#define MILI_SEC 20.0f
+#define PEAK_LEVEL 0.95f
+
+#define BINS 500
+#define SMOOTH_BINS 7
+#define CODEC_SMOOTH_BINS 15
+
+//#define LOW -28.125
+#define LOW 0
+
+#define HIGH 25 
+//#define HIGH 96.875
+
+#define NOISE_THRESH	5
+//#define NOISE_THRESH	10	
+
+#define SPEECH_THRESH 	12 
+//#define SPEECH_THRESH 	17 
+
+#define BLOCKSIZE 2048
+
+
+/* snr.c */	float compute_dc_bias PROTO((register FILE *fp, SPFILE_CHARS *sp_char, int channel));
+/* snr.c */	int snr_all_channels PROTO((FILE *fp, float ***signal, float ***noise, float ***snrs, float ***cross, Filterbank *filters, int codec, int graph, char *filename));
+/* snr.c */	int quick_snr_all_channels PROTO((FILE *fp, float ***signal, float ***noise, float ***snrs, Filterbank *filters, int graph, char *filename));
+/* snr.c */	int snr_single_channel PROTO((FILE *fp, struct header_t *h, int channel, float *noise_level, float *speech_level, float *sig_to_noise_ratio, float *cross_level, int do_quick_snr, double *coeff, int taps, int codec, int graph, char *filename));
+/* snr.c */	int segsnr_single_channel PROTO((FILE *fp, int channel, float *noise_level, float *speech_level, float *sig_to_noise_ratio, int **list, int segments, double *coeff, int taps));
+/* snr.c */	int compute_pwr_hist_sd PROTO((register FILE *fp, HIST **pwr_hist, int num_bins, SPFILE_CHARS *sp_char, int channel, int frame_width, int frame_adv, double *coeff, int taps));
+/* snr.c */	void snr PROTO((HIST **full_hist, int num_bins, float cutoff_percentile, float *noise_lvl, float *speech_lvl, float *cross_lvl, int codec, int graph, char *filename));
+/* snr.c */	void  pick_peaks PROTO((HIST **full_hist, float *noise_lvl, float *cross_lvl, float *speech_lvl));
+/* snr.c */	void build_raised_cos_hist PROTO((HIST **ref_hist, HIST **ret_hist, int num_bins, float *noise_peak));
+/* snr.c */	float comp1 PROTO((int *vector));
+/* snr.c */	void do_init_comp1 PROTO((HIST **ref, HIST **hyp, int num_bins));
+/* snr.c */	float pick_center PROTO((HIST **h, int bin));
+/* snr.c */	void special_cosine_hist PROTO((HIST **hist, int num_bins, int middle, int height, int width));
+
+float normalize (float x, float noise_level, float speech_level);
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/snrlib.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/snrlib.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/snrlib.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,17 @@
+
+#include <util/utillib.h>
+//#include <sp/sphere.h>
+#include <snr/complex.h>
+#include <snr/fft.h>
+#include <snr/speech_det.h>
+#include <snr/filter.h>
+#include <snr/power.h>
+#include <snr/spfchar1.h>
+#include <snr/segment.h>
+#include <snr/wavio.h>
+#include <snr/remez.h>
+#include <snr/snr.h>
+
+
+
+

Added: trunk/Libraries/sphinxVAD/include/snr/speech_det.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/speech_det.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/speech_det.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,26 @@
+/* speech_det.h -- global stuff for speech detection */
+
+#ifndef _SPEECH_DET_H_
+#define _SPEECH_DET_H_
+
+#define SD_INIT_SIL		0
+#define SD_START_LOW		1
+#define SD_START_LOW_DROP	2
+#define SD_START_HIGH		3
+#define SD_START_LOW2		4
+#define SD_START_DROP		5
+#define SD_SPEAKING		6
+#define SD_FINISHING		7
+#define SD_FIN_SPIKE		8
+#define SD_FIN_SP_DROP		9
+#define SD_DONE			10
+
+
+/* speech_det.c */	int do_speech_detect PROTO((float r0, int fr_num));
+/* speech_det.c */	void set_speech_params PROTO((float start_low, float start_high, float end_low, float end_high));
+/* speech_det.c */	void force_speech_detect_done PROTO((int fr_num));
+/* speech_det.c */	int speech_begin PROTO((void)   /* return the frame when speech last began */);
+/* speech_det.c */	int speech_end PROTO((void) /* return the frame when speech last ended */);
+/* speech_det.c */	void init_speech_detect PROTO((int fr_num));
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/spfchar1.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/spfchar1.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/spfchar1.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,24 @@
+
+#ifndef _SPFCHAR1_H_
+#define _SPFCHAR1_H_
+
+#define SPFCHAR_H_VERSION "V1.0"
+
+/* file spfchar1.c */
+/* structure for important speech file characteristics: */
+typedef struct spfchars
+  {long int channel_count;
+   long int sample_count;
+   long int sample_rate;
+   long int sample_n_bytes;
+   char sample_coding[50];
+   int channels_interleaved;
+   int swap_bytes;
+   float dc_bias;
+  } SPFILE_CHARS;
+
+/* gspfchar.c */	int read_hdr PROTO((struct header_t *h, char *id, char *value, int importance));
+/* gspfchar.c */	void load_sp_char PROTO((struct header_t *h, SPFILE_CHARS *sp_char));
+/* gspfchar.c */	void print_sp_chars PROTO((SPFILE_CHARS *sp_char));
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/snr/wavio.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/snr/wavio.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/snr/wavio.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,10 @@
+
+#ifndef _WAVIO_H_
+#define  _WAVIO_H_
+/* wav_io.c */	void clear_waveform_read PROTO((void));
+/* wav_io.c */	void init_waveform_read PROTO((FILE *fp, int buff_len, SPFILE_CHARS *sp_char));
+/* wav_io.c */	int wave_read_1channel PROTO((char *out_arr, int channel));
+/* wav_io.c */	int wave_read_2channel PROTO((char *out0, char *out1));
+/* wav_io.c */	void shift_short_up PROTO((short int *to, short int *from, int num));
+
+#endif

Added: trunk/Libraries/sphinxVAD/include/sp/header.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/header.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/header.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,37 @@
+/* File: header.h */
+
+#define MAXFIELDS		8000
+
+#define FNULL			((struct field_t *) NULL)
+#define FVNULL			((struct field_t **) NULL)
+#define HDRNULL			((struct header_t *) NULL)
+
+#define DEFAULT_SAMPLE_CODING   "pcm"
+#define DEFAULT_CHANNEL_COUNT   1
+#define DEFAULT_SAMPLE_RATE     16000
+#define DEFAULT_SAMPLE_BYTE_COUNT     2
+
+#define T_INTEGER		0
+#define T_REAL			1
+#define T_STRING		2
+
+#define N_STDFIELDS		11
+
+#define ERROR_EXIT_STATUS	1
+
+struct field_t {
+	int type;
+	char *name;
+	char *data;
+	int datalen;
+	char *comment;
+};
+
+struct header_t {
+	int fc;
+	struct field_t **fv;
+};
+ 
+
+
+

Added: trunk/Libraries/sphinxVAD/include/sp/shorten/shorten.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/shorten/shorten.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/shorten/shorten.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,179 @@
+/******************************************************************************
+
+Copyright (C) 1992,1993 Tony Robinson
+
+Permission is granted to use this software for non-commercial purposes.
+Explicit permission must be obtained from the author to use this software
+for commercial purposes.
+
+This software carries no warranty, expressed or implied.  The user assumes
+all risks, known or unknown, direct or indirect, which involve this software
+in any way.
+
+Dr Tony Robinson
+Cambridge University Engineering Department
+Trumpington Street, Cambridge, CB2 1PZ, UK.
+ajr at eng.cam.ac.uk     voice: +44-223-332815
+
+******************************************************************************/
+
+/* Added by JGF to define types */
+#include <stddef.h>
+
+# define MAGIC			"ajkg"
+# define FORMAT_VERSION		1
+# define DEFAULT_BLOCK_SIZE	256
+# define DEFAULT_NMEAN		0
+# define DEFAULT_MAXNLPC	0
+# define MAX_LPC_ORDER		64
+# define DEFAULT_NCHAN		1
+# define DEFAULT_NSKIP		0
+# define DEFAULT_NDISCARD	0
+# define DEFAULT_MAXBITRATE	32
+# define DEFAULT_QUANTERROR	0
+
+# define CHANSIZE	0
+# define ENERGYSIZE	3
+# define BITSHIFTSIZE	2
+# define NWRAP		3
+
+# define FNSIZE		2
+# define FN_DIFF0	0
+# define FN_DIFF1	1
+# define FN_DIFF2	2
+# define FN_DIFF3	3
+# define FN_QUIT	4
+# define FN_BLOCKSIZE	5
+# define FN_BITSHIFT	6
+# define FN_QLPC	7
+
+# define ULONGSIZE	2
+# define NSKIPSIZE	1
+# define LPCQSIZE	2
+# define LPCQUANT	5
+# define XBYTESIZE	7
+
+# define TYPESIZE	4
+# define TYPE_AU	0
+# define TYPE_S8	1
+# define TYPE_U8	2
+# define TYPE_S16HL	3
+# define TYPE_U16HL	4
+# define TYPE_S16LH	5
+# define TYPE_U16LH	6
+
+#ifndef	MIN
+# define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#ifndef	MAX
+# define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
+#ifndef M_LN2
+#define	M_LN2	0.69314718055994530942
+#endif
+
+/* BUFSIZ must be a multiple of four to contain a whole number of words */
+#ifndef BUFSIZ
+# define BUFSIZ 1024
+#endif
+
+#undef	uchar
+#define uchar	unsigned char
+#undef	ushort
+#define ushort	unsigned short
+#undef	ulong
+#define ulong	unsigned long
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi)
+typedef signed char	schar;
+#define PROTO(ARGS)	ARGS
+#else
+typedef char		schar;
+#define PROTO(ARGS)	()
+#endif
+
+ /*******************************************/
+/* this should be in string.h or strings.h */
+extern int	strcmp		PROTO((const char*, const char*));
+extern char*	strcpy		PROTO((char*, const char*));
+extern char*	strcat		PROTO((char*, const char*));
+/* strlen should be size_t, not int */
+extern size_t	strlen		PROTO((const char*));
+
+ /**************************************/
+ /* defined in stdlib.h if you have it */
+/* BY JGF, malloc's parameter should be size_t */
+extern void*	malloc		PROTO((size_t));
+/* BY JGF, free's argument should be a void */
+extern void	free		PROTO((void*));
+/* BY JGF, atoi's argument should be a const char * */
+extern int	atoi		PROTO((const char*));
+extern void	swab		PROTO((char*, char*, int));
+extern int	fseek		PROTO((FILE*, long, int));
+
+ /***************************/
+/* other misc system calls */
+extern int	unlink		PROTO((const char*));
+
+ /**********************/
+/* defined in fixio.c */
+extern int	fread_type	PROTO((long**, int, int, int, FOB*));
+extern void	fwrite_type	PROTO((long**, int, int, int, FOB*));
+extern int	find_bitshift	PROTO((long*, int, int));
+extern void	fix_bitshift	PROTO((long*, int, int, int));
+
+
+ /**********************/
+/* defined in vario.c */
+extern void	var_put_init	PROTO((FOB*));
+extern void	uvar_put	PROTO((ulong, int, FOB*));
+extern void	var_put		PROTO((long, int, FOB*));
+extern void	ulong_put	PROTO((ulong, FOB*));
+extern void	var_put_quit	PROTO((FOB*));
+
+extern void	var_get_init	PROTO((FOB*));
+extern long	uvar_get	PROTO((int, FOB*));
+extern long	var_get		PROTO((int, FOB*));
+extern ulong	ulong_get	PROTO((FOB*));
+extern void	var_get_quit	PROTO((FOB*));
+
+extern int	sizeof_uvar	PROTO((ulong, int));
+extern int	sizeof_var	PROTO((long, int));
+
+
+ /********************/
+/* defined in lpc.c */
+extern int	wav2lpc		PROTO((long*, int, int*, int, int*));
+
+ /*********************/
+/* defined in exit.c */
+extern void	perror_exit_s	PROTO((char*));
+extern void	perror_exit_ss	PROTO((char*, char*));
+extern void	perror_exit_sd	PROTO((char*, int));
+extern void	basic_exit	PROTO((int));
+extern void	usage_exit	PROTO((int));
+extern void	usage_exit_s	PROTO((int, char*));
+extern void	usage_exit_sd	PROTO((int, char*, int));
+extern void	usage_exit_ss	PROTO((int, char*, char*));
+extern void	usage_exit_sss	PROTO((int, char*, char*, char*));
+extern void	update_exit	PROTO((int));
+extern void	update_exit_s	PROTO((int, char*));
+extern void	update_exit_sd	PROTO((int, char*, int));
+extern void	exit		PROTO((int));
+
+/***********************/
+/* defined in getopt.c */
+/* These a no longer necessary */
+/* extern void	hs_resetopt	PROTO((void)); */
+/* extern int	hs_getopt		PROTO((int, char**, char*)); */
+
+ /**********************/
+/* defined in array.c */
+extern void	*pmalloc	PROTO((ulong));
+extern long	**long2d	PROTO((ulong, ulong));
+
+ /****************************/
+/* defined in dupfileinfo.c */
+extern int	dupfileinfo	PROTO((char*, char*));

Added: trunk/Libraries/sphinxVAD/include/sp/shorten/shrt_sph.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/shorten/shrt_sph.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/shorten/shrt_sph.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,30 @@
+/***********************************************************************/
+/*    File: shrt_sph.h                                                 */
+/*    Desc: Sphere to Shorten interface header file                    */
+/*    History:                                                         */
+/*        Mar 29, 1993:  Creation                                      */
+/*        May 5, 1994:   Converted function dec's to ANSI              */
+/***********************************************************************/
+
+# define FORMAT_VERSION		1
+# define BUGFIX_RELEASE         "09"
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi)
+#define PROTO(ARGS)	ARGS
+#else
+#define PROTO(ARGS)	()
+#endif
+
+int shorten_set_flag PROTO((char *flag)) ;
+void shorten_reset_flags PROTO((void)) ;
+void shorten_init PROTO((void)) ;
+void shorten_dump_flags PROTO((FILE *fpout)) ;
+int shorten_set_ftype PROTO((char *ftype)) ;
+int shorten_set_channel_count PROTO((int nchannel)) ;
+int shorten_compress PROTO((FOB *fpin, FOB *fpout, char *status)) ;
+int shorten_uncompress PROTO((FOB *fpin, FOB *fpout, char *status)) ;
+
+int ulaw2linear PROTO((unsigned char ulawbyte));
+unsigned char linear2ulaw PROTO((int sample));
+
+

Added: trunk/Libraries/sphinxVAD/include/sp/shpack/shpk_sph.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/shpack/shpk_sph.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/shpack/shpk_sph.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,18 @@
+/***********************************************************************/
+/*    File: shrt_sph.h                                                 */
+/*    Desc: Sphere to Shorten interface header file                    */
+/*    History:                                                         */
+/*        Mar 29, 1993:  Creation                                      */
+/***********************************************************************/
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi)
+#define PROTO(ARGS)	ARGS
+#else
+#define PROTO(ARGS)	()
+#endif
+
+int shortpack_compress PROTO((FOB *fpin, FOB *fpout, char *status)) ;
+int shortpack_uncompress PROTO((FOB *fpin, FOB *fpout, struct header_t *header)) ;
+
+
+

Added: trunk/Libraries/sphinxVAD/include/sp/sp.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/sp.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/sp.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,140 @@
+]/* File: sp.h */
+
+/* Global variables */
+
+extern int sp_verbose;
+
+extern char *std_fields[];
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi) || defined(WIN32)
+#define PROTO(ARGS)	ARGS
+#else
+#define PROTO(ARGS)	()
+#endif
+
+/* User library functions */
+
+/* dif_wavf.c */ int diff_data PROTO((char *, char *, int , FILE *)) ;
+/* dif_wavf.c */ int diff_header PROTO((char *, char *, int *, int *,
+					int *, int , FILE *)) ;
+/* dif_wavf.c */ int diff_waveforms PROTO((char *, char *, char *, char *,
+					   int , FILE *)) ;
+/* dif_wavf.c */ int diff_files PROTO((char *, char *)) ;
+
+/* h_fix.c */    int correct_out_of_date_headers PROTO((SP_FILE *sp));
+
+
+/* nat_bord.c */ char *get_natural_byte_order PROTO((int)) ;
+/* nat_bord.c */ enum SP_sample_byte_fmt get_natural_sbf PROTO((int)) ;
+
+/* sdatamod.c */ int sp_set_data_mode PROTO((SP_FILE *, char *)) ;
+
+/* sp_utils.c */ int sp_add_field PROTO((struct header_t *, char *, int ,
+					 char *)) ;
+/* sp_utils.c */ int sp_change_field PROTO((struct header_t *, char *, int,
+					    char *)) ;
+/* sp_utils.c */ int sp_clear_fields PROTO((register struct header_t *)) ;
+/* sp_utils.c */ int sp_close_header PROTO((register struct header_t *)) ;
+/* sp_utils.c */ int sp_delete_field PROTO((struct header_t *, char *)) ;
+/* sp_utils.c */ int sp_get_data PROTO((struct header_t *, char *, char *,
+					int *)) ;
+/* sp_utils.c */ int sp_get_field PROTO((struct header_t *, char *, int *,
+					 int *)) ;
+/* sp_utils.c */ int sp_get_fieldnames PROTO((struct header_t *, int ,
+					      char **)) ;
+/* sp_utils.c */ int sp_get_nfields PROTO((struct header_t *)) ;
+/* sp_utils.c */ int sp_get_size PROTO((struct header_t *, char *)) ;
+/* sp_utils.c */ int sp_get_type PROTO((struct header_t *, char *)) ;
+/* sp_utils.c */ int sp_is_std PROTO((register char *)) ;
+/* sp_utils.c */ struct header_t *sp_create_header PROTO((void)) ;
+/* sp_utils.c */ struct header_t *sp_open_header PROTO((register FILE *, int,
+							char **)) ;
+/* sp_utils.c */ int sp_copy_header PROTO((SP_FILE *, SP_FILE *)) ;
+/* sp_utils.c */ SP_INTEGER sp_file_header_size PROTO((char *file)) ;
+/* sp_utils.c */ SP_INTEGER sp_header_size PROTO((struct header_t *)) ;
+/* sp_utils.c */ struct header_t *sp_dup_header PROTO((struct header_t *h)) ;
+
+/* spalloc.c */  SP_FILE *sp_alloc_and_init_sphere_t PROTO((void)) ;
+/* spalloc.c */  SPIFR *alloc_SPIFR PROTO((void)) ;
+/* spalloc.c */  CHANNELS *alloc_CHANNELS PROTO((int, int));
+/* spalloc.c */  int free_CHANNELS PROTO((CHANNELS *)) ;
+/* spalloc.c */  int free_SPIFR PROTO((SPIFR *spifr)) ;
+/* spalloc.c */  int free_sphere_t PROTO((SP_FILE *sp)) ;
+
+/* spchksum.c */ SP_CHECKSUM sp_add_checksum PROTO((SP_CHECKSUM,SP_CHECKSUM)) ;
+/* spchksum.c */ SP_CHECKSUM sp_compute_char_checksum PROTO((char *, size_t ));
+/* spchksum.c */ SP_CHECKSUM sp_compute_short_checksum PROTO((short int *, 
+							      size_t , int)) ;
+
+/* spclose.c */  int sp_close PROTO((SP_FILE *)) ;
+
+/* speof.c */    int sp_eof PROTO((SP_FILE *)) ;
+
+/* sperror.c */  int sp_error PROTO((SP_FILE *)) ;
+
+/* sphio.c */    int h_delete_field PROTO((struct header_t *, char *)) ;
+/* sphio.c */    int h_get_field PROTO((struct header_t *, char *, int ,
+					void **)) ;
+/* sphio.c */    int h_set_field PROTO((struct header_t *, char *, int ,
+					void *)) ;
+/* sphio.c */    int sp_h_delete_field PROTO((SP_FILE *, char *)) ;
+/* sphio.c */    int sp_h_get_field PROTO((SP_FILE *, char *, int , void **)) ;
+/* sphio.c */    int sp_h_set_field PROTO((SP_FILE *, char *, int , void *)) ;
+
+/* spopen.c */   SP_FILE *sp_open PROTO((char *, char *)) ;
+/* spopen.c */   void sp_file_dump PROTO((SP_FILE *sp, FILE *fp)) ;
+/* spopen.c */   void spifr_dump PROTO((SPIFR *spifr, FILE *fp));
+/* spopen.c */   int sp_set_default_operations PROTO((SP_FILE *sp));
+/* spopen.c */   int parse_sample_byte_format PROTO((char *str, 
+					       enum SP_sample_byte_fmt *sbf));
+/* spopen.c */   int parse_sample_coding PROTO((char *str, int sample_n_bytes,
+		        enum SP_sample_encoding *sample_encoding,
+			enum SP_waveform_comp *wav_compress));
+
+/* spoutput.c */ int sp_format_lines PROTO((struct header_t *,
+					    register FILE *)) ;
+/* spoutput.c */ int sp_fpcopy PROTO((register FILE *, register FILE *)) ;
+/* spoutput.c */ int sp_overwrite_header PROTO((char *, char *, int )) ;
+/* spoutput.c */ int sp_print_lines PROTO((struct header_t *, 
+					   register FILE *)) ;
+/* spoutput.c */ int sp_write_header PROTO((register FILE *, struct header_t *,
+					    SP_INTEGER *, SP_INTEGER *)) ;
+
+/* spread.c */   int sp_mc_read_data PROTO((void *, size_t num_, SP_FILE *)) ;
+
+/* sprstat.c */  int sp_get_return_type PROTO((void));
+/* sprstat.c */  int sp_get_return_status PROTO((void)) ;
+/* sprstat.c */  int sp_print_return_status PROTO((FILE *)) ;
+
+/* sptemp.c */   char * sptemp PROTO((char *)) ;
+/* sptemp.c */   char * sptemp_dirfile PROTO((void)) ;
+
+/* sputils2.c */ char *enum_str_SP_data_format PROTO((enum SP_data_format )) ;
+/* sputils2.c */ char *enum_str_SP_file_open_mode PROTO((
+					       enum SP_file_open_mode )) ;
+/* sputils2.c */ char *enum_str_SP_sample_byte_fmt PROTO((
+					       enum SP_sample_byte_fmt )) ;
+/* sputils2.c */ char *enum_str_SP_sample_encoding PROTO((
+					       enum SP_sample_encoding )) ;
+/* sputils2.c */ char *enum_str_SP_waveform_comp PROTO((
+					       enum SP_waveform_comp )) ;
+/* sputils2.c */ char *header_str_SP_sample_byte_fmt PROTO((
+					       enum SP_sample_byte_fmt )) ;
+/* sputils2.c */ int convert_file PROTO((char *, char *, char *, char *)) ;
+/* sputils2.c */ int do_update PROTO((char *, char *, char *)) ;
+/* sputils2.c */ void *sp_data_alloc PROTO((SP_FILE *, int )) ;
+/* sputils2.c */ int sp_data_free PROTO((SP_FILE *, void *)) ;
+/* sputils2.c */ int strdiff PROTO((char *, char *)) ;
+/* sputils2.c */ int strsame PROTO((char *, char *)) ;
+
+/* spwrite.c */  int sp_mc_write_data PROTO((void *, size_t, SP_FILE *)) ;
+
+/* verbose.c */  void sp_set_verbose PROTO((int )) ;
+
+/* sp/shpacki2.c*/ int shortpack_uncompress PROTO((FOB *, FOB *,
+						   struct header_t *));
+
+/* sp/spvers.c */ char *sp_get_version PROTO((void));
+
+/* sp/wavedit.c*/ int wav_edit(int, char **,char *, char *);
+

Added: trunk/Libraries/sphinxVAD/include/sp/spchksum.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/spchksum.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/spchksum.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,8 @@
+
+/*
+ *  spchksum.h
+ *  Define a SPHERE checksum
+ */
+
+
+typedef unsigned short SP_CHECKSUM;

Added: trunk/Libraries/sphinxVAD/include/sp/spfile.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/spfile.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/spfile.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,96 @@
+/*   File: spfile.h
+     Created: 05/06/93
+  */
+
+# define the data declaration types used in the SPHERE functions
+typedef long   SP_INTEGER;
+typedef double SP_REAL;
+typedef char * SP_STRING;
+
+
+enum SP_file_open_mode  { SP_mode_null=100, SP_mode_read, SP_mode_write, 
+			      SP_mode_update };
+enum SP_sample_byte_fmt { SP_sbf_null=200, SP_sbf_01, SP_sbf_10, SP_sbf_1,
+			      SP_sbf_0123, SP_sbf_1032, SP_sbf_2301, SP_sbf_3210, 
+			      SP_sbf_N, SP_sbf_orig};
+enum SP_sample_encoding { SP_se_null=300, SP_se_pcm2, SP_se_pcm1,
+			      SP_se_ulaw, SP_se_raw};
+enum SP_waveform_comp   { SP_wc_null=400, SP_wc_shorten, SP_wc_wavpack,
+			      SP_wc_shortpack, SP_wc_none };
+enum SP_data_format     { SP_df_null=500, SP_df_raw, SP_df_array };
+
+typedef struct waveform_t {
+    FILE *sp_fp;
+    FOB *sp_fob;
+    int samples_read;
+    int samples_written;
+    SP_CHECKSUM checksum;
+    long header_data_size;
+    int read_premature_eof;
+    int failed_checksum;
+    int file_data_buffer_len;
+    void *file_data_buffer;
+    int converted_buffer_len;
+    void *converted_buffer;
+    int interleave_buffer_len;
+    void *interleave_buffer;
+} SPWAVEFORM;
+
+typedef struct origination_channel{
+    int num_origin;
+    int *orig_channel;
+} ORIGINATION_CHAN;
+
+typedef struct channel_struct {
+    SP_INTEGER num_chan;
+    SP_INTEGER max_num_chan;
+    SP_INTEGER max_chan_add;
+    ORIGINATION_CHAN *ochan;
+} CHANNELS;
+
+typedef struct spfile_status_t {
+    char *external_filename;
+    struct header_t *file_header;
+    int extra_checksum_verify;
+    int is_disk_file;
+    int is_temp_file;
+    char *temp_filename;
+
+    int user_channel_count, file_channel_count;
+    int user_sample_count, file_sample_count;
+    int user_sample_rate, file_sample_rate;
+    int user_sample_n_bytes, file_sample_n_bytes;
+    SP_CHECKSUM file_checksum;
+    int ignore_checksum;
+
+    enum SP_sample_encoding    user_encoding, file_encoding;
+    enum SP_waveform_comp      user_compress, file_compress;
+    enum SP_sample_byte_fmt    user_sbf, file_sbf;
+    enum SP_sample_byte_fmt    natural_sbf;
+    enum SP_data_format        user_data_fmt;
+
+    CHANNELS *channels;
+
+    int write_occured_flag;
+    int read_occured_flag;
+    int field_set_occured_flag;
+    int set_data_mode_occured_flag;
+} SPSTATUS;
+
+typedef struct sphere_internal_file_rep_t {
+    struct header_t *header;
+    struct waveform_t *waveform;
+    struct spfile_status_t *status;
+} SPIFR;
+
+typedef struct sphere_t {
+    enum SP_file_open_mode open_mode;
+    SPIFR *read_spifr;
+    SPIFR *write_spifr;
+} SP_FILE;
+
+#define SPNULL		((SP_FILE *) NULL)
+#define SPIFRNULL	((SPIFR *) NULL)
+#define CHANNELSNULL	((CHANNELS *)NULL)
+#define TRANSLATION_LEN 1024
+

Added: trunk/Libraries/sphinxVAD/include/sp/sphere.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/sphere.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/sphere.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,55 @@
+/*  File: sphere.c
+ *
+ *  Description:
+ *  This is the main sphere include file.  It should be included in any modules 
+ *  that use the sphere libraries.
+ *
+ *  Revision History:
+ *     - Created: November 1993
+ *
+ *     - May 5, 1994: Added the redefinition for the sp_read_data and 
+ *       sp_write_data so as to properly handle old function argument syntax
+ */
+
+#define MTRF_ON
+#include <util/utillib.h>
+
+#include <sp/header.h>
+#include <sp/sysparam.h>
+#include <sp/spchksum.h>
+#include <sp/spfile.h>
+#include <sp/sysfunc.h>
+#include <sp/sp.h>
+
+#include <sp/shorten/shrt_sph.h>
+#include <sp/wavpack/wavpack.h>
+#include <sp/version.h>
+
+/**************************************************************/
+/**** Uncomment this line if you'd like to use the pre_2.2 ****/
+/**** argument lists for sp_read_data and sp_write_data    ****/
+/* #define SPHERE_PRE_2_2 */
+
+/********************************************************************/
+/****  IF you intend to define SPHERE_PRE_2_2, so that all you   ****/
+/****  existing applications can use the old SPHERE sp_read_data ****/
+/****  and sp_write_data function calls, DO SO ABOVE THIS POINT! ****/
+#ifdef SPHERE_LIBRARY_CODE
+#ifdef SPHERE_PRE_2_2
+#undef SPHERE_PRE_2_2
+#endif
+#endif
+
+/*  If the source file uses the PRE SPHERE 2.2 syntax, redefine the */
+/*  data functions to only have 3 arguments.                        */
+#ifdef SPHERE_PRE_2_2
+#define sp_read_data(_b,_snb,_ns,_sp) sp_mc_read_data(_b,_ns,_sp)
+#define sp_write_data(_b,_snb,_ns,_sp) sp_mc_write_data(_b,_ns,_sp)
+#else
+#define sp_read_data(_b,_ns,_sp) sp_mc_read_data(_b,_ns,_sp)
+#define sp_write_data(_b,_ns,_sp) sp_mc_write_data(_b,_ns,_sp)
+#endif
+
+/*** define the output filepointer for all diagnostic messages from the ***/
+/*** library                                                            ***/
+#define spfp stderr

Added: trunk/Libraries/sphinxVAD/include/sp/spmacros.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/spmacros.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/spmacros.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,7 @@
+/*
+ *
+ *  file: spmacros.h
+ *
+ *  Define some commonly used macros for data reading.
+ *
+ */

Added: trunk/Libraries/sphinxVAD/include/sp/sysfunc.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/sysfunc.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/sysfunc.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,41 @@
+/* File: sysfunct.h */
+
+
+#ifndef __STDC__
+/* C Library functions */
+ 
+extern char     *index(), *rindex();
+extern double   atof();
+extern long     atol(), ftell();
+extern int      atoi();
+#else
+#include <stdlib.h>
+#endif
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi) || defined(WIN32)
+#define PROTO(ARGS)	ARGS
+#else
+#define PROTO(ARGS)	()
+#endif
+
+/* Support library functions */
+
+/* spinput */    int spx_read_header PROTO((FILE *, int *, int, char **)) ;
+/* spinput */    struct field_t **spx_get_field_vector PROTO((int)) ;
+/* spinput */    struct field_t *spx_allocate_field PROTO((int, char *,
+							  char *v, int )) ;
+/* spinput */    struct field_t *spx_allocate_field_str PROTO((int, char *, 
+							  char *value, int )) ;
+/* spinput */    struct header_t *spx_allocate_header PROTO((int, 
+							  struct field_t **)) ;
+
+/* spinput.c */  int spx_copy_field_vector PROTO((struct field_t **, struct field_t **, int )) ;
+/* spinput.c */  int spx_deallocate_field PROTO((struct field_t *)) ;
+/* spinput.c */  int spx_deallocate_header PROTO((struct header_t *)) ;
+/* spinput.c */  int spx_read_header PROTO((FILE *, int *, int, char **)) ;
+/* spoutput.c */ int spx_tp PROTO((int )) ;
+/* spoutput.c */ int spx_write_header PROTO((struct header_t *, 
+       struct fileheader_fixed *, FILE *, int , SP_INTEGER *, SP_INTEGER *)) ;
+
+
+

Added: trunk/Libraries/sphinxVAD/include/sp/sysparam.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/sysparam.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/sysparam.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,39 @@
+/* File: sysparams.h */
+
+#define FUNCTION
+
+#define LINESIZE		16384
+#define MAX_INTERNAL_WAVFORM    300000
+
+#define NISTLABEL		"NIST_1A"
+#define ENDSTR			"end_head"
+#define HDR_ID_SIZE		8
+#define HDR_SIZE_SIZE		8
+#define PAD_NEWLINES		24
+#define PAD_CHAR		' '
+#define PAD_MULT		1024
+
+#define TMPEXT			"-"
+#define TEMP_DIR		"/tmp"
+#define TEMP_BASE_NAME		"spt"
+
+
+#define SAMPLE_CODING_FIELD	"sample_coding"
+#define SAMPLE_COUNT_FIELD	"sample_count"
+#define SAMPLE_RATE_FIELD	"sample_rate"
+#define SAMPLE_CHECKSUM_FIELD	"sample_checksum"
+#define SAMPLE_SIG_BITS_FIELD	"sample_sig_bits"
+#define SAMPLE_BF_FIELD		"sample_byte_format"
+#define SAMPLE_N_BYTES_FIELD	"sample_n_bytes"
+#define CHANNEL_COUNT_FIELD	"channel_count"
+
+#define READMODE "r"
+#define UPDATEMODE "r+"
+#define WRITEMODE "w"
+#define TRUNCATE_UPDATEMODE "w+"
+
+struct fileheader_fixed {
+	char header_id[HDR_ID_SIZE];
+	char header_size[HDR_SIZE_SIZE];
+};
+

Added: trunk/Libraries/sphinxVAD/include/sp/ulaw.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/ulaw.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/ulaw.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,62 @@
+/* This statically defined lookup table was computed by Bill Fisher */
+
+ /* table of linear values for codec bytes: */
+  static short int ulaw2linear_10_sbf_lut[256] = {-32124, -31100, -30076, -29052, 
+    -28028, -27004, -25980, -24956, -23932, -22908, -21884, -20860, 
+    -19836, -18812, -17788, -16764, -15996, -15484, -14972, -14460, 
+    -13948, -13436, -12924, -12412, -11900, -11388, -10876, -10364, 
+    -9852, -9340, -8828, -8316, -7932, -7676, -7420, -7164, -6908, 
+    -6652, -6396, -6140, -5884, -5628, -5372, -5116, -4860, -4604, 
+    -4348, -4092, -3900, -3772, -3644, -3516, -3388, -3260, -3132, 
+    -3004, -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, 
+    -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, -1372, 
+    -1308, -1244, -1180, -1116, -1052, -988, -924, -876, -844, -812, 
+    -780, -748, -716, -684, -652, -620, -588, -556, -524, -492, -460, 
+    -428, -396, -372, -356, -340, -324, -308, -292, -276, -260, -244, 
+    -228, -212, -196, -180, -164, -148, -132, -120, -112, -104, -96, 
+    -88, -80, -72, -64, -56, -48, -40, -32, -24, -16, -8, 0, 32124, 
+    31100, 30076, 29052, 28028, 27004, 25980, 24956, 23932, 22908, 
+    21884, 20860, 19836, 18812, 17788, 16764, 15996, 15484, 14972, 
+    14460, 13948, 13436, 12924, 12412, 11900, 11388, 10876, 10364, 
+    9852, 9340, 8828, 8316, 7932, 7676, 7420, 7164, 6908, 6652, 6396, 
+    6140, 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, 3900, 3772, 
+    3644, 3516, 3388, 3260, 3132, 3004, 2876, 2748, 2620, 2492, 2364, 
+    2236, 2108, 1980, 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, 
+    1372, 1308, 1244, 1180, 1116, 1052, 988, 924, 876, 844, 812, 
+    780, 748, 716, 684, 652, 620, 588, 556, 524, 492, 460, 428, 396, 
+    372, 356, 340, 324, 308, 292, 276, 260, 244, 228, 212, 196, 180, 
+    164, 148, 132, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 
+    32, 24, 16, 8, 0};
+
+
+/* This statically defined lookup table was computed by Bill Fisher */
+/* and byte swapped by Jon Fiscus                                   */
+
+  static short int ulaw2linear_01_sbf_lut[256] = { -31614, -31610,
+        -31606, -31602, -31598, -31594, -31590, -31586, -31582, -31578,
+        -31574, -31570, -31566, -31562, -31558, -31554, -31551, -31549,
+        -31547, -31545, -31543, -31541, -31539, -31537, -31535, -31533,
+        -31531, -31529, -31527, -31525, -31523, -31521, 1249, 1250, 1251,
+        1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262,
+        1263, 1264, -15120, 17649, -15119, 17650, -15118, 17651, -15117,
+        17652, -15116, 17653, -15115, 17654, -15114, 17655, -15113, 17656,
+        -23304, -6920, 9465, 25849, -23303, -6919, 9466, 25850, -23302, -6918,
+        9467, 25851, -23301, -6917, 9468, 25852, -27396, -19204, -11012,
+        -2820, 5373, 13565, 21757, 29949, -27395, -19203, -11011, -2819, 5374,
+        13566, 21758, 29950, -29442, -25346, -21250, -17154, -13058, -8962,
+        -4866, -770, 3327, 7423, 11519, 15615, 19711, 23807, 27903, 31999,
+        -30465, -28417, -26369, -24321, -22273, -20225, -18177, -16129,
+        -14081, -12033, -9985, -7937, -5889, -3841, -1793, 0, 31869, 31865,
+        31861, 31857, 31853, 31849, 31845, 31841, 31837, 31833, 31829, 31825,
+        31821, 31817, 31813, 31809, 31806, 31804, 31802, 31800, 31798, 31796,
+        31794, 31792, 31790, 31788, 31786, 31784, 31782, 31780, 31778, 31776,
+        -994, -995, -996, -997, -998, -999, -1000, -1001, -1002, -1003, -1004,
+        -1005, -1006, -1007, -1008, -1009, 15375, -17394, 15374, -17395,
+        15373, -17396, 15372, -17397, 15371, -17398, 15370, -17399, 15369,
+        -17400, 15368, -17401, 23559, 7175, -9210, -25594, 23558, 7174, -9211,
+        -25595, 23557, 7173, -9212, -25596, 23556, 7172, -9213, -25597, 27651,
+        19459, 11267, 3075, -5118, -13310, -21502, -29694, 27650, 19458,
+        11266, 3074, -5119, -13311, -21503, -29695, 29697, 25601, 21505,
+        17409, 13313, 9217, 5121, 1025, -3072, -7168, -11264, -15360, -19456,
+        -23552, -27648, -31744, 30720, 28672, 26624, 24576, 22528, 20480,
+        18432, 16384, 14336, 12288, 10240, 8192, 6144, 4096, 2048, 0 } ;

Added: trunk/Libraries/sphinxVAD/include/sp/version.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/version.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/version.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,10 @@
+/* File: version.h */
+
+#define SPHERE_VERSION_STR "V2.5"
+
+#ifdef SPHERE_DECLARE_VERSION
+char *sp_version_str = "SPHERE Lib " SPHERE_VERSION_STR;
+#else
+extern char *sp_version_str;
+#endif
+

Added: trunk/Libraries/sphinxVAD/include/sp/wavpack/wavpack.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/sp/wavpack/wavpack.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/sp/wavpack/wavpack.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,34 @@
+#define WAVPACK_MAGIC	"wavpack1.0"
+
+#define RUNL 256		/* max run length <=256 */
+				/* compression format flags */
+#define BYTE 0			/* 8 bit data format */
+#define SHORT 0x20		/* 16 bit data format (else 8 bit) */
+#define REV 0x10		/* byte reversed (SHORT only) */
+#define OFFSET 0x8		/* 1 byte data offset */
+#define DIFF 0x4		/* differential pcm */
+#define STEREO 0x2		/* 2 channel */
+#define CHAN1 0x1		/* channel nr (0 or 1) */
+
+#define WAV 1			/* modes */
+#define UNWAV 2
+#define WCAT 3
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi)
+#define PROTO(ARGS)	ARGS
+#else
+#define PROTO(ARGS)	()
+#endif
+
+void wavpack_set_monoflg PROTO((int val));
+int wavpack_get_monoflg PROTO((void));
+void wavpack_set_byteflg PROTO((int val));
+int wavpack_get_byteflg PROTO((void));
+int wavpack_set_vflg PROTO((int value));
+int wavpack_set_oname PROTO((char *s));
+void wavpack_set_oflg PROTO((int value));
+int wavpack_set_progname PROTO((char *s));
+int wavpack_free_progname PROTO((void));
+void wavpack_dump_interface PROTO((FILE *fp));
+int wavpack_pack PROTO((FOB *ifile, FOB *ofile));
+int wavpack_unpack PROTO((FOB *ifile, FOB *ofile));

Added: trunk/Libraries/sphinxVAD/include/util/cfg.h
===================================================================
--- trunk/Libraries/sphinxVAD/include/util/cfg.h	                        (rev 0)
+++ trunk/Libraries/sphinxVAD/include/util/cfg.h	2007-09-12 19:24:17 UTC (rev 2035)
@@ -0,0 +1,149 @@
+/**********************************************************************/
+/*  File: cfg.h                                                       */
+/*  Desc: The include file for definition of the configuration        */
+/*        structure.                                                  */
+/*  Date: Sept, 1990                                                  */
+/**********************************************************************/
+#define CFG_H_VERSION "V1.0"
+
+#define NOT_CONFIG_ID	(-1)
+
+/* filename definitions */
+#define CFG_ROOT	"ROOT_DIR"
+#define CFG_CODESET	"CODESET"
+#define CFG_LEX		"LEX"
+#define CFG_HOMO	"HOMO"
+#define CFG_REF		"REF"
+#define CFG_SPLTMRG	"SPLTMRG"
+#define CFG_MONO	"MONOSYL"
+#define CFG_LSUBS	"LSUBS"
+#define CFG_ALP_NUM	"ALP_NUM"
+#define CFG_FILE	"CFG"
+
+/* print filetype defintions */
+#define CFG_SHLEX	"SHLEX"
+#define CFG_SHLSUBS	"SHLSUBS"
+#define CFG_SHCODESET	"SHCODE"
+#define CFG_SHHOMO	"SHHOMO"
+#define CFG_SHALP_NUM	"SHALPHA"
+#define CFG_SHMONO	"SHMONO"
+#define CFG_SHSPLT_MRG	"SHSPLT_MRG"
+
+/* alignment program definitions */
+#define CFG_HOMO_ERROR	"HOMO_ERROR"
+#define CFG_STR_SIL	"SILENCE"
+#define CFG_NO_GR	"NO_GR"
+#define CFG_ATIS_FILES	"ATIS"
+#define CFG_ATIS3_FILES	"ATIS3"
+#define CFG_RM_FILES	"RM"
+#define CFG_WSJ_FILES	"WSJ"
+#define CFG_SWB_FILES	"SWB"
+#define CFG_TIMIT_FILES	"TIMIT"
+#define CFG_NTYPE_FILES	"NOTYPE"
+#define CFG_SPUID_FILES	"SPU_ID"
+#define CFG_NO_ID_FILES	"NO_ID"
+#define CFG_USE_PHONE 	"PHONE"
+#define CFG_PHDIST_FILE	"DIST_TBL"
+#define CFG_OUT_FILE	"OUTFILE"
+#define CFG_SYS_NAME	"NAME"
+#define CFG_SYS_DESC	"DESC"
+#define CFG_ONE_TO_ONE	"ONE2ONE"
+#define CFG_ONE_TO_MANY	"ONE2MANY"
+#define CFG_SM_RESCORE  "SM"
+#define CFG_SM_FOM      "SM_FOM"
+#define CFG_FRAG_RESCORE "FRAG"
+
+/* statistics program defintions */
+
+#define CFG_TESTNAME	"TEST_NAME"
+#define CFG_LPR		"LP"
+#define CFG_HDR		"HDR"
+#define CFG_MTCHPR	"MTCH_PR"
+#define CFG_SENT_MCN	"SENT_MCN"
+#define CFG_COUNT	"DUMP_COUNT"
+#define CFG_LONG_SEG	"SEG_LONG"
+#define CFG_AVE_SEG	"SEG_AVE"
+#define CFG_ANOVAR	"ANOVAR"
+#define CFG_SIGNTEST    "SIGNTEST"
+#define CFG_WILCOXON    "WILCOXON"
+#define CFG_2_SAMP      "SAMP_Z"
+#define CFG_SIG         "SIG"
+#define CFG_RANGE	"RANGE"
+#define CFG_TROFF	"TROFF"
+#define CFG_MINGOOD	"MIN_GOOD"
+#define CFG_PCT_FORMULA	"PCT_FORM"
+#define CFG_VERBOSE     "V"
+
+
+/* unique scoring defintions */
+#define CFG_OVR_SCR	"OVRALL"
+#define CFG_OVR_RAW	"OVRRAW"
+#define CFG_OVR_DTL	"OVRDTL"
+#define CFG_SPKR_SCR	"SPKR"
+#define CFG_SENT_SCR	"SENT"
+#define CFG_OUT_DIR	"OUT_DIR"
+
+/* general difinitions */
+#define CFG_DUMPARG	"DUMP"
+#define CFG_ALI_FILE	"ALIGN"
+#define CFG_HYP_FILE	"HYP"
+#define CFG_ALL_SENT	"ALL"
+#define CFG_DIFF_SENT	"DIFF"
+#define CFG_DIFF_SCORE	"SDIFF"
+#define CFG_ERRORS	"ERRORS"
+
+#define MAX_CONFIG_REC	40
+#define MAX_CONFIG_LENGTH	160
+#define TOGGLE_ON	1
+#define TOGGLE_OFF	0
+#define TOGGLE_ON_CHR   "on"
+#define TOGGLE_OFF_CHR  "off"
+
+
+#define CFG_TGL	0
+#define CFG_C	1
+#define CFG_C2	2
+#define CFG_STR	3
+
+#define NO_GRP	0
+
+typedef struct config_record_struct{
+    char *intern_id;
+    int num_elem;
+    int value_type;
+    int flag_group;
+    char *value;
+} CONFIG_REC;
+
+typedef struct config_struct{
+    CONFIG_REC rec_list[MAX_CONFIG_REC];
+} CONFIG;
+
+#if defined(__STDC__) || defined(__GNUC__) || defined(sgi) || defined(WIN32)
+#define PROTO(ARGS)	ARGS
+#else
+#define PROTO(ARGS)	()
+#endif
+
+void set_cfg_debug PROTO((int)) ;
+void alloc_CONFIG PROTO((CONFIG *)) ;
+void cfg_get_args PROTO((CONFIG *, int, char **, char *)) ;
+void load_com_line_CONFIG PROTO((CONFIG *cfg, int argc, char **argv, 
+				 int silent)) ;
+void load_CONFIG PROTO((CONFIG *cfg, char *file, int silent)) ;
+void reset_group PROTO((CONFIG *cfg, int cfg_ind)) ;
+char * CONFIG_elem_C PROTO((CONFIG *cfg, char *str)) ;
+int CONFIG_elem_TGL PROTO((CONFIG *cfg, char *str)) ;
+char ** CONFIG_elem_C2 PROTO((CONFIG *cfg, char *str)) ;
+void set_CONFIG_elem_TGL PROTO((CONFIG *cfg, char *str, int value)) ;
+void set_CONFIG_elem_C PROTO((CONFIG *cfg, char *str, char *value)) ;
+void set_CONFIG_elem_STR PROTO((CONFIG *cfg, char *str, char *value)) ;

@@ Diff output truncated at 60000 characters. @@


More information about the Ravenclaw-developers mailing list