diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/MANIFEST wfdb-10.3.8/MANIFEST --- wfdb-10.3.7/MANIFEST Tue May 6 16:41:47 2003 +++ wfdb-10.3.8/MANIFEST Thu Jul 10 12:30:34 2003 @@ -44,6 +44,7 @@ app/sumann.c app/sumstats.c app/tach.c +app/time2sec.c app/view.c app/vsetup.c app/wabp.c @@ -323,6 +324,7 @@ doc/wag-src/sumann.1 doc/wag-src/sumstats.1 doc/wag-src/tach.1 +doc/wag-src/time2sec.1 doc/wag-src/tmac.dif doc/wag-src/view.1 doc/wag-src/wabp.1 diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/NEWS wfdb-10.3.8/NEWS --- wfdb-10.3.7/NEWS Tue May 6 15:53:44 2003 +++ wfdb-10.3.8/NEWS Sat Jul 12 02:39:56 2003 @@ -1,3 +1,46 @@ +10.3.8: + The WFDB library function setbasetime (in lib/signal.c) now properly + accepts arguments specifying midnight (e.g., "0:0:0"), which previous + versions rejected, and the function setheader (also in lib/signal.c) + records such times correctly in the .hea files it creates. + + epicmp's new -I option allows exclusion of short episodes from all + statistics (the -i option, which remains available, excludes such + episodes from episode counts but includes them in duration tallies.) + Also, previous versions of epicmp (formerly epic) output a "time of + day" string where "0.000" should have appeared if the input record had + a defined base time. This behavior has been corrected (thanks to + Paul Albrecht for the bug report, and for suggesting and providing + an implementation of the -I option). + + The bounding box for pschart output has been enlarged so that most + signal labels will not be clipped. + + A new application, time2sec, converts a string in WFDB standard + time format into a time interval in seconds. + + wfdbdesc now produces output even for records with no signals. + + Three highly condensed time scales have been added to those previously + available in WAVE. + + Modified psd/hrlomb and psd/hrmem so that the plots they produce are + power, not amplitude, spectra, as psd/hrfft produces. All three of + these scripts can now produce log-log and semi-log plots (make them + by using the new "-l xy" or "-l y" options). + + psd/lomb can now accept input series of arbitrary length, and its -P + option (for selecting a power spectrum rather than the default + amplitude spectrum) is now properly documented in its man page. + + The -l option of psd/memse is now obsolete; memse can now accept input + series of arbitrary length. + + Fixed bugs in convert/readid and convert/makeid. These programs read + and write AHA DB-format tape ID files. The bugs were introduced in + version 10.0.1 (!); the programs should work properly again, if anyone + still needs to use them. + 10.3.7: Fixed a bug in xform, introduced in 10.3.4, that prevented xform from reading the output sampling frequency from the standard input. Thanks diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/app/Makefile.tpl wfdb-10.3.8/app/Makefile.tpl --- wfdb-10.3.7/app/Makefile.tpl Mon Feb 17 07:22:45 2003 +++ wfdb-10.3.8/app/Makefile.tpl Wed Jul 9 07:26:17 2003 @@ -1,17 +1,17 @@ # file: Makefile.tpl G. Moody 23 May 2000 -# Last revised: 17 February 2003 +# Last revised: 9 July 2003 # This section of the Makefile should not need to be changed. CFILES = ann2rr.c bxb.c calsig.c ecgeval.c epicmp.c fir.c ihr.c mfilt.c \ mrgann.c mxm.c nguess.c nst.c plotstm.c pscgen.c pschart.c psfd.c rdann.c \ rdsamp.c rr2ann.c rxr.c sampfreq.c sample.c sigamp.c sigavg.c skewedit.c \ - snip.c sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c view.c vsetup.c \ - wabp.c wfdbcat.c wfdbcollate.c wfdb-config.c wfdbdesc.c wfdbwhich.c wqrs.c \ - wrann.c wrsamp.c wvscript.c xform.c + snip.c sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c time2sec.c \ + view.c vsetup.c wabp.c wfdbcat.c wfdbcollate.c wfdb-config.c wfdbdesc.c \ + wfdbwhich.c wqrs.c wrann.c wrsamp.c wvscript.c xform.c XFILES = ann2rr bxb calsig ecgeval epicmp fir ihr mfilt \ mrgann mxm nguess nst plotstm pscgen pschart psfd rdann \ rdsamp rr2ann rxr sampfreq sigamp sigavg skewedit \ - snip sortann sqrs sqrs125 sumann sumstats tach \ + snip sortann sqrs sqrs125 sumann sumstats tach time2sec \ wabp wfdbcat wfdbcollate wfdb-config wfdbdesc wfdbwhich wqrs \ wrann wrsamp xform SCRIPTS = cshsetwfdb setwfdb diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/app/epicmp.c wfdb-10.3.8/app/epicmp.c --- wfdb-10.3.7/app/epicmp.c Fri Nov 22 14:32:02 2002 +++ wfdb-10.3.8/app/epicmp.c Thu Jul 10 13:22:14 2003 @@ -1,9 +1,9 @@ -/* file: epicmp.c G. Moody 3 March 1992 - Last revised: 14 November 2002 +/* file: epicmp.c G. Moody 3 March 1992 + Last revised: 10 July 2003 ------------------------------------------------------------------------------- epicmp: ANSI/AAMI-standard episode-by-episode annotation file comparator -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -61,6 +61,7 @@ comparison */ int aflag, sflag, s0flag, s1flag, vflag; +char *lzmstimstr(), *zmstimstr(); main(argc, argv) int argc; @@ -110,11 +111,11 @@ char *pname; /* name by which this program was invoked */ char *record; char *afname, *sfname, *s0fname, *s1fname, *vfname; -int match, mismatch, nexcl, overlap_ex0, overlap_ex1; +int Iflag, match, mismatch, nexcl, overlap_ex0, overlap_ex1; long start_time, end_time, min_length, total_duration, total_overlap; long ep_start[2], ep_ex0[2], ep_ex1[2], ep_end[2]; long ex_start[MAXEXCL], ex_end[MAXEXCL]; -long ref_duration, test_duration, STP, FN, PTP, FP; +long ref_duration, ref_overlap, test_duration, test_overlap, STP, FN, PTP, FP; WFDB_Anninfo an[2]; /* Perform an episode-by-episode comparison. */ @@ -137,16 +138,14 @@ if (stat == 0) { a = 0; b = 1; - ref_duration = 0L; - STP = FN = 0L; + ref_duration = ref_overlap = STP = FN = 0L; } /* Otherwise, check positive predictivity; in this case, annotator 1 defines the location of episodes. */ else { a = 1; b = 0; - test_duration = 0L; - PTP = FP = 0L; + test_duration = test_overlap = PTP = FP = 0L; } /* Initialize state variables. */ @@ -155,7 +154,7 @@ ep_start[0] = ep_start[1] = ep_end[0] = ep_end[1] = 0L; ep_ex0[0] = ep_ex0[1] = ep_ex1[0] = ep_ex1[1] = 0L; - /* Find the first annotator a episode which ends during the test period. */ + /* Find the first annotator a episode that ends during the test period. */ do { find_episode(a, type); } while (0L < ep_end[a] && ep_end[a] < start_time); @@ -272,11 +271,13 @@ STP = match; FN = mismatch; ref_duration = total_duration; + ref_overlap = total_overlap; } else { PTP = match; FP = mismatch; test_duration = total_duration; + test_overlap = total_overlap; } } @@ -403,7 +404,7 @@ } /* This function finds and marks (in the ex_start and ex_end arrays) any - intervals which are to be excluded from the comparison. The only case + intervals that are to be excluded from the comparison. The only case in which such intervals are currently defined is that of atrial fibrillation positive predictivity comparisons, from which intervals of reference-marked atrial flutter are excluded. */ @@ -415,7 +416,7 @@ if (stat == 1 && type == AFE) { if (iannsettime(0L) < 0) exit(2); - /* Find the first exclusion which ends after the beginning of the test + /* Find the first exclusion that ends after the beginning of the test period. */ do { find_episode(0, AFLE); @@ -471,14 +472,20 @@ /* There is at least some overlap -- determine its extent. */ do { - /* Ignore any portion of the current episode which precedes the + /* Ignore any episodes shorter than the minimum length if using -I */ + if (Iflag && ep_end[annotator] - ep_start[annotator] < min_length) { + find_episode(annotator, type); + continue; + } + + /* Ignore any portion of the current episode that precedes the beginning of the window. */ if (ep_start[annotator] < ep_start[1-annotator]) o_start = ep_start[1-annotator]; else o_start = ep_start[annotator]; - /* Ignore any portion of the current episode which follows the end of + /* Ignore any portion of the current episode that follows the end of the window. */ if (ep_end[annotator] > ep_end[1-annotator]) o_end = ep_end[1-annotator]; @@ -490,7 +497,7 @@ /* If the definition of exclusions is ever changed, it may be necessary to check explicitly here to see if the interval from o_start to - o_end includes any periods which are to be excluded from the + o_end includes any periods that are to be excluded from the comparison; in such a case, the duration of such periods must be subtracted from the overlap tally. Given the current definition of exclusions, this case should never happen. */ @@ -564,7 +571,7 @@ /* This function compares ST measurements. Since reference measurements are only available at the extremum of each episode, stdc finds the test - measurement which is nearest in time to each reference measurement. + measurement that is nearest in time to each reference measurement. Each pair of measurements is recorded in the output file. */ void stdc(mode) @@ -664,29 +671,33 @@ char *s; long a, b; { - char *lmstimstr(); - if (!lflag) { (void)fprintf(ofile, "%s:", s); if (b <= 0) (void)fprintf(ofile, " - "); else (void)fprintf(ofile, " %3d%%", (int)((100.*a)/b + 0.5)); - (void)fprintf(ofile, " (%s", lmstimstr(a)); - (void)fprintf(ofile, "/%s)\n", lmstimstr(b)); + (void)fprintf(ofile, " (%s", lzmstimstr(a)); + (void)fprintf(ofile, "/%s)\n", lzmstimstr(b)); } else if (b <= 0) (void)fprintf(ofile, " -"); else (void)fprintf(ofile, " %3d", (int)((100.*a)/b + 0.5)); } -char *lmstimstr(t) +char *lzmstimstr(t) long t; { - char *p = mstimstr(t); + char *p = zmstimstr(t); while (*p == ' ') p++; return (p); } +char *zmstimstr(t) +long t; +{ + return (t ? mstimstr(t) : " 0.000"); +} + void print_results(type) int type; { @@ -782,16 +793,16 @@ } pstat(" Episode sensitivity", STP, STP + FN); pstat(" Episode positive predictivity", PTP, PTP + FP); - tstat(" Duration sensitivity", total_overlap, ref_duration); - tstat("Duration positive predictivity", total_overlap, test_duration); + tstat(" Duration sensitivity", ref_overlap, ref_duration); + tstat("Duration positive predictivity", test_overlap, test_duration); if (!lflag) (void)fprintf(ofile, "Duration of reference episodes:"); - (void)fprintf(ofile, " %s", mstimstr(ref_duration)); + (void)fprintf(ofile, " %s", zmstimstr(ref_duration)); if (!lflag) (void)fprintf(ofile, "\n Duration of test episodes:"); else (void)fprintf(ofile, " "); - (void)fprintf(ofile, " %s\n", mstimstr(test_duration)); + (void)fprintf(ofile, " %s\n", zmstimstr(test_duration)); if (ofile != stdout) (void)fclose(ofile); @@ -840,10 +851,13 @@ help(); exit(1); break; + case 'I': /* ignore short intervals when calculating overlap */ + Iflag = 1; /* fall through to -i */ case 'i': /* minimum episode length follows */ if (++i >= argc) { (void)fprintf(stderr, - "%s: minimum episode length must follow -i\n", pname); + "%s: minimum episode length must follow %s\n", pname, + argv[i-1]); exit(1); } min_length = i; @@ -969,7 +983,8 @@ " -f TIME begin comparison at specified TIME (default: 5 minutes", " after beginning of record)", " -h print this usage summary", - " -i TIME ignore episodes shorter than TIME (default: 0 seconds)", + " -i TIME exclude episodes shorter than TIME from episode statistics", + " -I TIME exclude episodes shorter than TIME from all statistics", " -l write reports in line format (default: matrix format)", " -L same as -l", " -S FILE FILE2 append ST reports for both signals to FILE, and ST", diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/app/pschart.c wfdb-10.3.8/app/pschart.c --- wfdb-10.3.7/app/pschart.c Thu Nov 14 17:29:07 2002 +++ wfdb-10.3.8/app/pschart.c Tue Jul 8 23:02:05 2003 @@ -1,9 +1,9 @@ -/* file: pschart.c G. Moody 15 March 1988 - Last revised: 14 November 2002 +/* file: pschart.c G. Moody 15 March 1988 + Last revised: 8 July 2003 ------------------------------------------------------------------------------- pschart: Produce annotated `chart recordings' on a PostScript device -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1350,16 +1350,16 @@ "%%%%DocumentFonts: Times-Roman Times-Italic Courier Symbol\n"); if (Lflag == 0) (void)printf("%%%%BoundingBox: %d %d %d %d\n", - (int)(lmargin*72.0/25.4 - 36.0), + (int)(lmargin*72.0/25.4 - 72.0), (int)(footer_y*72.0/25.4 - 8.0), - (int)((p_width - rmargin)*72.0/25.4 + 8.0), + (int)((p_width - rmargin)*72.0/25.4 + 44.0), (int)(title_y*72.0/25.4 + 8.0)); else (void)printf("%%%%BoundingBox: %d %d %d %d\n", (int)(footer_y*72.0/25.4 - 8.0), - (int)(lmargin*72.0/25.4 - 36.0), + (int)(lmargin*72.0/25.4 - 72.0), (int)(title_y*72.0/25.4 + 8.0), - (int)((p_width - rmargin)*72.0/25.4 + 8.0)); + (int)((p_width - rmargin)*72.0/25.4 + 44.0)); (void)printf("%%%%EndComments\n"); (void)printf("%%%%EndProlog\n"); } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/app/time2sec.c wfdb-10.3.8/app/time2sec.c --- wfdb-10.3.7/app/time2sec.c Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.8/app/time2sec.c Wed Jul 9 07:23:59 2003 @@ -0,0 +1,56 @@ +/* file: time2sec.c G. Moody 9 July 2003 + +------------------------------------------------------------------------------- +time2sec: Convert a string in WFDB standard time format to time in seconds + +Copyright (C) 2003 George B. Moody + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA. + +You may contact the author by e-mail (george@mit.edu) or postal mail +(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, +please visit PhysioNet (http://www.physionet.org/). +_______________________________________________________________________________ +*/ + +#include +#include + +main(argc, argv) +int argc; +char **argv; +{ + double t; + + if (argc == 4 && strcmp(argv[1], "-r") == 0) { + (void)isigopen(argv[2], NULL, 0); + t = strtim(argv[3]); + if (t < 0) t = -t; + printf("%g\n", t/sampfreq(NULL)); + exit(0); + } + else if (argc == 2 && argv[1][0] != '-') { + setsampfreq(1000.0); + printf("%g\n", strtim(argv[1])/1000.0); + exit(0); + } + + fprintf(stderr, "usage: %s [-r RECORD] TIME\n", argv[0]); + fprintf(stderr, " where TIME (in hh:mm:ss format) is a time interval\n"); + fprintf(stderr, " to be converted into seconds. Enclose TIME in\n"); + fprintf(stderr, " square brackets (e.g., [9:0:0]) to convert a time\n"); + fprintf(stderr, " of day to the elapsed time in seconds from the\n"); + fprintf(stderr, " beginning of the (optionally) specified RECORD.\n"); + exit(1); +} diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/app/wfdbdesc.c wfdb-10.3.8/app/wfdbdesc.c --- wfdb-10.3.7/app/wfdbdesc.c Thu Nov 14 19:15:56 2002 +++ wfdb-10.3.8/app/wfdbdesc.c Wed Jul 9 14:22:24 2003 @@ -1,9 +1,9 @@ /* file: wfdbdesc.c G. Moody June 1989 - Last revised: 14 November 2002 + Last revised: 9 July 2003 ------------------------------------------------------------------------------- wfdbdesc: Describe signal specifications -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -47,10 +47,10 @@ exit(1); } /* Discover the number of signals defined in the header. */ - if ((nsig = isigopen(argv[1], NULL, 0)) < 1) exit(2); + if ((nsig = isigopen(argv[1], NULL, 0)) < 0) exit(2); /* Allocate storage for nsig signal information structures. */ - if ((s = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL) { + if (nsig > 0 && (s = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL) { fprintf(stderr, "%s: insufficient memory\n", pname); exit(2); } @@ -58,14 +58,14 @@ /* If the `-readable' option is given, report only on signals which can be opened. Otherwise, report on all signals named in the header file, without attempting to open them. */ - if (argc > 2 && strncmp(argv[2], "-readable", strlen(argv[2])) == 0) + if (nsig > 0 && argc > 2 && + strncmp(argv[2], "-readable", strlen(argv[2])) == 0) nsig = isigopen(argv[1], s, nsig); - else + else if (nsig > 0) nsig = isigopen(argv[1], s, -nsig); - if (nsig < 1) exit(2); (void)printf("Record %s", argv[1]); t = strtim("e"); - if (s[0].nsamp != t) { + if (nsig > 0 && s[0].nsamp != t) { msrec = 1; (void)printf(" (a multi-segment record)\n"); (void)printf("----------------------------------------------\n"); @@ -82,9 +82,9 @@ p = mstimstr(0L); (void)printf("\nStarting time: %s\n", *p == '[' ? p : "not specified"); (void)printf("Length: "); - if (t > 0L) + if (nsig < 1 || t > 0L) (void)printf("%s (%ld sample intervals)\n", - mstimstr(t), t); + t > 0L ? mstimstr(t) : "0", t); else if (s[0].fmt && (ifile = fopen(s[0].fname, "rb")) && (fseek(ifile, 0L, 2) == 0)) { int framesize = 0; @@ -116,6 +116,7 @@ else (void)printf("not specified\n"); (void)printf("Sampling frequency: %g Hz\n", sampfreq(NULL)); (void)printf("%d signal%s\n", nsig, nsig == 1 ? "" : "s"); + if (nsig < 1) exit(2); if (msrec) { (void)printf("----------------------------------------------\n"); (void)printf("The following data apply to the first segment:\n"); diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/checkpkg/expected/pschart.ps wfdb-10.3.8/checkpkg/expected/pschart.ps --- wfdb-10.3.7/checkpkg/expected/pschart.ps Wed Sep 12 14:32:20 2001 +++ wfdb-10.3.8/checkpkg/expected/pschart.ps Wed Jul 9 13:59:45 2003 @@ -3,7 +3,7 @@ %%Title: Chart Recording %%Pages: (atend) %%DocumentFonts: Times-Roman Times-Italic Courier Symbol -%%BoundingBox: 47 27 516 743 +%%BoundingBox: 11 27 552 743 %%EndComments %%EndProlog %%Page: 1 1 diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/conf/version.def wfdb-10.3.8/conf/version.def --- wfdb-10.3.7/conf/version.def Wed Apr 9 12:18:51 2003 +++ wfdb-10.3.8/conf/version.def Thu Jun 5 23:07:49 2003 @@ -1,10 +1,10 @@ # file: version.def G. Moody 24 May 2000 -# Last revised: 9 April 2003 +# Last revised: 5 June 2003 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 7 +RELEASE = 8 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/convert/makeid.c wfdb-10.3.8/convert/makeid.c --- wfdb-10.3.7/convert/makeid.c Wed May 24 22:35:27 2000 +++ wfdb-10.3.8/convert/makeid.c Thu Jun 5 23:00:00 2003 @@ -1,9 +1,9 @@ /* file: makeid.c G. Moody 19 July 1983 - Last revised: 7 May 1999 + Last revised: 5 June 2003 ------------------------------------------------------------------------------- makeid: Make an AHA-format ID block for a database record -Copyright (C) 1999 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -22,9 +22,6 @@ (MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, please visit PhysioNet (http://www.physionet.org/). _______________________________________________________________________________ - -Note: the record name and copyright message generated by this program are -appropriate for the MIT/BIH database but not for other databases. */ #include @@ -34,24 +31,39 @@ #include +void p16(x, fp) /* write a 16-bit integer in PDP-11 format */ +unsigned int x; +FILE *fp; +{ + (void)fputc((char)x, fp); + (void)fputc((char)(x >> 8), fp); +} + +void p32(x, fp) /* write a 32-bit integer in PDP-11 format */ +long x; +FILE *fp; +{ + p16((unsigned int)(x >> 16), fp); + p16((unsigned int)x, fp); +} + main(argc, argv) int argc; char *argv[]; { long ftell(), nsamp, first, last; int blocks, len, nann; - static char nulls[299]; + static char nulls[464]; WFDB_Anninfo afarray[1]; WFDB_Siginfo dfarray[2]; WFDB_Annotation annot; - extern void wfdb_p16(), wfdb_p32(); if (argc < 3) { (void)fprintf(stderr, "usage: %s annotator record\n", argv[0]); exit(1); } - if ((len = strlen(argv[2])) > 5) { - (void)fprintf(stderr, "record name must be 5 characters or less\n"); + if ((len = strlen(argv[2])) > 8) { + (void)fprintf(stderr, "record name must be 8 characters or less\n"); exit(1); } afarray[0].name = argv[1]; afarray[0].stat = WFDB_READ; @@ -68,12 +80,13 @@ wfdbquit(); /* Bytes 1-8: record ID (null-padded) */ - (void)printf("MIT%s", argv[2]); - (void)fwrite(nulls, 1, 5-len, stdout); - (void)fprintf(stderr, "MIT%s\n", argv[2]); + (void)printf("%s", argv[2]); + if (len < 8) + (void)fwrite(nulls, 1, 8-len, stdout); + (void)fprintf(stderr, "%s\n", argv[2]); /* Bytes 9-10: number of annotations */ - wfdb_p16((unsigned)nann, stdout); + p16((unsigned)nann, stdout); (void)fprintf(stderr, "%d annotations\n", nann); /* Bytes 11-16: unused */ @@ -81,18 +94,18 @@ /* Bytes 17-20: time of first sample in the annotated segment of the record, relative to the beginning of the record */ - wfdb_p32(0L, stdout); + p32(0L, stdout); (void)fprintf(stderr, "Annotated segment begins at sample 0\n"); /* Bytes 21-24: time of last sample in the annotated segment of the record, relative to the beginning of the record */ - wfdb_p32(nsamp, stdout); + p32(nsamp, stdout); (void)fprintf(stderr, "Annotated segment ends at sample %ld\n", nsamp); /* Bytes 25-26: number of 512-byte logical blocks of sample data (nsamp * 2 bytes per sample * 2 channels / 512, rounded upward) */ blocks = (nsamp + 127) >> 7; - wfdb_p16((unsigned)blocks, stdout); + p16((unsigned)blocks, stdout); (void)fprintf(stderr, "%d blocks of sample data\n", blocks); /* Bytes 27-32: unused */ @@ -100,30 +113,24 @@ /* Bytes 33-36: TOC of first annotation, relative to the beginning of the annotated segment */ - wfdb_p32(first, stdout); + p32(first, stdout); (void)fprintf(stderr, "First annotation is at sample %ld\n", first); /* Bytes 37-40: TOC of last annotation, relative to the beginning of the annotated segment */ - wfdb_p32(last, stdout); + p32(last, stdout); (void)fprintf(stderr, "Last annotation is at sample %ld\n", last); /* Bytes 41-42: number of 512-byte logical blocks of annotations (nann * 16 bytes per annotation / 512, rounded upward) */ blocks = (nann + 31) >> 5; - wfdb_p16((unsigned)blocks, stdout); + p16((unsigned)blocks, stdout); (void)fprintf(stderr, "%d blocks of annotations\n", blocks); /* Bytes 43-48: unused */ (void)fwrite(nulls, 1, 6, stdout); - /* Bytes 49-213: copyright notice */ - (void)printf("COPYRIGHT (C) MASSACHUSETTS INSTITUTE OF TECHNOLOGY AND\r\n"); - (void)printf("HARVARD UNIVERSITY, BIOMEDICAL ENGINEERING CENTER FOR\r\n"); - (void)printf("CLINICAL INSTRUMENTATION, 1993.\r\n"); - (void)printf("ALL RIGHTS RESERVED."); - - /* Bytes 214-512: unused */ - (void)fwrite(nulls, 1, 299, stdout); + /* Bytes 49-512: may contain information such as a copyright notice */ + (void)fwrite(nulls, 1, 464, stdout); exit(0); /*NOTREACHED*/ } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/convert/readid.c wfdb-10.3.8/convert/readid.c --- wfdb-10.3.7/convert/readid.c Sun Jan 30 04:13:17 2000 +++ wfdb-10.3.8/convert/readid.c Thu Jun 5 22:02:54 2003 @@ -1,9 +1,9 @@ /* file: readid.c G. Moody 8 August 1983 - Last revised: 7 May 1999 + Last revised: 5 June 2003 ------------------------------------------------------------------------------- readid: Read AHA-format ID block, write record name, file lengths on stdout -Copyright (C) 1999 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -30,6 +30,16 @@ extern void exit(); #endif +g16(fp) +FILE *fp; +{ + int h, l; + + l = fgetc(fp); + h = fgetc(fp); + return (((h << 8) & 0xff00) | (l & 0xff)); +} + main(argc, argv) int argc; char *argv[]; @@ -37,7 +47,6 @@ int dasize, ansize; long dcount, acount; static char buf[512], name[9]; - extern int wfdb_g16(); /* part of the WFDB library (see wfdbio.c) */ if (argc < 3) { (void)fprintf(stderr, "usage: %s data-block-size annot-block-size\n", @@ -46,11 +55,13 @@ } dasize = atoi(argv[1]); ansize = atoi(argv[2]); + if (dasize < 1) dasize = 1; + if (ansize < 1) ansize = 1; (void)fread(buf, 1, 24, stdin); (void)sscanf(buf, "%s", name); - dcount = (wfdb_g16(stdin) * 512L + dasize - 1) / dasize; + dcount = (g16(stdin) * 512L + dasize - 1) / dasize; (void)fread(buf, 1, 14, stdin); - acount = (wfdb_g16(stdin) * 512L + ansize - 1) / ansize; + acount = (g16(stdin) * 512L + ansize - 1) / ansize; (void)printf("%s %ld %ld\n", name, dcount, acount); exit(0); /*NOTREACHED*/ } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wag-src/epicmp.1 wfdb-10.3.8/doc/wag-src/epicmp.1 --- wfdb-10.3.7/doc/wag-src/epicmp.1 Fri Nov 22 14:48:18 2002 +++ wfdb-10.3.8/doc/wag-src/epicmp.1 Thu Jul 10 13:27:52 2003 @@ -1,4 +1,4 @@ -.TH EPICMP 1 "22 November 2002" "WFDB 10.3.0" "WFDB Applications Guide" +.TH EPICMP 1 "10 July 2003" "WFDB 10.3.8" "WFDB Applications Guide" .SH NAME epicmp \- ANSI/AAMI-standard episode-by-episode annotation comparator .SH SYNOPSIS @@ -29,7 +29,13 @@ Print a usage summary. .TP \fB-i\fR \fItime\fR -Ignore episodes shorter than \fItime\fR (default: 0 seconds). +Exclude episodes shorter than \fItime\fR (default: 0 seconds) from +episode statistics. +.TP +\fB-I\fR \fItime\fR +Exclude episodes shorter than \fItime\fR (default: 0 seconds) from +episode and duration statistics. +(At most one of \fB-i\fR and \fB-I\fR may be used.) .TP \fB-l\fR Write reports in line format (default: matrix format). @@ -139,10 +145,10 @@ .SH DIAGNOSTICS .TP \fInon-standard comparison selected\fR -The \fB-f\fR, \fB-i\fR, and \fB-t\fR options modify the comparison algorithms -used by \fBepicmp\fR in ways not permitted by EC38. These options are provided -for the use of developers, who may find them useful for obtaining a more -detailed understanding of algorithm errors. +The \fB-f\fR, \fB-i\fR, \fB-I\fR, and \fB-t\fR options modify the comparison +algorithms used by \fBepicmp\fR in ways not permitted by EC38. These options +are provided for the use of developers, who may find them useful for obtaining +a more detailed understanding of algorithm errors. .SH BUGS .PP Since \fBepicmp\fR performs multiple passes over its input files, it cannot be @@ -150,7 +156,7 @@ .PP Between 1992 and 2002, this program was known as \fBepic\fR; the name was changed to avoid conflict with a new but widely distributed IRC -chat client also named \fBepic\fR. By analogy to \fBbxb\fR and +chat client also named \fBepic\fR. By analogy to \fBbxb\fR, \fBmxm\fR, and \fBrxr\fR, this program should have been called \fBexe\fR, which would have created interesting possibilities for confusion. .SH SEE ALSO diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wag-src/fixag.sed wfdb-10.3.8/doc/wag-src/fixag.sed --- wfdb-10.3.7/doc/wag-src/fixag.sed Mon Apr 7 15:03:02 2003 +++ wfdb-10.3.8/doc/wag-src/fixag.sed Wed Jul 9 07:34:06 2003 @@ -9,6 +9,7 @@ s+sampfreq-1.htm+sampfr-1.htm+g s+setwfdb-1.htm+setwfd-1.htm+g s+sumstats-1.htm+sumsta-1.htm+g +s+time2sec-1.htm+time2s-1.htm+g s+wfdb-config-1.htm+wfdb-c-1.htm+g s+wfdbcal-5.htm+wfdbca-5.htm+g s+wfdbcollate-1.htm+wfdbco-1.htm+g diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wag-src/hrfft.1 wfdb-10.3.8/doc/wag-src/hrfft.1 --- wfdb-10.3.7/doc/wag-src/hrfft.1 Sun Jul 28 10:33:46 2002 +++ wfdb-10.3.8/doc/wag-src/hrfft.1 Mon Jun 16 15:43:10 2003 @@ -1,4 +1,4 @@ -.TH HRFFT 1 "28 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.TH HRFFT 1 "16 June 2003" "WFDB 10.3.8" "WFDB Applications Guide" .SH NAME hrfft, hrlomb, hrmem \- calculate and plot heart rate power spectra .br @@ -36,6 +36,10 @@ Begin at the specified \fItime\fR within the annotation file (default: the value of the environment variable \fBSTART\fR, if set, or the beginning of the file otherwise). +.TP +\fB-l\fR \fIaxes\fR +Log-transform the specified \fIaxes\fR (default: use linear axes). The +\fIaxes\fR can be specified as \fBx\fR, \fBy\fR, or \fBxy\fR. .TP \fB-p\fR \fIplot-utility\fR Use the specified \fIplot-utility\fR to generate the output (default: the diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wag-src/lomb.1 wfdb-10.3.8/doc/wag-src/lomb.1 --- wfdb-10.3.7/doc/wag-src/lomb.1 Tue Jul 30 21:25:28 2002 +++ wfdb-10.3.8/doc/wag-src/lomb.1 Mon Jun 16 14:39:33 2003 @@ -1,4 +1,4 @@ -.TH LOMB 1 "30 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.TH LOMB 1 "16 June 2003" "WFDB 10.3.8" "WFDB Applications Guide" .SH NAME lomb \- estimate power spectrum using the Lomb periodogram method .SH SYNOPSIS @@ -26,8 +26,15 @@ \fB-h\fR Print a usage summary. .TP +\fB-P\fR +Generate a power spectrum (print squared magnitudes). +.TP \fB-s\fR Smooth the output. +.TP +\fB-z\fR +Add a constant to each input sample, chosen such that the mean value of the +entire series is zero. .PP Among many other applications, this program can be used to estimate heart rate power spectra, in combination with \fBihr\fR(1). The Lomb diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wag-src/memse.1 wfdb-10.3.8/doc/wag-src/memse.1 --- wfdb-10.3.7/doc/wag-src/memse.1 Tue Jul 30 15:34:12 2002 +++ wfdb-10.3.8/doc/wag-src/memse.1 Mon Jun 16 14:39:23 2003 @@ -1,4 +1,4 @@ -.TH MEMSE 1 "30 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.TH MEMSE 1 "16 June 2003" "WFDB 10.3.8" "WFDB Applications Guide" .SH NAME memse \- estimate power spectrum using maximum entropy (all poles) method .SH SYNOPSIS @@ -51,11 +51,6 @@ \fB-h\fR Print a usage summary. .TP -\fB-l\fR \fIn\fR -Handle input series up to \fIn\fR points in length. Default: \fIn\fR = 16384, -although you should be cautious about using \fImemse\fR with such long input -series. -.TP \fB-n\fR \fIn\fR Produce exactly \fIn\fR power estimates, evenly spaced in frequency from 0 up to half the input sampling frequency inclusive. The default depends on @@ -69,7 +64,7 @@ Use an \fIn\fRth order model (i.e., up to \fIn\fR poles). Default: the square root of the number of input samples. .TP -\fB-P\fR \fIn\fR +\fB-P\fR Generate a power spectrum (print squared magnitudes). .TP \fB-w\fR \fIwindow-type\fR diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wag-src/time2sec.1 wfdb-10.3.8/doc/wag-src/time2sec.1 --- wfdb-10.3.7/doc/wag-src/time2sec.1 Wed Dec 31 19:00:00 1969 +++ wfdb-10.3.8/doc/wag-src/time2sec.1 Wed Jul 9 07:32:48 2003 @@ -0,0 +1,24 @@ +.TH TIME2SEC 1 "9 July 2003" "WFDB 10.3.8" "WFDB Applications Guide" +.SH NAME +time2sec \- read signal specifications +.SH SYNOPSIS +\fBtime2sec\fR [ \fB-r\fR \fIrecord\fR ] \fItime\fR +.SH DESCRIPTION +This program converts the specified time interval, \fItime\fR (in WFDB +standard time format), into seconds. Enclose TIME in square brackets +(e.g., [9:0:0]) to convert a time of day to the elapsed time in seconds +from the beginning of the (optionally) specified RECORD. +.SH ENVIRONMENT +.PP +It may be necessary to set and export the shell variable \fBWFDB\fR (see +\fBsetwfdb\fR(1)). +.SH FILES +.TP 22 +\fIrecord\fR.hea +header file +.SH SEE ALSO +\fBsetwfdb\fR(1) +.SH AUTHOR +George B. Moody (george@mit.edu) +.SH SOURCE +http://www.physionet.org/physiotools/wfdb/app/time2sec.c diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/doc/wpg-src/wpg0.tex wfdb-10.3.8/doc/wpg-src/wpg0.tex --- wfdb-10.3.7/doc/wpg-src/wpg0.tex Mon Apr 7 10:52:57 2003 +++ wfdb-10.3.8/doc/wpg-src/wpg0.tex Sat Jul 12 02:43:58 2003 @@ -488,6 +488,15 @@ WFDB Software Package distribution, for information on any more recent changes that may not be described here. +@unnumberedsubsec Changes in version 10.3.8 + +The WFDB library function @code{setbasetime()} now properly +accepts arguments specifying midnight (e.g., @samp{0:0:0}), which previous +versions rejected, and the function @code{setheader()} +records such times correctly in the @file{.hea} files it creates. + +(WFDB library version 10.3.7 was identical to 10.3.6.) + @unnumberedsubsec Changes in version 10.3.6 The fix applied in @code{isigclose()} in 10.3.5 was incomplete but is now diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/lib/signal.c wfdb-10.3.8/lib/signal.c --- wfdb-10.3.7/lib/signal.c Mon Apr 7 11:23:48 2003 +++ wfdb-10.3.8/lib/signal.c Wed Jul 9 14:14:52 2003 @@ -1,5 +1,5 @@ /* file: signal.c G. Moody 13 April 1989 - Last revised: 7 April 2003 wfdblib 10.3.6 + Last revised: 9 July 2003 wfdblib 10.3.8 WFDB library functions for signals _______________________________________________________________________________ @@ -2251,7 +2251,9 @@ } (void)wfdb_fprintf(oheader, " %ld", nsig > 0 ? siarray[0].nsamp : 0L); if (btime != 0L || bdate != (WFDB_Date)0) { - if (btime % 1000 == 0) + if (btime == 0L) + (void)wfdb_fprintf(oheader, " 0:00"); + else if (btime % 1000 == 0) (void)wfdb_fprintf(oheader, " %s", timstr((WFDB_Time)(btime*sfreq/1000.0))); else @@ -2566,12 +2568,13 @@ while (*string == ' ') string++; if (p = strchr(string, ' ')) *p++ = '\0'; /* split time and date components */ - if ((btime = strtim(string)) == 0L) { + btime = strtim(string); + bdate = p ? strdat(p) : (WFDB_Date)0; + if (btime == 0L && bdate == (WFDB_Date)0 && *string != '[') { if (p) *(--p) = ' '; wfdb_error("setbasetime: incorrect time format, '%s'\n", string); return (-1); } - if (p) bdate = strdat(p); btime *= 1000.0/sfreq; return (0); } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/lib/wfdb.h0 wfdb-10.3.8/lib/wfdb.h0 --- wfdb-10.3.7/lib/wfdb.h0 Wed Apr 9 12:19:10 2003 +++ wfdb-10.3.8/lib/wfdb.h0 Wed Jul 9 13:29:20 2003 @@ -1,5 +1,5 @@ /* file: wfdb.h G. Moody 13 June 1983 - Last revised: 9 April 2003 wfdblib 10.3.7 + Last revised: 9 July 2003 wfdblib 10.3.8 WFDB library type, constant, structure, and function interface definitions _______________________________________________________________________________ @@ -33,7 +33,7 @@ /* WFDB library version. */ #define WFDB_MAJOR 10 #define WFDB_MINOR 3 -#define WFDB_RELEASE 7 +#define WFDB_RELEASE 8 #define WFDB_NETFILES 1 /* if 1, library includes code for HTTP, FTP clients */ /* Determine what type of compiler is being used. */ diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/Makefile.top wfdb-10.3.8/psd/Makefile.top --- wfdb-10.3.7/psd/Makefile.top Wed May 31 05:45:03 2000 +++ wfdb-10.3.8/psd/Makefile.top Mon Jun 16 16:12:48 2003 @@ -1,9 +1,9 @@ # file: Makefile G. Moody 9 December 1991 -# Last revised: 23 May 2000 +# Last revised: 16 June 2003 # # ----------------------------------------------------------------------------- # `make' description file for PSD estimation programs -# Copyright (C) 2000 George B. Moody +# Copyright (C) 2003 George B. Moody # # These programs are free software; you can redistribute them and/or modify # them under the terms of the GNU General Public License as published by the @@ -28,6 +28,5 @@ # density (PSD) estimation applications that come with the WFDB Software # Package. Before using it for the first time, check that the site-specific # variables below are appropriate for your system. To build and install these -# applications and their man pages, just type `make' (from within this -# directory). +# applications, just type `make' (from within this directory). # _____________________________________________________________________________ diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/README wfdb-10.3.8/psd/README --- wfdb-10.3.7/psd/README Sat Oct 26 12:03:07 2002 +++ wfdb-10.3.8/psd/README Mon Jun 16 16:11:39 2003 @@ -24,19 +24,19 @@ _______________________________________________________________________________ This directory contains sources for applications for power spectral density -(PSD) estimation, and sample UNIX shell scripts for using these applications to +(PSD) estimation, and sample Unix shell scripts for using these applications to obtain heart rate power spectra based upon beat annotation files. The scripts -require `ihr' and `tach' from the `app' directory (at the same level as this -one), and also require either `plt' (not generally available) or `gnuplot' -(a freely available plotting utility) for output. The programs to be compiled -within this directory are independent of the DB Software Package, and require -only the standard C math library. This directory also contains documentation -for these programs and scripts in the form of UNIX man pages. +require 'ihr' and 'tach' from the '../app' directory, and also require either +'plt' or 'gnuplot' for output. (See http://www.physionet.org/physiotools/plt/ +or http://www.gnuplot.info/.) The programs to be compiled within this +directory are independent of the remainder of the WFDB Software Package, and +require only the standard C math library. The directory '../doc/wag-src' +contains documentation for these programs and scripts in the form of Unix man +pages. -These programs were written for and tested under SunOS, Solaris, and Linux, -although they should be portable to other operating systems, including MS-DOS. -The shell scripts are UNIX-specific, but should be easy to adapt to MS-DOS. -Note that versions of `gnuplot' are available for both MS-DOS and MS-Windows. +These programs were written for SunOS, Solaris, and GNU/Linux; they are also +portable to and have been tested with other versions of Unix, as well as +MacOS X and MS-Windows (with the free Cygwin toolkit, http://www.cygwin.com/). Follow the instructions in `Makefile' to install these applications and their man pages on your system. diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/hrfft wfdb-10.3.8/psd/hrfft --- wfdb-10.3.7/psd/hrfft Wed Feb 19 22:20:04 2003 +++ wfdb-10.3.8/psd/hrfft Tue Jun 17 09:58:21 2003 @@ -1,6 +1,6 @@ #! /bin/sh # file: hrfft G. Moody 14 June 1995 -# Last revised: 19 February 2003 +# Last revised: 16 June 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate power spectrum (using tach and fft) and plot it @@ -25,11 +25,24 @@ # please visit PhysioNet (http://www.physionet.org/). # _____________________________________________________________________________ +X=2 +XL="Frequency (Hz)" +XOPT="0 1" +Y=3 +YL="Power" +YOPT="" + while [ $# -gt 1 ] do case $1 in -a) ANNOTATOR=$2 ;; -f) START=$2 ;; + -l) case $2 in + x|X) X=0; XL="log Frequency (Hz)"; XOPT="-4 1 -lx" ;; + y|Y) Y=1; YL="log Power"; YOPT="-ly" ;; + *) X=0; XL="log Frequency (Hz)" ; XOPT="-4 1 -lx"; + Y=1; YL="log Power"; YOPT="-ly";; + esac ;; -p) PLOT=$2 ;; -r) RECORD=$2 ;; -t) END=$2 ;; @@ -94,7 +107,6 @@ fi tach -r $RECORD -a $ANNOTATOR -f $START -t $END -F 4 | \ - fft -f 4 -P -w Welch -Z - | \ - $PLOT 0 1 -x "Frequency (Hz)" -y "Power" \ - -t "Record $RECORD ($START - $END): Heart rate spectrum (FFT)" \ - -X 0 1 $PLOTOUT + fft -f 4 -P -w Welch -Z - | log10 | \ + $PLOT $X $Y -x "$XL" -X $XOPT -y "$YL" $YOPT \ + -t "Record $RECORD ($START - $END): Heart rate spectrum (FFT)" $PLOTOUT diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/hrlomb wfdb-10.3.8/psd/hrlomb --- wfdb-10.3.7/psd/hrlomb Wed Feb 19 22:19:56 2003 +++ wfdb-10.3.8/psd/hrlomb Mon Jun 16 15:27:47 2003 @@ -1,6 +1,6 @@ #! /bin/sh # file: hrlomb G. Moody 14 June 1995 -# Last revised: 19 February 2003 +# Last revised: 16 June 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate power spectrum (using ihr and lomb) and plot it @@ -25,11 +25,22 @@ # please visit PhysioNet (http://www.physionet.org/). # _____________________________________________________________________________ +X=2 +XL="Frequency (Hz)" +XOPT="0 1" +Y=3 +YL="Power" + while [ $# -gt 1 ] do case $1 in -a) ANNOTATOR=$2 ;; -f) START=$2 ;; + -l) case $2 in + x|X) X=0; XL="log Frequency (Hz)"; XOPT="-4 1" ;; + y|Y) Y=1; YL="log Power" ;; + *) X=0; XL="log Frequency (Hz)" ; XOPT="-4 1"; Y=1; YL="log Power";; + esac ;; -p) PLOT=$2 ;; -r) RECORD=$2 ;; -t) END=$2 ;; @@ -95,7 +106,6 @@ fi ihr -r $RECORD -a $ANNOTATOR -f $START -t $END -x | \ - lomb -s - | \ - $PLOT 0 1 -x "Frequency (Hz)" -y "Power" \ - -t "Record $RECORD ($START - $END): Heart rate spectrum (Lomb)" \ - -X 0 1 $PLOTOUT + lomb -P -s - | log10 | \ + $PLOT $X $Y -x "$XL" -X $XOPT -y "$YL" \ + -t "Record $RECORD ($START - $END): Heart rate spectrum (Lomb)" $PLOTOUT diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/hrmem wfdb-10.3.8/psd/hrmem --- wfdb-10.3.7/psd/hrmem Wed Feb 19 22:19:47 2003 +++ wfdb-10.3.8/psd/hrmem Mon Jun 16 15:40:48 2003 @@ -1,6 +1,6 @@ #! /bin/sh # file: hrmem G. Moody 14 June 1995 -# Last revised: 18 February 2003 +# Last revised: 16 June 2003 # # ----------------------------------------------------------------------------- # Derive a heart rate power spectrum (using tach and memse) and plot it @@ -25,11 +25,22 @@ # please visit PhysioNet (http://www.physionet.org/). # _____________________________________________________________________________ +X=2 +XL="Frequency (Hz)" +XOPT="0 1" +Y=3 +YL="Power" + while [ $# -gt 1 ] do case $1 in -a) ANNOTATOR=$2 ;; -f) START=$2 ;; + -l) case $2 in + x|X) X=0; XL="log Frequency (Hz)"; XOPT="-4 1" ;; + y|Y) Y=1; YL="log Power" ;; + *) X=0; XL="log Frequency (Hz)" ; XOPT="-4 1"; Y=1; YL="log Power";; + esac ;; -p) PLOT=$2 ;; -r) RECORD=$2 ;; -t) END=$2 ;; @@ -94,7 +105,6 @@ fi tach -r $RECORD -a $ANNOTATOR -f $START -t $END -F 4 | \ - memse -f 4 -w Welch -Z - | \ - $PLOT 0 1 -x "Frequency (Hz)" -y "Power" \ - -t "Record $RECORD ($START - $END): Heart rate spectrum (MEM)" \ - -X 0 1 $PLOTOUT + memse -f 4 -P -w Welch -Z - | log10 | \ + $PLOT $X $Y -x "$XL" -X $XOPT -y "$YL" \ + -t "Record $RECORD ($START - $END): Heart rate spectrum (MEM)" $PLOTOUT diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/lomb.c wfdb-10.3.8/psd/lomb.c --- wfdb-10.3.7/psd/lomb.c Tue May 23 23:20:14 2000 +++ wfdb-10.3.8/psd/lomb.c Mon Jun 16 14:22:23 2003 @@ -1,9 +1,9 @@ /* file: lomb.c G. Moody 12 February 1992 - Last revised: 23 May 2000 + Last revised: 16 June 2003 ------------------------------------------------------------------------------- lomb: Lomb periodogram of real data -Copyright (C) 2000 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -44,12 +44,6 @@ #include #include -#ifndef hpux -#define NMAX 65536 /* maximum number of inputs */ -#else -#define NMAX 64000 -#endif - static long lmaxarg1, lmaxarg2; #define LMAX(a,b) (lmaxarg1 = (a),lmaxarg2 = (b), (lmaxarg1 > lmaxarg2 ? \ lmaxarg1 : lmaxarg2)) @@ -73,7 +67,7 @@ unsigned long nwk, *nout, *jmax; float *prob; { - void avevar(), realft(), spread(); + void avevar(), realft(), spread(), error(); unsigned long j, k, ndim, nfreq, nfreqt; float ave, ck, ckk, cterm, cwt, den, df, effm, expy, fac, fndim, hc2wt, hs2wt, hypo, pmax, sterm, swt, var, xdif, xmax, xmin; @@ -83,10 +77,8 @@ nfreq = 64; while (nfreq < nfreqt) nfreq <<= 1; ndim = nfreq << 1; - if (ndim > nwk) { - fprintf(stderr, "%s: workspaces too small\n", pname); - exit(1); - } + if (ndim > nwk) + error("workspaces too small\n"); avevar(y, n, &ave, &var); xmax = xmin = x[1]; for (j = 2; j <= n; j++) { @@ -138,11 +130,10 @@ int ihi, ilo, ix, j, nden; static int nfac[11] = { 0, 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880 }; float fac; + void error(); - if (m > 10) { - fprintf(stderr, "%s: factorial table too small\n", pname); - exit(1); - } + if (m > 10) + error("factorial table too small"); ix = (int)x; if (x == (float)ix) yy[ix] += y; else { @@ -275,16 +266,22 @@ } } +FILE *ifile; +float *x, *y, *wk1, *wk2; +long nmax = 512L; /* Initial buffer size (must be a power of 2). + Note that input() will increase this value as + necessary by repeated doubling, depending on + the length of the input series. */ + main(argc, argv) int argc; char *argv[]; { char *prog_name(); - FILE *ifile = NULL; - int i, sflag=0, aflag=1; - static float x[NMAX], y[NMAX], wk1[64*NMAX], wk2[64*NMAX], prob; - unsigned long n, nout, jmax, maxout; - void help(); + float prob; + int aflag = 1, i, sflag = 0, zflag = 0; + unsigned long n, nout, jmax, maxout, input(); + void help(), zeromean(); pname = prog_name(argv[0]); for (i = 1; i < argc; i++) { @@ -299,6 +296,9 @@ case 'P': /* output powers instead of amplitudes */ aflag = 0; break; + case 'z': /* zero-mean the input */ + zflag = 1; + break; case '\0': /* read data from standard input */ ifile = stdin; break; @@ -320,18 +320,26 @@ } /* Read input. */ - for (n = 0; (n < NMAX) && (fscanf(ifile, "%f%f", &x[n], &y[n]) == 2); n++) - ; + n = input(); - /* Compute the Lomb periodogram. */ - fasper(x-1, y-1, n, 4.0, 2.0, wk1-1, wk2-1, 64*NMAX, &nout, &jmax, &prob); + /* Zero-mean the input if requested. */ + if (zflag) zeromean(n); - /* Write the results. The normalization is by half the number of output - samples; the sum of the outputs is (approximately) the mean square of - the inputs. */ + /* Compute the Lomb periodogram. */ + fasper(x-1, y-1, n, 4.0, 2.0, wk1-1, wk2-1, 64*nmax, &nout, &jmax, &prob); - maxout = nout/2; /* output only up to nyquist freq */ + /* Write the results. Output only up to Nyquist frequency, so that the + results are directly comparable to those obtained using conventional + methods. The normalization is by half the number of output samples; the + sum of the outputs is (approximately) the mean square of the inputs. + + Note that the Nyquist frequency is not well-defined for an irregularly + sampled series. Here we use half of the mean sampling frequency, but + the Lomb periodogram can return (less reliable) estimates of frequency + content for frequencies up to half of the maximum sampling frequency in + the input. */ + maxout = nout/2; if (sflag) { /* smoothed */ pwr /= 4; @@ -359,6 +367,11 @@ } + free(x); + free(y); + free(wk1); + free(wk2); + exit(0); } @@ -382,15 +395,29 @@ return (p+1); } +void error(s) +char *s; +{ + fprintf(stderr, "%s: %s\n", pname, s); + exit(1); +} + static char *help_strings[] = { "usage: %s [ OPTIONS ...] INPUT-FILE\n", -" outputs amplitude spectrum up to the nyquist frequency with total power", -" equal to the variance.", -" INPUT-FILE is the name of a text file containing a time series", -" (use `-' to read the standard input), and OPTIONS may be any of:", +" where INPUT-FILE is the name of a text file (use '-' to read the standard", +" input) containing a sampled time series, presented as two columns of", +" numbers (the sample times and the sample values). The intervals between", +" consecutive samples need not be uniform. The standard output is the Lomb", +" periodogram (a frequency spectrum derived from the time series, in two" +" columns (frequency and amplitude), normalized such that the total power", +" between zero and the Nyquist frequency (based on the mean sampling" +" frequency) is equal to the variance of the input. If the units of sample", +" times are seconds, the units of the frequencies are Hz.", +" OPTIONS may be any of:", " -h Print on-line help.", +" -P Generate a power spectrum (print squared amplitudes).", " -s Produce smoothed output.", -" -P Output powers instead of amplitudes.", +" -z Zero-mean the input data.", NULL }; @@ -401,4 +428,88 @@ (void)fprintf(stderr, help_strings[0], pname); for (i = 1; help_strings[i] != NULL; i++) (void)fprintf(stderr, "%s\n", help_strings[i]); +} + +/* Read input data, allocating and filling x[] and y[]. The return value is + the number of points read. + + This function allows the input buffers to grow as large as necessary, up to + the available memory (assuming that a long int is large enough to address + any memory location). */ + +unsigned long input() +{ + unsigned long npts = 0L; + + if ((x = (float *)malloc(nmax * sizeof(float))) == NULL || + (y = (float *)malloc(nmax * sizeof(float))) == NULL || + (wk1 = (float *)malloc(64 * nmax * sizeof(float))) == NULL || + (wk2 = (float *)malloc(64 * nmax * sizeof(float))) == NULL) { + if (x) (void)free(x); + fclose(ifile); + error("insufficient memory"); + } + + while (fscanf(ifile, "%f%f", &x[npts], &y[npts]) == 2) { + if (++npts >= nmax) { /* double the size of the input buffers */ + float *xt, *yt, *w1t, *w2t; + unsigned long nmaxt = nmax << 1; + + if (64 * nmaxt * sizeof(float) < nmax) { + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + if ((xt = (float *)realloc(x, nmaxt * sizeof(float))) == NULL) { + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + x = xt; + if ((yt = (float *)realloc(y, nmaxt * sizeof(float))) == NULL) { + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + y = yt; + if ((w1t = (float *)realloc(wk1,64*nmaxt*sizeof(float))) == NULL){ + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + wk1 = w1t; + if ((w2t = (float *)realloc(wk2,64*nmaxt*sizeof(float))) == NULL){ + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + wk2 = w2t; + nmax = nmaxt; + } + } + + fclose(ifile); + if (npts < 1) error("no data read"); + return (npts); +} + +/* This function calculates the mean of all sample values and subtracts it + from each sample value, so that the mean of the adjusted samples is zero. */ + +void zeromean(n) +unsigned long n; +{ + unsigned long i; + double ysum = 0.0; + + for (i = 0; i < n; i++) + ysum += y[i]; + ysum /= n; + for (i = 0; i < n; i++) + y[i] -= ysum; } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/memse.c wfdb-10.3.8/psd/memse.c --- wfdb-10.3.7/psd/memse.c Sun Jan 30 04:13:20 2000 +++ wfdb-10.3.8/psd/memse.c Mon Jun 16 15:02:33 2003 @@ -1,9 +1,9 @@ /* file: memse.c G. Moody 6 February 1992 - Last revised: 17 September 1999 + Last revised: 16 June 2003 ------------------------------------------------------------------------------- memse: Estimate power spectrum using maximum entropy (all poles) method -Copyright (C) 1999 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -39,7 +39,6 @@ #include #endif -#define LEN 16384 /* default maximum points in input series */ #define PI M_PI /* pi to machine precision, defined in math.h */ #ifdef i386 @@ -140,11 +139,17 @@ } char *pname; + FILE *ifile; -float *wk1, *wk2, *wkm; +float *data, *wk1, *wk2; +long nmax = 512L; /* Initial buffer size (must be a power of 2). + Note that input() will increase this value as + necessary by repeated doubling, depending on + the length of the input series. */ +float *wkm; int fflag; -unsigned int len = LEN; -unsigned int npoints; +unsigned int len; +unsigned int nout; unsigned int poles; int wflag; int zflag; @@ -157,19 +162,17 @@ int i, pflag = 0; char *prog_name(); double df; - float pm, *cof, *data, evlmem(); + float pm, *cof, evlmem(); FILE *fp; - void detrend(), help(), memcof(); + long input(); + void detrend(), error(), help(), memcof(); pname = prog_name(argv[0]); for (i = 1; i < argc; i++) { if (*argv[i] == '-') switch (*(argv[i]+1)) { case 'f': /* print frequencies */ - if (++i >= argc) { - fprintf(stderr, "%s: sampling frequency must follow -f\n", - pname); - exit(1); - } + if (++i >= argc) + error("sampling frequency must follow -f"); freq = atof(argv[i]); fflag = 1; break; @@ -177,37 +180,28 @@ help(); exit(0); break; - case 'l': /* handle up to n-point input series */ - if (++i >= argc) { - fprintf(stderr, "%s: input length must follow -l\n", pname); - exit(1); - } - len = atoi(argv[i]); + case 'l': /* handle up to n-point input series (obsolete) */ + fprintf(stderr, + "%s: -l option is obsolete (%s can handle inputs of any length)\n", + pname, pname); + ++i; break; case 'n': /* print n equally-spaced output values */ - if (++i >= argc) { - fprintf(stderr, "%s: output length must follow -n\n", pname); - exit(1); - } - npoints = atoi(argv[i]); + if (++i >= argc) + error("output length must follow -n"); + nout = atoi(argv[i]); break; case 'o': /* specify the model order (number of poles) */ - if (++i >= argc) { - fprintf(stderr, "%s: order (number of poles) must follow -o\n", - pname); - exit(1); - } + if (++i >= argc) + error("order (number of poles) must follow -o"); poles = atoi(argv[i]); break; case 'P': /* print power spectrum (squared magnitudes) */ pflag = 1; break; case 'w': /* apply windowing function to input */ - if (++i >= argc) { - fprintf(stderr, "%s: window type must follow -w\n", - pname); - exit(1); - } + if (++i >= argc) + error("window type must follow -w"); if (strcasecmp(argv[i], "Bartlett") == 0) window = win_bartlett; else if (strcasecmp(argv[i], "Blackman") == 0) @@ -246,7 +240,7 @@ fprintf(stderr, "%s: unrecognized option %s ignored\n", pname, argv[i]); break; - } + } else if (i == argc-1) { /* last argument: input file name */ if ((ifile = fopen(argv[i], "rt")) == NULL) { fprintf(stderr, "%s: can't open %s\n", pname, argv[i]); @@ -259,25 +253,8 @@ exit(1); } - /* Allocate arrays for input series and workspace. */ - if ((data = (float *)malloc((unsigned)len*sizeof(float))) == NULL || - (wk1 = (float *)malloc((unsigned)len*sizeof(float))) == NULL || - (wk2 = (float *)malloc((unsigned)len*sizeof(float))) == NULL) { - fprintf(stderr, "%s: insufficient memory\n", pname); - exit(1); - } - /* Read the input series. */ - for (i = 0; i < len; i++) - if (fscanf(ifile, "%f", &data[i]) < 1) break; - if (i == 0) { - fprintf(stderr, "%s: input series is empty\n", pname); - exit(2); - } - if (i < len) len = i; - else if (fscanf(ifile, "%f", &df) == 1) - fprintf(stderr, "%s: input series truncated after %d points\n", - pname, len); + len = input(); /* Check the model order. */ if (poles > len) poles = len; @@ -322,27 +299,27 @@ /* If the number of output points was not specified, choose the largest power of 2 less than len, plus 1 (so that the number of output points matches that produced by an FFT). */ - if (npoints == 0) { - if (len < LEN) - for (npoints = LEN; npoints > len; npoints >>= 1) - ; - else { - for (npoints = LEN; npoints < len; npoints <<= 1) - ; - npoints >>= 1; - } - npoints++; + if (nout == 0) { + while (nmax >= len) + nmax /= 2;; + nout = nmax + 1; } /* Print outputs. */ - for (i = 0, df = 0.5/(npoints-1); i < npoints; i++) { + for (i = 0, df = 0.5/(nout-1); i < nout; i++) { if (fflag) printf("%g\t", i*df*freq); if (pflag) - printf("%g\n", evlmem(i*df, cof, poles, pm)/(npoints-1)); + printf("%g\n", evlmem(i*df, cof, poles, pm)/(nout-1)); else - printf("%g\n", sqrt(evlmem(i*df, cof, poles, pm)/(npoints-1))); + printf("%g\n", sqrt(evlmem(i*df, cof, poles, pm)/(nout-1))); } + free(cof); + free(data); + free(wk1); + free(wk2); + free(wkm); + exit(0); } @@ -455,6 +432,13 @@ return (p+1); } +void error(s) +char *s; +{ + fprintf(stderr, "%s: %s\n", pname, s); + exit(1); +} + static char *help_strings[] = { "usage: %s [ OPTIONS ...] INPUT-FILE\n", " where INPUT-FILE is the name of a text file containing a time series", @@ -463,11 +447,10 @@ " FREQ argument specifies the input sampling frequency; the center", " frequencies are given in the same units.", " -h Print on-line help.", -" -l LEN Handle input files with up to N points; default: LEN = 16384.", -" -n N Print N equally-spaced output values; default: N = LEN/2.", -" -o P Specify the model order (number of poles); default: P = sqrt(LEN).", -" spectrum for each chunk. For best results, n should be a power of", -" two.", +" -n N Print N equally-spaced output values; default: N = half the number", +" of input samples.", +" -o P Specify the model order (number of poles); default: P = the square", +" root of the number of input samples.", " -P Generate a power spectrum (print squared magnitudes).", " -w WINDOW", " Apply the specified WINDOW to the input data. WINDOW may be one", @@ -485,4 +468,65 @@ (void)fprintf(stderr, help_strings[0], pname); for (i = 1; help_strings[i] != NULL; i++) (void)fprintf(stderr, "%s\n", help_strings[i]); +} + +/* Read input data, allocating and filling x[] and y[]. The return value is + the number of points read. + + This function allows the input buffers to grow as large as necessary, up to + the available memory (assuming that a long int is large enough to address + any memory location). */ + +long input() +{ + unsigned long npts = 0L; + + if ((data = (float *)malloc(nmax * sizeof(float))) == NULL || + (wk1 = (float *)malloc(64 * nmax * sizeof(float))) == NULL || + (wk2 = (float *)malloc(64 * nmax * sizeof(float))) == NULL) { + if (data) (void)free(data); + if (wk1) (void)free(wk1); + fclose(ifile); + error("insufficient memory"); + } + + while (fscanf(ifile, "%f", &data[npts]) == 1) { + if (++npts >= nmax) { /* double the size of the input buffers */ + unsigned long nmaxt = nmax << 1; + float *datat, *w1t, *w2t; + + if (nmaxt * sizeof(float) < nmax) { + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + if ((datat = (float *)realloc(data,nmaxt*sizeof(float))) == NULL) { + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + data = datat; + if ((w1t = (float *)realloc(wk1,64*nmaxt*sizeof(float))) == NULL){ + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + wk1 = w1t; + if ((w2t = (float *)realloc(wk2,64*nmaxt*sizeof(float))) == NULL){ + fprintf(stderr, + "%s: insufficient memory, truncating input at row %d\n", + pname, npts); + break; + } + wk2 = w2t; + nmax = nmaxt; + } + } + + fclose(ifile); + if (npts < 1) error("no data read"); + return (npts); } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/plot2d wfdb-10.3.8/psd/plot2d --- wfdb-10.3.7/psd/plot2d Sun Jan 30 04:13:20 2000 +++ wfdb-10.3.8/psd/plot2d Mon Jun 16 15:52:49 2003 @@ -25,9 +25,9 @@ # please visit PhysioNet (http://www.physionet.org/). # _____________________________________________________________________________ # -# This shell script is a quick-and-dirty partial replacement for Paul -# Albrecht's elegant but unsupported `plt'. It accepts a few of the most -# commonly-used `plt' options and produces similar plots. +# This shell script is a quick-and-dirty partial replacement for 'plt', which +# is available from http://www.physionet.org/physiotools/plt. 'plot2d' accepts +# a few of the most commonly-used `plt' options and produces similar plots. # # See `plot2d.1' (type `man plot2d') for usage and examples. diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/psd/plot3d wfdb-10.3.8/psd/plot3d --- wfdb-10.3.7/psd/plot3d Sun Jan 30 04:13:20 2000 +++ wfdb-10.3.8/psd/plot3d Mon Jun 16 15:53:46 2003 @@ -26,8 +26,8 @@ # _____________________________________________________________________________ # # This shell script is a simple extension of `plot2d', which is itself a -# quick-and-dirty partial replacement for Paul Albrecht's elegant but -# unsupported `plt'. `plt', however, does not directly support 3D plotting. +# quick-and-dirty partial replacement for `plt'. `plt', however, does not +# directly support 3D plotting, so 'plot3d' may be useful even for 'plt' users. # # See `plot2d.1' (type `man plot2d') for usage and examples. diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/wave/modepan.c wfdb-10.3.8/wave/modepan.c --- wfdb-10.3.7/wave/modepan.c Thu Dec 5 02:54:37 2002 +++ wfdb-10.3.8/wave/modepan.c Sat Jul 12 02:09:37 2003 @@ -1,10 +1,10 @@ /* file: modepan.c G. Moody 30 April 1990 - Last revised: 5 December 2002 + Last revised: 12 July 2003 Mode panel functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2002 George B. Moody +Copyright (C) 2003 George B. Moody This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -66,7 +66,8 @@ } int mode_popup_active = -1; -char *tchoice[] = {"0.25 mm/min", "1 mm/min", "5 mm/min", "25 mm/min", +char *tchoice[] = {"0.25 mm/hour", "1 mm/hour", "5 mm/hour", + "0.25 mm/min", "1 mm/min", "5 mm/min", "25 mm/min", "50 mm/min", "125 mm/min", "250 mm/min", "500 mm/min", "12.5 mm/sec", "25 mm/sec", "50 mm/sec", "125 mm/sec", "250 mm/sec", "500 mm/sec", "1000 mm/sec"}; @@ -265,49 +266,58 @@ int u = ((int)(canvas_width/dmmx(1) + 1)/5); /* number of 5 mm time-grid units */ switch (tsa_index = i) { - case 0: /* 0.25 mm/min */ + case 0: /* 0.25 mm/hour */ + mmpersec = (0.25/3600.); + canvas_width_sec = 72000 * u; break; + case 1: /* 1 mm/hour */ + mmpersec = (1./3600.); + canvas_width_sec = 18000 * u; break; + case 2: /* 5 mm/hour */ + mmpersec = (5./3600.); + canvas_width_sec = 3600 * u; break; + case 3: /* 0.25 mm/min */ mmpersec = (0.25/60.); canvas_width_sec = 1200 * u; break; - case 1: /* 1 mm/min */ + case 4: /* 1 mm/min */ mmpersec = (1./60.); canvas_width_sec = 300 * u; break; - case 2: /* 5 mm/min */ + case 5: /* 5 mm/min */ mmpersec = (5./60.); canvas_width_sec = 60 * u; break; - case 3: /* 25 mm/min */ + case 6: /* 25 mm/min */ mmpersec = (25./60.); canvas_width_sec = 12 * u; break; - case 4: /* 50 mm/min */ + case 7: /* 50 mm/min */ mmpersec = (50./60.); canvas_width_sec = 6 * u; break; - case 5: /* 125 mm/min */ + case 8: /* 125 mm/min */ mmpersec = (125./60.); canvas_width_sec = (12 * u) / 5; break; - case 6: /* 250 mm/min */ + case 9: /* 250 mm/min */ mmpersec = (250./60.); canvas_width_sec = (6 * u) / 5; break; - case 7: /* 500 mm/min */ + case 10: /* 500 mm/min */ mmpersec = (500./60.); canvas_width_sec = (3 * u) / 5; break; - case 8: /* 12.5 mm/sec */ + case 11: /* 12.5 mm/sec */ mmpersec = 12.5; canvas_width_sec = (2 * u) / 5; break; - case 9: /* 25 mm/sec */ + case 12: /* 25 mm/sec */ mmpersec = 25.; canvas_width_sec = u / 5; break; - case 10: /* 50 mm/sec */ + case 13: /* 50 mm/sec */ mmpersec = 50.; canvas_width_sec = u / 10; break; - case 11: /* 125 mm/sec */ + case 14: /* 125 mm/sec */ mmpersec = 125.; canvas_width_sec = u / 25; break; - case 12: /* 250 mm/sec */ + case 15: /* 250 mm/sec */ mmpersec = 250.; canvas_width_sec = u / 50.0; break; - case 13: /* 500 mm/sec */ + case 16: /* 500 mm/sec */ mmpersec = 500.; canvas_width_sec = u / 100.0; break; - case 14: /* 1000 mm/sec */ + case 17: /* 1000 mm/sec */ mmpersec = 1000.; canvas_width_sec = u / 200.0; break; } diff -Naur --exclude Makefile --exclude info wfdb-10.3.7/wave/wave.h wfdb-10.3.8/wave/wave.h --- wfdb-10.3.7/wave/wave.h Sun Oct 14 14:34:14 2001 +++ wfdb-10.3.8/wave/wave.h Sat Jul 12 02:05:24 2003 @@ -68,9 +68,9 @@ #define DSLMAX 80 /* length of longest permissible description in log */ /* Default array indices for scale settings (see modepan.c and xvwave.c). */ -#define DEF_TSA_INDEX 9 -#define DEF_COARSE_TSA_INDEX 3 -#define MAX_COARSE_TSA_INDEX 5 +#define DEF_TSA_INDEX 12 +#define DEF_COARSE_TSA_INDEX 6 +#define MAX_COARSE_TSA_INDEX 8 #define DEF_VSA_INDEX 3 /* Macros */