Edinburgh Speech Tools  2.1-release
EST_ChannelType.h
Go to the documentation of this file.
1  /************************************************************************/
2  /* */
3  /* Centre for Speech Technology Research */
4  /* University of Edinburgh, UK */
5  /* Copyright (c) 1996,1997 */
6  /* All Rights Reserved. */
7  /* */
8  /* Permission is hereby granted, free of charge, to use and distribute */
9  /* this software and its documentation without restriction, including */
10  /* without limitation the rights to use, copy, modify, merge, publish, */
11  /* distribute, sublicense, and/or sell copies of this work, and to */
12  /* permit persons to whom this work is furnished to do so, subject to */
13  /* the following conditions: */
14  /* 1. The code must retain the above copyright notice, this list of */
15  /* conditions and the following disclaimer. */
16  /* 2. Any modifications must be clearly marked as such. */
17  /* 3. Original authors' names are not deleted. */
18  /* 4. The authors' names are not used to endorse or promote products */
19  /* derived from this software without specific prior written */
20  /* permission. */
21  /* */
22  /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23  /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24  /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25  /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26  /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27  /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28  /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29  /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
30  /* THIS SOFTWARE. */
31  /* */
32  /************************************************************************/
33 
34 #ifndef __EST_CHANNELTYPE_H__
35 #define __EST_CHANNELTYPE_H__
36 
37 /**@name Channel Types
38  */
39 //@{
40 
41 /** Symbolic names for coefficient types.
42  *
43  * Used to record what kinds of information are in a track and
44  * anywhere else we need to refer to coefficient types.
45  *
46  * @see EST_ChannelType
47  */
48 
50 {
51  /// Linear prediction filter
53  /// guaranteed to be the first known type
55  /// reflection coefficients.
57  /// Cepstral coefficients
59  /// Mel Scale Cepstrum
61  /// Mel Scale filter bank
63  /// Line spectral pairs.
65  /// Tube areas for filter.
67  /// Unknown filter type.
69  /// Free for experimentation
71  /// Free for experimentation
73  /// Guaranteed to be one more than last legal coefficient type
75 };
76 
77 /**@name Channel Type Numbering Scheme
78  *
79  * Channel types are given numbers containing the following information:
80  * \begin{itemize}
81  * \item A numeric index.
82  * \item A Number of differentiations 0-2
83  * \item 0 for start, 1 for end
84  * \end{itemize}
85  * Things which do not require all these features are packed in according
86  * to the following rules:
87  * \begin{itemize}
88  * \item Single values which can be differentiated are paired as
89  * if they were start and end positions of an unknown type
90  * of coefficient.
91  * \item Single values which can't be differentiated are put in the
92  * positions where the 3rd derivatives would logically be
93  * found.
94  * \end{itemize}
95  */
96 //@{
97 
98 /// extract the coefficient type
99 #define EST_ChannelTypeCT(T) ( (T) >> 3 )
100 /// extract the number of differentiations
101 #define EST_ChannelTypeD(T) ( (T) >> 1 & 3 )
102 /// extract the start/end flag.
103 #define EST_ChannelTypeSE(T) ( (T) & 1 )
104 
105 /// get start from end
106 #define EST_ChannelTypeStart(T) EST_CoefChannelId(\
107  EST_ChannelTypeCT(T), \
108  EST_ChannelTypeD(T), \
109  0)
110 /// get end from start
111 #define EST_ChannelTypeEnd(T) EST_CoefChannelId(\
112  EST_ChannelTypeCT(T), \
113  EST_ChannelTypeD(T), \
114  1)
115 /// differentiate once
116 #define EST_ChannelTypeIncD(T) EST_CoefChannelId(\
117  EST_ChannelTypeCT(T), \
118  EST_ChannelTypeD(T)+1, \
119  EST_ChannelTypeSE(T))
120 /// differentiate N times
121 #define EST_ChannelTypeDelta(T, N) EST_CoefChannelId(\
122  EST_ChannelTypeCT(T), \
123  EST_ChannelTypeD(T)+(N), \
124  EST_ChannelTypeSE(T))
125 /// integrate once
126 #define EST_ChannelTypeDecD(T) EST_CoefChannelId(\
127  EST_ChannelTypeCT(T), \
128  EST_ChannelTypeD(T)-1, \
129  EST_ChannelTypeSE(T))
130 
131 
132 /** Build a number representing a channel type for a coefficient type.
133  *
134  * CT = coefficient type
135  * D = Number of levels of differentiation.
136  * SE = Start=0 end=1
137  */
138 #define EST_CoefChannelId(CT,D,SE) ( (CT)<<3 | ((D)<<1 & 6) | ((SE)&1) )
139 
140 /** Build a number representing a channel type for a single value which can
141  * N = count starting from 0
142  * D = Number of levels of differentiation.
143  * be differentiated.
144  */
145 
146 #define EST_DiffChannelId(N,D) ( EST_CoefChannelId(((N)>>1)+(int)cot_free, D, (N)&1) )
147 
148 /** Build a number representing a channel type for a simple value
149  * such as length or voicing probability.
150  */
151 
152 #define EST_ChannelId(N) EST_CoefChannelId((N)>>1, 3, (N)&1)
153 //@}
154 
155 
156 /** Symbolic names for track channels.
157  * Used in track maps to label channels so they can be accessed without
158  * knowing exactly where in the track they are.
159  *
160  * @see EST_CoefficientType
161  * @see EST_TrackMap
162  * @see EST_Track
163  * @see EST_TrackMap:example
164  * @author Richard Caley <rjc@cstr.ed.ac.uk>
165  * @version $Id: EST_ChannelType.h,v 1.4 2009/07/03 17:13:56 awb Exp $
166  */
167 
169  /// Value to return for errors, never occurs in TrackMaps
171  /// order of analysis.
173  /// So we know how many there are
175  /// Peak amplitude.
177  /// Duration of section of signal.
179  /// Length of section in samples.
181  /// Offset from frame center to center of window
183  /// Voicing decision.
185  /// Number of related frame in another track.
187  /// Time in seconds this frame refers to.
189 
190  /// RMS power of section of signal.
194  /// RMS energy of section of signal.
198  /// F0 in Hz.
202 
209 
216 
217 
224 
225 
232 
239 
240 
247 
248 
255 
256 
263 
264 
271 
272 
279 
280 
281 
283  /// Can be used to size arrays etc.
285 };
286 //@}
288 
289 #endif
#define EST_DiffChannelId(N, D)
Line spectral pairs.
#define EST_CoefChannelId(CT, D, SE)
RMS power of section of signal.
Time in seconds this frame refers to.
EST_CoefficientType
EST_ChannelType
So we know how many there are.
reflection coefficients.
Duration of section of signal.
Mel Scale Cepstrum.
Can be used to size arrays etc.
Voicing decision.
Free for experimentation.
Tube areas for filter.
Peak amplitude.
guaranteed to be the first known type
Number of related frame in another track.
Mel Scale filter bank.
Length of section in samples.
#define EST_ChannelId(N)
RMS energy of section of signal.
Linear prediction filter.
Offset from frame center to center of window.
order of analysis.
Unknown filter type.
F0 in Hz.
Free for experimentation.
Value to return for errors, never occurs in TrackMaps.
Guaranteed to be one more than last legal coefficient type.
Cepstral coefficients.