41 #include "sigpr/EST_sigpr_utt.h"
42 #include "EST_cmd_line_options.h"
53 int main (
int argc,
char *argv[])
64 EST_String(
"[input file] -o [output file] [options]\n")+
65 "Summary: pitch track waveform files\n"
66 "use \"-\" to make input and output files stdin/out\n"
67 "-h Options help\n\n"+
69 options_pda_general()+
71 options_track_output(),
75 set_parameters(op, al);
77 if (read_wave(sig, files.
first(), al) != format_ok)
85 save_pm(out_file, fz);
87 fz.
save(out_file, op.
S(
"f0_file_type",
"0"));
92 fz.
save(out_file +
".diff", op.
S(
"f0_file_type",
"0"));
100 op.
set(
"srpd_resize", 1);
103 option_override(op, al,
"pda_frame_shift",
"-shift");
104 option_override(op, al,
"pda_frame_length",
"-length");
105 option_override(op, al,
"max_pitch",
"-fmax");
106 option_override(op, al,
"min_pitch",
"-fmin");
109 option_override(op, al,
"lpf_cutoff",
"-u");
110 option_override(op, al,
"lpf_order",
"-forder");
112 option_override(op, al,
"decimation",
"-d");
113 option_override(op, al,
"noise_floor",
"-n");
114 option_override(op, al,
"min_v2uv_coef_thresh",
"-m");
115 option_override(op, al,
"v2uv_coef_thresh_ratio",
"-R");
116 option_override(op, al,
"v2uv_coef_thresh",
"-H");
117 option_override(op, al,
"anti_doubling_thresh",
"-t");
118 option_override(op, al,
"peak_tracking",
"-P");
120 option_override(op, al,
"f0_file_type",
"-otype");
121 option_override(op, al,
"wave_file_type",
"-itype");
123 if (al.
val(
"-L", 0) ==
"true")
124 op.
set(
"do_low_pass",
"true");
125 if (al.
val(
"-R", 0) ==
"true")
126 op.
set(
"do_low_pass",
"false");
179 float position, period;
184 outf =
new ofstream(filename);
188 cerr <<
"save_pm: can't write to file \"" << filename <<
"\"" << endl;
193 *outf <<
"LineType bars \n";
194 *outf <<
"LineStyle solid \n";
195 *outf <<
"LineWidth 0 \n";
196 *outf <<
"Freq 16\n";
197 *outf <<
"Format Binary \n";
198 *outf << char(12) <<
"\n";
211 period = 1.0 / fz.
a(i);
212 *outf << (position + period) * 1000.0 << endl;
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
float & t(int i=0)
return time position of frame i
float & a(int i, int c=0)
void set(const EST_String &name, int ival)
const EST_String S(const EST_String &path) const
void default_pda_options(EST_Features &al)
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
int val(int i) const
return true if frame i is a value
const T & first() const
return const reference to first item in list
const int present(const K &rkey) const
Returns true if key is present.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
void pda(EST_Wave &sig, EST_Track &fz, EST_Features &op, EST_String method="")
int num_frames() const
return number of frames in track
EST_Track differentiate(EST_Track &c, float samp_int=0.0)