Logo Search packages:      
Sourcecode: speech-tools version File versions  Download package

EST_Track Class Reference

#include <EST_Track.h>

Inheritance diagram for EST_Track:

EST_Featured

List of all members.


Detailed Description

A class for storing time aligned coefficients.

some stuff.

Definition at line 88 of file EST_Track.h.


Public Types

typedef EST_TIterator
< EST_Track, IPointer_f,
EST_Track
Entries
typedef EST_Track Entry
typedef EST_TStructIterator
< EST_Featured, IPointer_feat,
FeatEntry
FeatEntries
typedef EST_TKVI< EST_String,
EST_Val
FeatEntry
typedef EST_TRwIterator
< EST_Track, IPointer_f,
EST_Track
RwEntries
typedef EST_TRwStructIterator
< EST_Featured, IPointer_feat,
FeatEntry
RwFeatEntries

Public Member Functions

float a (float t, EST_ChannelType c, EST_InterpType interp=it_nearest) const
float & a (float t, EST_ChannelType c, EST_InterpType interp=it_nearest)
float a (int i, EST_ChannelType c, int offset=0) const
float & a (int i, EST_ChannelType c, int offset=0)
void assign_map (EST_TrackMap &map)
void assign_map (EST_TrackMap::P map)
const EST_String aux_channel_name (int channel) const
const EST_String channel_name (int channel, int strings_override=1) const
const EST_String channel_name (int channel, const EST_ChannelNameMap &map, int strings_override=1) const
int channel_position (EST_ChannelType type, int offset=0) const
void create_map (void)
void create_map (EST_ChannelNameMap &names)
 EST_Track (int num_frames, EST_TrackMap &map)
float f_F (const char *name) const
float f_F (const char *name, float def) const
float f_Float (const char *name) const
float f_Float (const char *name, float def) const
int f_I (const char *name) const
int f_I (const char *name, int def) const
int f_Int (const char *name) const
int f_Int (const char *name, int def) const
int f_present (const EST_String name) const
void f_remove (const EST_String name)
EST_String f_S (const char *name) const
EST_String f_S (const char *name, const EST_String &def) const
void f_set (const EST_Features &f)
void f_set (const EST_String name, const char *val)
void f_set (const EST_String name, float val)
void f_set (const EST_String name, int val)
void f_set_path (const EST_String name, EST_Val val)
void f_set_path (const EST_String name, const char *val)
void f_set_path (const EST_String name, float val)
void f_set_path (const EST_String name, int val)
void f_set_val (const EST_String name, EST_Val val)
EST_String f_String (const char *name) const
EST_String f_String (const char *name, const EST_String &def) const
const EST_Valf_V (const char *name) const
const EST_Valf_V (const char *name, const EST_Val &def) const
const EST_Valf_Val (const char *name) const
const EST_Valf_Val (const char *name, const EST_Val &def) const
EST_TrackFileType file_type () const
bool has_channel (EST_ChannelType type) const
EST_read_status load_channel_names (const EST_String name)
EST_TrackMap::P map () const
float operator() (int i, EST_ChannelType c) const
float & operator() (int i, EST_ChannelType c)
EST_Trackoperator+= (const EST_Track &a)
EST_Trackoperator= (const EST_Track &a)
EST_Trackoperator|= (const EST_Track &a)
void resize (int num_frames, EST_TrackMap &map)
EST_write_status save_channel_names (const EST_String name)
void set_file_type (EST_TrackFileType t)
float t_offset () const
float & t_offset ()
Accessing amplitudes The following functions can be used
to access to amplitude of the track at certain points. Most of these functions can be used for reading or writing to this point, thus

tr.a(10, 5) = 10.3;

can be used to set the 10th frame of the 5th channel and

cout << tr.a(10, 5);

can be used to print the same information. Most of these functions have a const equivalent for helping the compiler in read only operations.

