43#ifndef __EST_TRACK_AUX_H__
44#define __EST_TRACK_AUX_H__
46#include "EST_FMatrix.h"
48#include "ling_class/EST_Relation.h"
49#include "EST_Option.h"
51#include "EST_TBuffer.h"
56void simple_med_smooth(
EST_Track &c,
int n,
int channel=0);
57void simple_mean_smooth(
EST_Track &c,
int n,
int channel=0);
68void normalise(
EST_Track &
tr,
float mean,
float sd,
int channel,
87float mean(
const EST_Track &a,
int channel );
90void meansd(
EST_Track &a,
float &
m,
float &
sd,
int channel);
114void align_to_track(
EST_Track &
tr,
float &start,
float &end);
116void align_to_track(
EST_Track &
tr,
int &start,
int &end,
int sample_rate);
119 int &start,
int &end,
120 int sample_rate,
float offset=0.0);
122int nearest_boundary(
EST_Track &
tr,
float time,
int sample_rate,
float offset=0);
174int get_order(
const EST_Track &t, EST_CoefficientType type,
int d=0);
183void get_start_positions(
const EST_Track &t,
198static inline void get_frame(
const EST_Track &
tr,
int sample_rate,
200 int &start,
int &
center,
int &end)
202 center = (int)(
tr.t(f)*sample_rate + 0.5);
203 start =
center - (int)(
tr.a(f, channel_length)/2.0);
204 end = start + (int)(
tr.a(f, channel_length));
208static inline void get_frame(
const EST_Track &
tr,
int sample_rate,
210 float &start,
float &
center,
float &end)
213 start =
center -
tr.a(f, channel_length)/(
float)sample_rate/2.0;
214 end = start +
tr.a(f, channel_length)/(
float)sample_rate;
218static inline void get_frame_o(
const EST_Track &
tr,
int sample_rate,
220 int &start,
int &
center,
int &end)
222 center = (int)(
tr.t(f)*sample_rate +
tr.a(f,channel_offset) + 0.5);
223 start =
center - (int)(
tr.a(f, channel_length)/2.0);
224 end = start + (int)(
tr.a(f, channel_length));
228static inline void get_frame_o(
const EST_Track &
tr,
int sample_rate,
230 float &start,
float &
center,
float &end)
233 start =
center -
tr.a(f, channel_length)/(
float)sample_rate/2.0;
234 end = start +
tr.a(f, channel_length)/(
float)sample_rate;
245void channel_to_time_lengths(
EST_Track &
tr, EST_ChannelType c,
float scale=1.0);