42#include "sigpr/EST_sigpr_utt.h"
43#include "EST_cmd_line_options.h"
44#include "ling_class/EST_relation_aux.h"
45#include "EST_string_aux.h"
47#define SIL_NAMES "sil !ENTER !EXIT"
48#define EVENT_NAMES "a rb arb m mrb"
114 EST_String(
"[input f0 file] -e [input event label file] -o [output file]"
116 "Summary: produce rfc file from events and f0 contour\n"
117 "use \"-\" to make input and output files stdin/out\n"
118 "-h Options help\n\n"+
119 options_track_input()+
"\n"
120 "-event_names <string> List of labels to be classed as events. \n"
121 " Lists are specified as quoted strings with spaces \n"
122 " separating each item, e.g.: \"a b c d\"\n\n"
123 "-sil_names <string> List of labels to be classed as silence \n"
124 " Lists are specified as quoted strings with spaces \n"
125 " separating each item, e.g.: \"pau sil #\"\n\n"
126 "-e <ifile> Input event label file. This file contains \n"
127 " the list of events to be parameterized, each with its approximate \n"
128 " start and stop time marked. This file also contains silencesn \n"
129 " which are used to decide where to insert and stop phrases \n\n"
130 "-o <ofile> Output label file\n\n"
131 "-otype <string> File type of output file \n\n"
132 "-limit <float> start and stop limit in seconds. The rfc \n"
133 " matching algorithm defines a search region within which it tries \n"
134 " all possible rise and fall shapes. This option specifies how much \n"
135 " before the input label start time and how much after the input \n"
136 " label end time the search region should be. Typical value, 0.1 \n\n"
137 "-range <float> Range of RFC search region. In addition to \n"
138 " the limit, the range defines the limits of the rfc matching \n"
139 " search region as a percentage of the overall input label \n"
140 " duration. Typical value, 0.25 (the search region is the first and \n"
141 " last 25% of the label) \n\n"
142 "-smooth Smooth and Interpolate input F0 contour. \n"
143 " rfc matching can only operate on smooth fully interpolated \n"
144 " contours. This option must be used if the contour hasn't already \n"
145 " been smoothed and interpolated\n\n"
146 "-w1 <float> length in seconds of smoothing window prior\n"
147 " to interpolation. Default value 0.05 \n\n"
148 "-w2 <float> length in seconds of smoothing window after\n"
149 " to interpolation. Default value 0.05 \n\n"
150 "-sf0 <ofile> Save f0 contour that results from smoothing \n"
151 "-rfc Save as RFC parameters instead of tilt\n\n",
154 default_rfc_params(
rfc_op);
163 nfz.copy_sub_track(
fz, 0, EST_ALL, 0, 1);
165 if (
ev.load(
al.val(
"-e")) != format_ok)
168 pstring = (
al.present(
"-event_names") ?
al.val(
"-event_names"):
174 pstring = (
al.present(
"-sil_names") ?
al.val(
"-sil_names"):
179 if (
al.present(
"-smooth"))
189 if (
al.present(
"-sf0"))
190 fz.save(
al.val(
"-sf0"));
192 ev.f.set(
"name",
"intevents");
193 ev.f.set(
"timing_style",
"segment");
201 if (!
al.present(
"-rfc"))
204 ev.remove_item_feature(
"rfc");
305 if (
al.present(
"-limit"))
307 rfc.set(
"start_limit",
al.fval(
"-limit"));
308 rfc.set(
"stop_limit",
al.fval(
"-limit", 0));
310 if (
al.present(
"-range"))
311 rfc.set(
"range",
al.fval(
"-range"));
312 if (
al.present(
"-min_dur"))
313 rfc.set(
"min_event_duration",
al.fval(
"-min_dur"));
320 op.
set(
"window_length",0.05);
321 op.
set(
"second_length",0.05);
322 option_override(op,
al,
"window_length",
"-w1");
323 option_override(op,
al,
"second_length",
"-w2");
void set(const EST_String &name, int ival)