44 #include "EST_Track.h"
46 #include "EST_sigpr.h"
47 #include "EST_error.h"
100 tr.
t(i) = (float) i * 0.01;
110 for (i = 50; i < 100; ++i)
115 for (i = 50; i < 100; ++i)
121 cout <<
"Frame 60 is not a break\n";
124 cout <<
"Frame 60 is a break\n";
179 tr.
frame(tmp_frame, 50);
189 tr.
channel(tmp_channel,
"energy");
193 tr.
frame(tmp_frame, 50, 2, 9);
197 tr.
channel(tmp_channel, 5, 400, 100);
210 melcep(sig, sub, 1.0, 20, 22);
215 tr.
sub_track(sub, 0, EST_ALL,
"cep_0",
"cep_N");
219 tr.
sub_track(sub, 0, EST_ALL,
"cep_0",
"cep_N");
223 tr.
sub_track(sub, 47, 39,
"cep_0",
"cep_N");
233 for (frames.
begin(tr); frames; ++frames)
236 if (frames.
n() % 50 ==0)
237 cout <<
" " << frames.
n() <<
"[" << frame.
t() <<
"]";
251 float *channel_buf, *frame_buf;
268 aux_names.
append(
"voicing");
269 aux_names.
append(
"join_points");
277 for (i = 0; i < 500; ++i)
279 tr.aux(i,
"voicing") = i;
280 tr.aux(i,
"join_points") =
EST_String(
"stuff");
281 tr.aux(i,
"cost") = 0.111;
288 if (tr.
save(
"tmp/track.htk",
"htk") != write_ok)
289 EST_error(
"can't save htk file\n");
293 if (tr.
save(
"tmp/track.est",
"est") != write_ok)
294 EST_error(
"can't save est file\n");
298 if (tr.
save(
"tmp/track.ascii",
"ascii") != write_ok)
299 EST_error(
"can't save ascii file\n");
304 if (tr2.
load(
"tmp/track.htk") != read_ok)
305 EST_error(
"can't reload htk\n");
309 if (tr.
load(
"tmp/track.ascii", 0.01) != read_ok)
310 EST_error(
"can't reload ascii file\n");
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
void set_num_frames(int n, bool preserve=1)
void set_value(int i)
set frame i to be a value
void set_break(int i)
set frame i to be a break
float & t(int i=0)
return time position of frame i
float & a(int i, int c=0)
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
void set_channel_name(const EST_String &name, int channel)
set the name of the channel.
int num_channels() const
return number of channels in track
unsigned int n() const
Return the current position.
void set_num_channels(int n, bool preserve=1)
void melcep(EST_Wave &sig, EST_Track &mfcc_track, float factor, int fbank_order, float liftering_parameter, EST_WindowFunc *wf=EST_Window::creator(DEFAULT_WINDOW_NAME), const bool include_c0=false, const bool up=false)
void clear(void)
remove all items in list
void sub_track(EST_Track &st, int start_frame=0, int nframes=EST_ALL, int start_chan=0, int nchans=EST_ALL)
EST_read_status load(const EST_String name, float ishift=0.0, float startt=0.0)
void resize(int num_frames, int num_channels, bool preserve=1)
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
void copy_channel_out(int n, float *buf, int offset=0, int num=EST_ALL) const
int val(int i) const
return true if frame i is a value
void resize_aux(EST_StrList &map, bool preserve=1)
void copy_frame_out(int n, float *buf, int offset=0, int num=EST_ALL) const
void copy_frame_in(int n, const float *buf, int offset=0, int num=EST_ALL)
void append(const T &item)
add item onto end of list
void copy_channel_in(int n, const float *buf, int offset=0, int num=EST_ALL)
void channel(EST_FVector &cv, int n, int startf=0, int nf=EST_ALL)
int track_break(int i) const
return true if frame i is a break
void begin(const Container &over)
Set the iterator ready to run over this container.
int num_frames() const
return number of frames in track
void frame(EST_FVector &fv, int n, int startf=0, int nf=EST_ALL)
void fill_time(float t, int start=1)