42 #include "EST_sigpr.h" 43 #include "EST_cmd_line.h" 44 #include "EST_inline_utils.h" 45 #include "EST_sigpr.h" 72 cout <<
"position 1\n";
91 sig.
load(DATA
"/kdt_001.wav");
103 num_frames = (int)ceil(sig.
end() / 0.01);
104 fv.
resize(num_frames, lpc_order + 1);
121 sig2coef(sig, fv,
"lpc");
136 sig2coef(sig, fv,
"lpc", 2.0);
142 sig2coef(sig, fv,
"lpc", 3.0);
155 sig2coef(sig, fv,
"lpc", 3.0, wf);
191 int num_frames = 300;
192 fv.
resize(num_frames, lpc_order + 1);
195 for (i = 0; i < num_frames; ++i)
196 fv.
t(i) = shift * (float) i;
209 fv.
load(DATA
"/kdt_001.pm");
210 make_track(fv,
"lpc", lpc_order + 1);
217 sig2coef(sig, fv,
"lpc");
221 cout <<
"position 3\n";
253 map.
append(
"$lpc-0+" Stringtoi(lpc_order));
254 map.
append(
"$cepc-0+" Stringtoi(cep_order));
257 fv.
resize(EST_CURRENT, map);
272 coef_types.
append(
"power");
276 add_channels_to_map(map, coef_types, op);
277 fv.
resize(EST_CURRENT, map);
286 fv.
sub_track(part, 0, EST_ALL, 0,
"lpc_0",
"lpc_N");
291 sig2coef(sig, part,
"lpc");
298 fv.
sub_track(part, 0, EST_ALL,
"cep_0",
"cep_N");
300 sig2coef(sig, part,
"cep");
305 fv.
sub_track(part, 0, EST_ALL,
"power", 1);
306 power(sig, part, 0.01);
321 base_list.
append(
"power");
323 sigpr_base(sig, fv, op, base_list);
343 map.
append(
"$cep_d-0+" Stringtoi(cep_order));
344 map.
append(
"$cep_a-0+" Stringtoi(cep_order));
346 fv.
resize(EST_CURRENT, map);
360 fv.
sub_track(part, 0, EST_ALL, 0,
"cep_0",
"cep_N");
361 sig2coef(sig, part,
"cep");
364 fv.
sub_track(del, 0, EST_ALL, 0,
"cep_d_0",
"cep_d_N");
368 fv.
sub_track(acc, 0, EST_ALL, 0,
"cep_a_0",
"cep_a_N");
380 map.
append(
"$ref_d-0+" Stringtoi(lpc_order));
381 fv.
resize(EST_CURRENT, map);
383 sigpr_delta(sig, fv, op,
"ref");
388 map.
append(
"$lsf_a-0+" Stringtoi(lpc_order));
389 fv.
resize(EST_CURRENT, map);
391 sigpr_acc(sig, fv, op,
"ref");
432 for (i = 0; i < 256; ++i)
433 frame[i] = (
float)sig.
a(i + 1000) * win_vals[i];
470 fv.
resize(EST_CURRENT, map);
479 int s_shift = int(shift *
float(sig.
sample_rate()));
500 int start = (k1 * s_shift) - (s_length/2);
504 sig2lpc(frame, coefs);
512 fv.
load(DATA
"/kd1_001.pm");
513 fv.
resize(EST_CURRENT, map);
529 s_length = irint(get_frame_size(fv, k2, sig.
sample_rate())* factor);
530 int start = (irint(fv.
t(k2) * sig.
sample_rate()) - (s_length/2));
535 sig2lpc(frame, coefs);
560 int filter_order = 99;
562 filter = design_lowpass_FIR_filter(sig.
sample_rate(), 400, 99);
567 FIRfilter(sig, filter);
577 FIRlowpass_filter(sig, 400, 99);
582 filter = design_highpass_FIR_filter(sig.
sample_rate(), 50, 99);
583 FIRfilter(sig, filter);
584 FIRhighpass_filter(sig, 50, 99);
612 filter = design_FIR_filter(response, 15);
614 FIRfilter(sig, response);
622 FIRlowpass_double_filter(sig, 400);
623 FIRhighpass_double_filter(sig, 40);
633 FIRfilter(sig, sig_out, response);
634 FIRlowpass_filter(sig, sig_out, 400);
635 FIRhighpass_filter(sig, sig_out, 40);
EST_read_status load(const EST_String filename, int offset=0, int length=0, int rate=default_sample_rate)
static Func * creator(const char *name, bool report_error=false)
Return the creation function for the given window type.
float & t(int i=0)
return time position of frame i
static void window_signal(const EST_Wave &sig, EST_WindowFunc *make_window, int start, int size, EST_TBuffer< float > &frame)
static void make_window(EST_TBuffer< float > &window_vals, int size, const char *name, int window_centre)
int sample_rate() const
return the sampling rate (frequency)
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)
short & a(int i, int channel=0)
void resize(int num_frames, int num_channels, bool preserve=1)
void append(const T &item)
add item onto end of list
float end()
return the time position of the last sample.
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)
void clear(void)
remove all items in list