float a (float t, int c=0, EST_InterpType interp=it_nearest) const
float & a (float t, int c=0, EST_InterpType interp=it_nearest)
float a (int i, EST_String name, int offset=0) const
float & a (int i, EST_String name, int offset=0)
float a (int i, const char *name, int offset=0) const
float & a (int i, const char *name, int offset=0)
float a (int i, int c=0) const
float & a (int i, int c=0)
float a_no_check (int i, int c=0) const
float & a_no_check (int i, int c=0)
float operator() (float t) const
float operator() (float t, int c) const
float & operator() (float t)
float & operator() (float t, int c)
float operator() (int i) const
float operator() (int i, int c) const
float & operator() (int i)
float & operator() (int i, int c)
Utility functions


void add_trailing_breaks ()
int empty () const
 returns true if no values are set in the frame
bool equal_space () const
 return true if track has equal (i.e. fixed) frame spacing */
int index (float t) const
 return the frame index nearest time t
int index_below (float x) const
 return the frame index before time t
int length () const
 return number of frames in track
int next_non_break (int i) const
int num_aux_channels () const
 return number of auxiliary channels in track
int num_channels () const
 return number of channels in track
int num_frames () const
 return number of frames in track
int prev_non_break (int i) const
void rm_excess_breaks ()
void rm_trailing_breaks ()
void set_break (int i)
 set frame i to be a break
void set_equal_space (bool t)
void set_single_break (bool t)
void set_value (int i)
 set frame i to be a value
bool single_break () const
int track_break (int i) const
 return true if frame i is a break
int val (int i) const
 return true if frame i is a value
Auxiliary channels
Auxiliary information is used to store information that goes along with frames, but which are not amplitudes and hence not appropriate for operations such as interpolation, smoothing etc. The aux() array is an array of EST_Vals which allows points to be int, float or a string.

The following functions can be used to access to auxiliary track information. Most of these functions can be used for reading or writing to this point, thus

tr.aux(10, "voicing") = 1;

can be used to set the 10th frame of the "voicing" channel and

cout << tr.a(10, "voicing");

can be used to print the same information. Most of these functions have a const equivalent for helping the compiler in read only operations.

Auxiliary channels are usually accessed by name rather than numerical index. The names are set using the set_aux_channel_names() function.

EST_Val aux (int i, EST_String name) const
EST_Valaux (int i, EST_String name)
EST_Val aux (int i, const char *name) const
EST_Valaux (int i, const char *name)
EST_Valaux (int i, int c) const
EST_Valaux (int i, int c)
Timing
void change_type (float nshift, bool single_break)
 REDO.
float end () const
 return time of last value in track
void fill (float v)
void fill_time (EST_Track &t)
void fill_time (float t, int start=1)
float ms_t (int i) const
 return time of framet i in milli-seconds.
void sample (float shift)
float shift () const
float start () const
 return time of first value in track
float t (int i=0) const
float & t (int i=0)
 return time position of frame i
Functions for sub tracks, channels and frames.
void channel (EST_FVector &cv, const char *name, int startf=0, int nf=EST_ALL)
void channel (EST_FVector &cv, int n, int startf=0, int nf=EST_ALL)
void copy_channel_in (int c, const EST_Track &from, int from_c, int from_offset=0, int offset=0, int num=EST_ALL)
void copy_channel_in (int n, const float *buf, int offset=0, int num=EST_ALL)
void copy_channel_out (int n, float *buf, int offset=0, int num=EST_ALL) const
void copy_frame_in (int i, const EST_Track &from, int from_f, int from_offset=0, int offset=0, int num=EST_ALL)
void copy_frame_in (int n, const EST_FVector &t, int offset=0, int num=EST_ALL)
void copy_frame_in (int n, const float *buf, int offset=0, int num=EST_ALL)
void copy_frame_out (int n, EST_FVector &f, int offset=0, int num=EST_ALL) const
void copy_frame_out (int n, float *buf, int offset=0, int num=EST_ALL) const
void copy_sub_track (EST_Track &st, int start_frame=0, int nframes=EST_ALL, int start_chan=0, int nchans=EST_ALL) const
void frame (EST_FVector &fv, int n, int startf=0, int nf=EST_ALL)
void sub_track (EST_Track &st, int start_frame=0, int nframes=EST_ALL, int start_chan=0, int nchans=EST_ALL) const
void sub_track (EST_Track &st, int start_frame, int nframes, const EST_String &start_chan_name, const EST_String &end_chan_name)
void sub_track (EST_Track &st, int start_frame, int nframes, const EST_String &start_chan_name, int nchans=EST_ALL)
void sub_track (EST_Track &st, int start_frame=0, int nframes=EST_ALL, int start_chan=0, int nchans=EST_ALL)
Channel information
int channel_position (EST_String name, int offset=0) const
int channel_position (const char *name, int offset=0) const
bool has_channel (EST_String name) const
bool has_channel (const char *name) const
Configuring Tracks
void copy_setup (const EST_Track &a)
 copy everything but data
