The digit library supports the display of a subset of all SFS data types (listed below) through a number of similar routines. Each routine has a commom calling format and display format (see Ds(SFS1) program for examples). There are also support routines in the digit library for drawing time and frequency scales.
struct { int ixl,ixr,iyb,iyt; /* pixel co-ord of box */ int gbun,abun,lbun,dbun;/* graph bundles */ int ixoff; /* y-axis offset */ int iytitle; /* title position */ double scalex; /* x-axis scaling */ double scaley; /* y-axis scaling */ double hi,lo; /* max, min data values */ char *title; /* text title */ char *label; /* text label */ } digitab;This structure can be accessed prior to display to give fine control over the format of the display; or it may be accessed after display to give information about the scaling used.
SP Speech Waveform
LX Laryngograph waveform
TX Fundamental period markers
FX Fundamental frequency graph (linear scale)
AN Annotations
SY Synthesizer control data (bar-width=amplitude)
DI (sfsformat only) Grey-level display on some devices
CO Overlapping spectra.
FM Raw formant estimates as numbered peaks
TR Parameter track as graph.
void digitemXX(bundle,xl,yb,xr,yt, item,buff,start,stop,flags) int bundle; /* display bundles */ float xl,yb,xr,yt; /* box co-ordinates */ struct item_header *item; /* item header for data set */ char *buff; /* data buffer */ double start,stop; /* time interval to display */ int flags /* display control flags */Where "XX" should be substituted for the item type mnemonic from the table above. The "bundle" parameter supplies the colours for the display using the formula:
bundle = 1000000*a + 10000*d + 100*l + g where a = bundle number for axes d = bundle number for divisions l = bundle number for labels g = bundle number for graphThe "flags" parameter can be constructed by ORing the following defines (found in digitem.h):
DIGITEMBOX 1 /* draw outline box */ DIGITEMTITLE 2 /* print item title */ DIGITEMLABEL 4 /* print item label */ DIGITEMFIX 8 /* do not auto-scale */ DIGITEMOVERLAY 16 /* overlay on existing graph */ DIGITEMGAP 32 /* gap between item and top of box */
void digitemtime(bundles,xl,yb,xr,yt,start,stop,flags) int bundles; /* colours: 10000*divisions + 100*labels + title */ float xl,yb,xr,yt; /* x,y co-ords of display */ double start,stop; /* start, stop time (seconds) */ int flags; /* format flags */The routine displays a timescale using appropriate numbers of divisions and labels for the current display device.
2.0 Mark Huckvale