42 #ifndef __EST_TRACK_AUX_H__
43 #define __EST_TRACK_AUX_H__
45 #include "EST_FMatrix.h"
47 #include "ling_class/EST_Relation.h"
48 #include "EST_Option.h"
49 #include "EST_Track.h"
53 void time_med_smooth(
EST_Track &c,
float x);
54 void time_mean_smooth(
EST_Track &c,
float x);
55 void simple_med_smooth(
EST_Track &c,
int n,
int channel=0);
56 void simple_mean_smooth(
EST_Track &c,
int n,
int channel=0);
70 void normalise(
EST_Track &tr,
float mean,
float sd,
int channel,
71 float upper,
float lower);
73 float upper,
float lower);
88 float mean(
const EST_Track &a,
int channel );
120 int &start,
int &end,
121 int sample_rate,
float offset=0.0);
138 EST_String options_track_filetypes_long(
void);
180 int start_frame=0,
int end_frame=-1);
201 static inline void get_frame(
const EST_Track &tr,
int sample_rate,
203 int &start,
int ¢er,
int &end)
205 center = (int)(tr.
t(f)*sample_rate + 0.5);
206 start = center - (int)(tr.
a(f, channel_length)/2.0);
207 end = start + (int)(tr.
a(f, channel_length));
211 static inline void get_frame(
const EST_Track &tr,
int sample_rate,
213 float &start,
float ¢er,
float &end)
216 start = center - tr.
a(f, channel_length)/(float)sample_rate/2.0;
217 end = start + tr.
a(f, channel_length)/(float)sample_rate;
221 static inline void get_frame_o(
const EST_Track &tr,
int sample_rate,
223 int &start,
int ¢er,
int &end)
225 center = (int)(tr.
t(f)*sample_rate + tr.
a(f,channel_offset) + 0.5);
226 start = center - (int)(tr.
a(f, channel_length)/2.0);
227 end = start + (int)(tr.
a(f, channel_length));
231 static inline void get_frame_o(
const EST_Track &tr,
int sample_rate,
233 float &start,
float ¢er,
float &end)
235 center = tr.
t(f) + tr.
a(f,channel_offset)/(float)sample_rate;
236 start = center - tr.
a(f, channel_length)/(float)sample_rate/2.0;
237 end = start + tr.
a(f, channel_length)/(float)sample_rate;
246 void channel_to_time(
EST_Track &tr,
int channel,
float scale=1.0);
247 void channel_to_time(
EST_Track &tr, EST_ChannelType c,
float scale=1.0);
250 void channel_to_time_lengths(
EST_Track &tr,
int channel,
float scale=1.0);
251 void channel_to_time_lengths(
EST_Track &tr, EST_ChannelType c,
float scale=1.0);
void move_to_frame_ends(EST_Track &tr, int &start, int &end, int sample_rate, float offset=0.0)
Move the start and end variables to the start and end of the nearest frame.
float & t(int i=0)
return time position of frame i
float & a(int i, int c=0)
void get_start_positions(const EST_Track &t, int sample_rate, EST_TBuffer< int > &pos)
Find the start point in the signal of the sections of speech related to each frame.
unsigned int pos
Position in the structure. May or may not be useful.
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
void set_start(EST_Track &tr, float start)
Move the track so that it starts at the indicated time.
unsigned int n() const
Return the current position.
int get_frame_size(EST_Track &pms, int current_pos, int sample_rate, int prefer_prev=0)
void move_start(EST_Track &tr, float shift)
Move the track by shift seconds.
int nearest_boundary(EST_Track &tr, float time, int sample_rate, float offset=0)
Index of the frame whose start boundary.
void align_to_track(EST_Track &tr, float &start, float &end)
Move the start and end variables to the nearest frame.
void meansd(EST_Track &a, float &m, float &sd, int channel)
float rms_error(EST_Track &a, EST_Track &b, int channel)
float get_time_frame_size(EST_Track &pms, int i, int prefer_prev=0)
int get_order(const EST_Track &t, EST_CoefficientType type, int d=0)
How many coefficients in track (looks for Coef0 and coefN channels)
int sum_lengths(const EST_Track &t, int sample_rate, int start_frame=0, int end_frame=-1)
Total the length channel values.
EST_Track differentiate(EST_Track &c, float samp_int=0.0)
float abs_error(EST_Track &a, EST_Track &b, int channel)