void resize (int num_frames, EST_StrList &map, bool preserve=1)
void resize (int num_frames, int num_channels, bool preserve=1)
void resize_aux (EST_StrList &map, bool preserve=1)
void set_aux_channel_name (const EST_String &name, int channel)
 set the name of the auxiliary channel.
void set_channel_name (const EST_String &name, int channel)
 set the name of the channel.
void set_num_channels (int n, bool preserve=1)
void set_num_frames (int n, bool preserve=1)
Constructor and Destructor functions
 EST_Track (int num_frames, EST_StrList &map)
 resizing constructor
 EST_Track (int num_frames, int num_channels)
 resizing constructor
 EST_Track (const EST_Track &a)
 Copy constructor.
 EST_Track ()
 Default constructor.
 ~EST_Track ()
 default destructor
File i/o functions
EST_read_status load (const EST_String name, const EST_String type, float ishift=0.0)
EST_read_status load (EST_TokenStream &ts, float ishift=0.0)
EST_read_status load (const EST_String name, float ishift=0.0)
EST_write_status save (FILE *fp, const EST_String EST_filetype="")
EST_write_status save (const EST_String name, const EST_String EST_filetype="")
Global track information
EST_String name () const
 name of track - redundant use access to features
void set_name (const EST_String &n)
 set name of track - redundant use access to features

Static Public Attributes

static const float default_frame_shift = 0.005
static const int default_sample_rate = 16000

Protected Member Functions

void clear_arrays ()
void clear_features ()
void copy (const EST_Track &a)
void copy_features (const EST_Featured &f)
void default_channel_names ()
void default_vals ()
void ensure_features (void)
float estimate_shift (float x)
void init_features ()
float interp_amp (float x, int c, float f)
int interp_value (float x, float f)
void move_pointer_forwards (IPointer_feat &ip) const
void move_pointer_forwards (IPointer_f &ip) const
void pad_breaks ()
void point_to_first (IPointer_feat &ip) const
void point_to_first (IPointer_f &ip) const
EST_TKVI< EST_String, EST_Val > & points_at (const IPointer_feat &ip)
EST_Trackpoints_at (const IPointer_f &ip)
bool points_to_something (const IPointer_feat &ip) const
bool points_to_something (const IPointer_f &ip) const

Protected Attributes

EST_ValMatrix p_aux
EST_StrVector p_aux_names
EST_StrVector p_channel_names
bool p_equal_space
EST_CVector p_is_val
EST_TrackMap::P p_map
bool p_single_break
float p_t_offset
EST_FVector p_times
EST_FMatrix p_values

Friends

class EST_TIterator< EST_Featured, IPointer_feat, EST_TKVI< EST_String, EST_Val > >
class EST_TIterator< EST_Track, IPointer_f, EST_Track >
class EST_TRwIterator< EST_Featured, IPointer_feat, EST_TKVI< EST_String, EST_Val > >
class EST_TRwIterator< EST_Track, IPointer_f, EST_Track >
class EST_TRwStructIterator< EST_Featured, IPointer_feat, EST_TKVI< EST_String, EST_Val > >
class EST_TStructIterator< EST_Featured, IPointer_feat, EST_TKVI< EST_String, EST_Val > >
ostream & operator<< (ostream &s, const EST_Track &tr)

Classes

class  IPointer_f

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index