1 /*
2  * This software has been licensed to the Centre of Speech Technology, KTH
3  * by AT&T Corp. and Microsoft Corp. with the terms in the accompanying
4  * file BSD.txt, which is a BSD style license.
5  *
6  *    "Copyright (c) 1987-1990  AT&T, Inc.
7  *    "Copyright (c) 1986-1990  Entropic Speech, Inc.
8  *    "Copyright (c) 1990-1991  Entropic Research Laboratory, Inc.
9  *                   All rights reserved"
10  */
11 
12  /* this is an older version of the waves tracks.h needed for this version
13     of formant
14  */
15 
16 
17 
18 #define DEB_PAUSE	8	/* debug levels */
19 #define DEB_LPC_PARS	4
20 #define DEB_PARAMS	2
21 #define DEB_ENTRY	1
22 #ifndef TRUE
23 #define TRUE 1
24 #endif
25 #ifndef FALSE
26 #define FALSE 0
27 #endif
28 #define PI 3.1415927
29 #define MAXFORMANTS 7
30 
31 /* structure definitions for the pitch tracker */
32 #define CROSS  struct cross_rec
33 struct cross_rec { /* for storing the crosscorrelation information */
34 	double	rms;	/* rms energy in the reference window */
35 	double	k1;	/* 1st-order autoregressive flattening constant. */
36 	double	maxval;	/* max in the crosscorr. fun. q15 */
37 	short	maxloc; /* lag # at which max occured	*/
38 	short	nlags;	/* the number of correlation lags computed */
39 	short	firstlag; /* the first non-zero lag computed */
40 	short	*correl; /* the normalized corsscor. fun. q15 */
41 };
42 
43 #define DPREC struct dp_rec
44 struct dp_rec { /* for storing the DP information */
45 	short	ncands;	/* # of candidate pitch intervals in the frame */
46 	short	*locs; /* locations of the candidates */
47 	short	*pvals; /* peak values of the candidates */
48 	double	*mpvals; /* modified peak values of the candidates */
49 	short	*prept; /* pointers to best previous cands. */
50 	double	*dpvals; /* cumulative error for each candidate */
51 };
52 /* end of structure definitions for the pitch tracker */
53 
54 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
55 /* Structure definitions for the formant tracker.. */
56 
57 typedef struct form_latt { /* structure of a DP lattice node for formant tracking */
58 	short ncand; /* # of candidate mappings for this frame */
59 	short **cand;      /* pole-to-formant map-candidate array */
60 	short *prept;	 /* backpointer array for each frame */
61 	double *cumerr; 	 /* cum. errors associated with each cand. */
62 } FORM;
63 
64 typedef struct pole_array {   /* structure to hold raw LPC analysis data */
65 	double rms;    /* rms for current LPC analysis frame */
66 	double rms2;    /* rms for current F0 analysis frame */
67 	double f0;     /* fundamental frequency estimate for this frame */
68 	double pv;		/* probability that frame is voiced */
69 	double change; /* spec. distance between current and prev. frames */
70 	short npoles; /* # of complex poles from roots of LPC polynomial */
71 	double *freq;  /* array of complex pole frequencies (Hz) */
72 	double *band;  /* array of complex pole bandwidths (Hz) */
73 } POLE;
74 /* End of structure definitions for the formant tracker. */
75