 |
Edinburgh Speech Tools
2.4-release
|
|
41 #include "EST_cmd_line_options.h"
42 #include "sigpr/EST_spectrogram.h"
44 #define DEFAULT_FRAME_SIZE 0.001
45 #define DEFAULT_FRAME_LENGTH 0.008
46 #define DEFAULT_ORDER 256
47 #define DEFAULT_PREEMPH 0.94
90 int main(
int argc,
char *argv[])
102 EST_String(
"[input file] -o [output file]\n")+
103 "Summary: make spectrogram\n"+
104 "use \"-\" to make input and output files stdin/out\n"+
106 options_wave_input()+
108 options_track_output()+
109 "-shift <float> frame spacing in seconds for fixed frame analysis. This \n"
110 " doesn't have to be the same as the output file spacing - the \n"
111 " S option can be used to resample the track before saving \n"
112 " default: "+ftoString(DEFAULT_FRAME_SIZE) +
"\n\n"
113 "-length <float> input frame length in milliseconds\n"+
114 "-sr <float> range in which output values should lie\n"+
115 "-slow slow FFT code\n"+
116 "-w <float> white cut off (0.0 to 1.0)\n"+
117 "-b <float> black cut off (0.0 to 1.0)\n"+
118 "-raw Don't perform any scaling\n"+
119 "-order <int> cepstral order\n", files, al);
124 if (read_wave(sig, files.
first(), al) != format_ok)
127 make_spectrogram(sig, spec, op);
129 spec.
save(out_file, al.
val(
"-otype", 0));
136 op.
set(
"frame_shift", DEFAULT_FRAME_SIZE);
137 op.
set(
"frame_length", DEFAULT_FRAME_LENGTH);
138 op.
set(
"preemph", DEFAULT_PREEMPH);
139 op.
set(
"frame_order", DEFAULT_ORDER);
142 op.
set(
"frame_shift", al.
fval(
"-shift"));
145 op.
set(
"frame_length", al.
fval(
"-length"));
148 op.
set(
"frame_order", al.
fval(
"-order"));
151 op.
set(
"sp_range", al.
fval(
"-sr"));
154 op.
set(
"sp_wcut", al.
fval(
"-w"));
157 op.
set(
"sp_bcut", al.
fval(
"-b"));
160 op.
set(
"preemph", al.
fval(
"-preemph", 1));
void set(const EST_String &name, int ival)
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.
float fval(const EST_String &rkey, int m=1) const
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
const V & val(const K &rkey, bool m=0) const
return value according to key (const)