Edinburgh Speech Tools  2.1-release
EST_tilt.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 */
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 /* Author : Paul Taylor */
34 /* Date : February 1996 */
35 /*-----------------------------------------------------------------------*/
36 /* Intonational Event Include file */
37 /* */
38 /*=======================================================================*/
39 #ifndef __RFC_H__
40 #define __RFC_H__
41 
43 #include "EST_util_class.h"
44 #include "EST_speech_class.h"
45 #include "EST_Event.h"
46 
47 /**@defgroup tiltfunctions Tilt functions
48 
49 Functions for:
50 
51  - Generating RFC and Tilt parameters from F0 contours
52  - Converting RFC to Tilt parameters and vice-versa
53  - Synthesizing F0 contours from RFC and Tilt events
54 
55 */
56 ///@{
57 
58 /** Fill op with sensible default parameters for RFC analysis.
59  */
61 
62 /** Produce a set of RFC parameterized events given approximate event
63  boundaries and a smoothed F0 contour. See \ref ov-rfc-analysis for a description of this process.
64 
65  @param f0: Smoothed continuous F0 contour. An error will occur
66  if any unvoiced regions are detected in the contour. Use the
67  function smooth_pda to smooth and interpolate a normal contour.
68  @param ev_list: list of events, each containing approximate start
69  and end times of the events. On completion each event in this list
70  will have a set of RFC parameters.
71  @param op: parameters used to control analysis process.
72 
73  */
74 void rfc_analysis(EST_Track &fz, EST_Relation &event_list, EST_Features &op);
75 
76 /** \brief Fill op with sensible default parameters for RFC analysis
77  */
78 void tilt_analysis(EST_Track &fz, EST_Relation &event_list, EST_Features &op);
79 
80 /** Fill op with sensible default parameters for RFC analysis
81  */
82 void fill_rise_fall_values(EST_Track &fz, float amp, float start_f0);
83 
84 /** \brief Generate an F0 contour given a list RFC events.
85 
86 @param f0 Generated F0 contour
87 @param ev_list list of events, each containing a set of RFC parameters
88 @param f_shift frame shift in seconds of the generated contour
89 @param no_conn Do not join events with straight lines if set to 1
90 */
91 void rfc_synthesis(EST_Track &f0, EST_Relation &ev_list,
92  float f_shift, int no_conn);
93 
94 /** \brief Generate an F0 contour given a list Tilt events.
95 
96 This function simply calls \ref tilt_to_rfc followed by \ref rfc_synthesis .
97 
98 @param f0 Generated F0 contour
99 @param ev_list list of events, each containing a set of Tilt parameters
100 @param f_shift frame shift in seconds of the generated contour
101 @param no_conn Do not join events with straight lines if set to 1
102 */
103 void tilt_synthesis(EST_Track &track, EST_Relation &ev_list,
104  float f_shift, int no_conn);
105 
106 /** \brief Convert a single set of local tilt parameters to local RFC parameters.
107 
108 @param tilt input tilt parameters, named `amp`, `dur` and `tilt`
109 @param rfc output RFC parameters, name `rise_amp`, `fall_amp`, `rise_dur` and `fall_dur`
110 
111 */
112 void tilt_to_rfc(EST_Features &tilt, EST_Features &rfc);
113 
114 /** \brief Convert a single set of local RFC parameters to local tilt
115 parameters. See \ref ov-rfc-to-tilt for a description of
116 how this is performed.
117 
118 @param rfc input RFC parameters, named ` rise_amp`, `fall_amp`, `rise_dur` and` fall_dur`
119 @param tilt output tilt parameters, named `amp`, `dur` and `tilt` */
120 void rfc_to_tilt(EST_Features &rfc, EST_Features &tilt);
121 
122 /** For each tilt events in `ev_tilt`, produce a set of RFC parameters.
123  The tilt parameters are stored as the following features in the event:
124 
125  - tilt.amp
126  - tilt.dur
127  - tilt.tilt
128 
129  A set of features with the following names are created:
130 
131 
132  - rfc.rise_amp
133  - rfc.rise_dur
134  - rfc.fall_amp
135  - rfc.fall_dur
136 
137  The original tilt features are not deleted.
138 */
139 void tilt_to_rfc(EST_Relation &ev_tilt);
140 
141 /** \brief For each tilt events in `ev_rfc`, produce a set of Tiltparameters.
142  The RFC parameters are stored as the following features in the event:
143 
144  - rfc.rise_amp
145  - rfc.rise_dur
146  - rfc.fall_amp
147  - rfc.fall_dur
148 
149  A set of features with the following names are created:
150 
151  - tilt.amp
152  - tilt.dur
153  - tilt.tilt
154 
155  The original RFC features are not deleted.
156 
157 */
158 void rfc_to_tilt(EST_Relation &ev_rfc);
159 
161 void fill_rfc_types(EST_Relation &ev);
162 
163 ///@}
164 
165 
166 
167 #endif /* RFC */
int validate_rfc_stream(EST_Relation &ev)
void fill_rise_fall_values(EST_Track &fz, float amp, float start_f0)
void rfc_synthesis(EST_Track &f0, EST_Relation &ev_list, float f_shift, int no_conn)
Generate an F0 contour given a list RFC events.
void rfc_analysis(EST_Track &fz, EST_Relation &event_list, EST_Features &op)
void tilt_to_rfc(EST_Features &tilt, EST_Features &rfc)
Convert a single set of local tilt parameters to local RFC parameters.
Definition: tilt_utils.cc:197
void tilt_synthesis(EST_Track &track, EST_Relation &ev_list, float f_shift, int no_conn)
Generate an F0 contour given a list Tilt events.
void tilt_analysis(EST_Track &fz, EST_Relation &event_list, EST_Features &op)
Fill op with sensible default parameters for RFC analysis.
void fill_rfc_types(EST_Relation &ev)
Definition: tilt_utils.cc:237
void rfc_to_tilt(EST_Features &rfc, EST_Features &tilt)
Convert a single set of local RFC parameters to local tilt parameters. See RFC to F0 Synthesis for a ...
Definition: tilt_utils.cc:172
void default_rfc_params(EST_Features &op)