DIGIT

NAME

digit - DIG SFS data set display library

SYNOPSIS

The digit library contains a number of routines for the graphical representation of SFS data sets on a number of different graphics terminals using the Device Independent Graphics (DIG) library.

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.

CONTROL STRUCTURE

The digit routines hold intermediate display information in a global structure digitab which may be found in the file SFSBASE/include/digdata.h This structure has the following form:

     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.

DATA TYPES

Routines are supplied for the following data sets:

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.

ROUTINE PARAMETERS

Each routine has the following definition:

     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 graph

The "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 */

UTILITY ROUTINE

The routine digitemtime has the following format:

     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.

VERSION/AUTHOR

2.0 Mark Huckvale

BUGS

Grey-scale display needs completely re-writing !
Fri Jul 09 14:54:51 2004