Go to the first, previous, next, last section, table of contents.


Database records are sometimes obtained from analog tapes for which a tape counter is available. Since many analog tape recorders lack elapsed time indicators, it is often useful to identify events in the analog tape using counter values. A similar situation may arise if a chart recording or other hard copy with numbered pages is to be compared with a database record. To simplify cross-referencing between the analog tape or chart and the digital database record, the DB library supports conversion of counter values (or page numbers) to time. For this to be possible, the counter must be linear (i.e., it must change at the same rate throughout the tape; this is not true of those that count the number of revolutions of the supply or take-up reel), and the base counter value (the counter value or page number corresponding to sample 0) and the counter frequency (the difference between counter values separated by a one-second interval, or the reciprocal of the number of seconds per page) must be defined. The following four functions, first introduced in DB library version 5.2, are used to obtain or set the values of these parameters.

getcfreq

DB_Frequency getcfreq(void)

Return:

(DB_Frequency)
the counter frequency in Hz

This function returns the currently-defined counter frequency. The counter frequency is set by the functions that read `header' files, or by setcfreq. If the counter frequency has not been defined explicitly, getcfreq returns the sampling frequency.

setcfreq

void setcfreq(DB_Frequency freq)

This function sets the counter frequency. Use setcfreq before creating a `header' file (see section newheader). The effect of setcfreq is nullified by later invoking any of the functions that read `header' files. If freq is zero or negative, the counter frequency is treated as equivalent to the sampling frequency.

getbasecount

double getbasecount(void)

Return:

(double)
base counter value

This function returns the base counter value, which is set by the functions that read `header' files, or by setbasecount. If the base counter value has not been set explicitly, getbasecount returns zero.

setbasecount

void setbasecount(double count)

This function sets the base counter value. Use setbasecount before creating a `header' file (see section newheader). The effect of setbasecount is nullified by later invoking any of the functions that read `header' files.


Go to the first, previous, next, last section, table of contents.



George B. Moody (george@hstbme.mit.edu)