72 int main (
int argc,
char *argv[])
83 EST_String(
"[input file] -o [output file] [options]")+
84 "Summary: pitchmark laryngograph (lx) files\n" 85 "use \"-\" to make input and output files stdin/out\n" 86 "-h Options help\n\n"+
89 "-lx_lf <int> lx low frequency cutoff\n\n" 90 "-lx_lo <int> lx low order\n\n" 91 "-lx_hf <int> lx high frequency cutoff\n\n" 92 "-lx_ho <int> lx high order\n\n" 93 "-df_lf <int> df low frequeny cutoff\n\n" 94 "-df_lo <int> df low order\n\n" 95 "-med_o <int> median smoothing order\n\n" 96 "-mean_o <int> mean smoothing order\n\n" 97 "-inv Invert polarity of lx signal. Often the lx signal \n" 98 " is upside down. This option inverts the signal prior to \n" 100 "-fill Insert and remove pitchmarks according to min, max\n" 101 " and def period values. Often it is desirable to place limits\n" 102 " on the values of the pitchmarks. This option enforces a \n" 103 " minimum and maximum pitch period (specified by -man and -max).\n" 104 " If the maximum pitch setting is low enough, this will \n" 105 " esnure that unvoiced regions have evenly spaced pitchmarks \n\n" 106 "-min <float> Minimum allowed pitch period, in seconds\n\n" 107 "-max <float> Maximum allowed pitch period, in seconds\n\n" 108 "-def <float> Default pitch period in seconds, used for a guide\n" 109 " as to what length pitch periods should be in unvoiced \n" 111 "-pm <ifile> Input is raw pitchmark file. This option is \n" 112 " used to perform filling operations on an already existing \n" 113 " set of pitchmarks \n\n" 114 "-f0 <ofile> Calculate F0 from pitchmarks and save to file\n\n" 115 "-end <float> Specify the end time of the last pitchmark, for use \n" 116 " with the -fill option\n\n" 117 "-wave_end Use the end of a waveform to specify when the \n" 118 " last pitchmark position should be. The waveform file is only \n" 119 " read to determine its end, no processing is performed\n\n" 120 "-inter Output intermediate waveforms. This will output the \n" 121 " signal at various stages of processing. Examination of these \n" 122 " waveforms is extremely useful in setting the parameters for \n" 123 " similar waveforms\n\n" 124 "-style <string> \"track\" or \"lab\"\n\n", files, al);
144 op.
set(
"pm_end", lx.
end());
158 pm_fill(pm, op.
F(
"pm_end"), op.
F(
"max_period"),
159 op.
F(
"min_period"), op.
F(
"def_period"));
160 pm_fill(pm, op.
F(
"pm_end"), op.
F(
"max_period"),
161 op.
F(
"min_period"), op.
F(
"def_period"));
178 save_msec(pm, out_file +
".pm");
182 save_ogi_bin(pm, out_file +
".pmv", lx.
sample_rate());
186 cerr <<
"pitchmark: failed to write output to \"" 187 << out_file <<
"\"" << endl;
200 outf =
new ofstream(filename);
206 outf->setf(ios::fixed, ios::floatfield);
210 *outf << pm.
t(i) * 1000.0 << endl;
224 d[i] =
int(pm.
t(i) * (float) sr);
226 if ((fp = fopen(filename,
"wb")) ==
NULL) {
296 op.
set(
"lx_low_frequency", al.
ival(
"-lx_lf", 0));
298 op.
set(
"lx_low_order", al.
ival(
"-lx_lo", 0));
300 op.
set(
"lx_high_frequency", al.
ival(
"-lx_hf", 0));
302 op.
set(
"lx_high_order", al.
ival(
"-lx_ho", 0));
304 op.
set(
"median_order", al.
ival(
"-med_o", 0));
306 op.
set(
"mean_order", al.
ival(
"-mean_o", 0));
308 op.
set(
"df_low_frequency", al.
ival(
"-df_lf", 0));
310 op.
set(
"df_low_order", al.
ival(
"-df_lo", 0));
312 op.
set(
"min_period", al.
fval(
"-min", 0));
314 op.
set(
"max_period", al.
fval(
"-max", 0));
316 op.
set(
"def_period", al.
fval(
"-def", 0));
318 op.
set(
"pm_end", al.
fval(
"-end", 0));
320 op.
set(
"pm_debug", 1);
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
void pm_fill(EST_Track &pm, float new_end, float max, float min, float def)
int contains(const char *s, ssize_t pos=-1) const
Does it contain this substring?
The file was read in successfully.
int override_ival(const EST_String rkey, const int rval)
add to end of list or overwrite. If rval is empty, do nothing
void set_options(EST_Features &op, EST_Option &al)
int ival(const EST_String &rkey, int m=1) const
int override_fval(const EST_String rkey, const float rval)
add to end of list or overwrite. If rval is empty, do nothing
void override_lib_ops(EST_Option &op, EST_Option &al)
float fval(const EST_String &rkey, int m=1) const
void pm_min_check(EST_Track &pm, float min)
void set(const EST_String &name, int ival)
EST_read_status load(const EST_String name, float ishift=0.0, float startt=0.0)
float & t(ssize_t i=0)
return time position of frame i
void pm_to_f0(EST_Track &pm, EST_Track &f0)
The file was written successfully.
#define LX_HIGH_FREQUENCY
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
const T & first() const
return const reference to first item in list
ssize_t num_frames() const
return number of frames in track
EST_String options_wave_input(void)
The file was not written successfully.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
float end()
return the time position of the last sample.
EST_String options_track_output(void)
int sample_rate() const
return the sampling rate (frequency)
EST_read_status read_wave(EST_Wave &sig, const EST_String &in_file, EST_Option &al)
int present(const K &rkey) const
Returns true if key is present.
int main(int argc, char *argv[])
EST_write_status save(const EST_String &filename, bool evaluate_ff=false) const
EST_Track pitchmark(EST_Wave &lx, EST_Features &op)
void pm_to_label(EST_Track &pm, EST_Relation &lab)
int parse_command_line(int argc, char *argv[], const EST_String &usage, EST_StrList &files, EST_Option &al, int make_stdio=1)
void invert(EST_Wave &sig)
float F(const EST_String &path) const