CA1276241C - High resolution waveform processor - Google Patents

High resolution waveform processor

Info

Publication number
CA1276241C
CA1276241C CA000474673A CA474673A CA1276241C CA 1276241 C CA1276241 C CA 1276241C CA 000474673 A CA000474673 A CA 000474673A CA 474673 A CA474673 A CA 474673A CA 1276241 C CA1276241 C CA 1276241C
Authority
CA
Canada
Prior art keywords
waveforms
samples
block
data
waveform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
CA000474673A
Other languages
French (fr)
Inventor
David Ward Mortara
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ARRHYTHMIA RESEARCH TECHNOLOGY
Original Assignee
ARRHYTHMIA RESEARCH TECHNOLOGY
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ARRHYTHMIA RESEARCH TECHNOLOGY filed Critical ARRHYTHMIA RESEARCH TECHNOLOGY
Application granted granted Critical
Publication of CA1276241C publication Critical patent/CA1276241C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • A61B5/346Analysis of electrocardiograms
    • A61B5/349Detecting specific parameters of the electrocardiograph cycle
    • A61B5/363Detecting tachycardia or bradycardia
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7225Details of analog processing, e.g. isolation amplifier, gain or sensitivity adjustment, filtering, baseline or drift compensation
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/20ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S128/00Surgery
    • Y10S128/901Suppression of noise in electric signal

Abstract

HIGH RESOLUTION WAVEFORM PROCESSOR

Abstract of the Disclosure A waveform processor for processing waveforms of the ECG type from surface electrodes connected to the human body. Differential lead waveforms are sampled by a fast, high resolution A/D converter which are thereafter provided to a preprocessor where filtering and a reconstruction of the leads waveforms takes place. The waveforms are then detected, classified, and averaged to form composites of the X, Y, and Z terminal leads. Special filtering is used to detect the high frequency low amplitude features of the composite waveforms.

Description

~2q~

HIGH RESOLUTION WAVEFORM PROCESSOR
BACKGROUND OF THE INVENTION
The invention pertains generally to a processor for waveforms, such as those obtained from the ~uman ~ody by urface elect~ode~ during cardiac depolarization~, i.e. ECG waveforms, and i 6 more particularly directed to detecting particular features of tho6e wavefor~s requiring analysis at high resolutions.
The electrocardiographic (ECG or EKG) waveform has been the object of intensive study for a long time.
Generally, the amplitude and waveshape of the QRS
comple~ of such waveform6 are of interest in the diagnosis of cardiac insufficiency and disease. Analog 15 device~ for plotting the waveshapes of heartbeats have been u~ed extensively and numerous apparatus have been provided for detecting the peak amplitude of the R-Qegment and the onset of the waveform. Others devices have comp~red the shapes of the T-segment against 20 emperical criteria to determine factors concerning cardiac function. All of these devices however, require human interpretation of the results and are generally of low re~olution.
More recently the ECG has been studied in an 25 attempt to discriminate small amplitude high frequency potential~ occurring in the waveforms. Three of these microvolt level signals generating considerable interest today are His bundle potentials, high frequency component~ of the P-segment and QRS-segment of the 30 waveform, and pogt-QRs ~egment ~late potentials". It is believed that other useful ~icrovolt signal information will yet be discovered but has not been identified because of the lack of instrumentation available to mea~ure it reliably .
Hi6 bundle potentials, named for their discoveror, and other special high frequency features in ; the ECG waveform are electrical displays of the ~ubcycle . ~Z7~ ` ' electrical activity taking place in the depolarization cycle other than just the major atrial and ventricular contractions. By being able to detect these special features, researchers will be better able to map the ~ntire cardiac cycle and possibly diagnose problems of latent dysfunctions that are hidden today in the ECG
waveform.
Small amplitude, high frequency microvolt 6ignals after the QRS complex which are termed "late potentials" are useful in predicting ventricular tachycardia in post myocardial infarction patients. See ~ther et al. ~The Detection of Delayed Activation Signals of Low Amplitude in the Vector Cardiogram of Patients with Recurrent Ventricular Tachycardia by Signal Averaging", Excerpta Medica, Amsterdam, 1978, pp.
80-82. It is hypothesized that the scarring caused by an infarction produces nonuni$orm borders which modify the natural depolariza~ion process to produce these potentials possibly by slowing the propagation of the normal potential through the tissue or by increasing the path length over which it travels.
Although all of these microvolt level signals are now useful and it is believed researchers will begin isolating others, these signals are extremely difficult to detect with consistency. ~he initial aiscrimination problem is found in the form of the ECG waveform itself. The amplitude of the QRS segment in a ECG
signal is relatively high and at a relatively low frequency compared to those of the features of interest, which have a relatively high frequency and relatively low amplitude. Because of the difference in amplitudes between that which is measured and that which is of interest, a high resolution detection system must be used. In the digital conte~t increasing the resolution in a detection apparatus generally means increasing the cost for including devices and memories of higher bit capacities.

1276; C41 Further, because of the freqùency difference between the QRS comple~ and the microvolt potentials, elective detector~ wit~ various special characteristics nust be used. For c~ample to aetect "late potentials"
for tachycardia prediction, a high pass filter without any ringing time constant is necessary. This is because the ~late potentials" which follow the high energy QRS-segment of the waveform will be ma6ked by any ringing cau~ed by the high energy portion of the signal. Additionally, base line shift of the ECG signal i6 detrimental because the DC component of the ECG
signal may float above and below an average to an extent greater than the microvolt amplitudes one is trying to detect.
The input beat waveforms of an ECG signal may also contain false or odd beats such as muscle artifacts, noise, and ectopic beats. Hiqh frequency low amplitude features of an ECG signal are hard to detect in the~e circumstances because each beat cycle of the ; 20 depolarization may be different from any other beat cycle and different depending on the positioning the electrodes measuring the waveform. Therefore, to be of real use a large number of beat waveforms must be summed to produce a composite average waveform over a number of 25 beats while using objective criteria to reject spurious `-data. Only when a representative composite beat waveform is free from noise, base line shift, and odd beats can the microvolt potentials of interest be detected reliably.
Even when a number of waveforms have been 6ampled and odd or inconsistent beats have been eliminated therefrom, the problem remains as how to average the beat waveforms which are sampled from non-aligned times in the sampling process. Although there are landmarks in each beat, they can vary from cycle to cycle and provide only a relative alignment.
The alignment of the waveforms is further problematical i;æ~6~41 because of the effects of noise.and the voltage variations of the waveforms on a beat to beat basis. There are several sources of induced voltage variation in these waveforms, but respiration is probably the main one with a stable heart rate. If the beat waveforms are not aligned with accuracy, the error in alignment acts as a filter to high frequency components of the composite waveform. Therefore, in the detection of microvolt potentials a misalignment during the averaging process can reverse the gains produced by averaging lo and mask these siqnals altogether.
SUMMARY OF THE INVENTION
To overcome these and other problems encountered in the measurement and detection of waveforms, particularly the high frequency, low amplitude features of an ECG waveform, the invention provides a high resolution waveform processor and related methods for analysing and averaging electro-cardiographic signals.
The waveform processor comprises means for sampling a plurality of ECG waveforms to provide sample data, means for identifying average beat waveforms from the sample data, means for averaging the average beat waveforms, and means for detecting high frequency, low amplitude features from the averaged beat data. The waveform processor may additionally comprise means for displaying the averaged beat waveforms and/or the detected features.
In a preferred hardware implementation the waveform processor includes a signal conditioning means which digitizes a plurality of analog signals input from surface electrodes placed on a patient to sense cardiac depolarizations, a preprocessor which buffers the digitized data and provides preprocessing functions which are independent of signal content, and a main processor which receives the digitized data and other preprocessed digitized data to identify average beat waveforms. The main processor thereafter averages the average beat waveforms and detects the features desired.

rn/

..

lZ7624~ !

~ he ~ignal conditioning means includes a nicroprocessor bAsed ~nalog to digital converter which iB pecifically ~dapted to generate high resolution digital samples of ECG waveforms with a minimum number S of bit6. The miCroproCessOr of the signal conditioning ~e~n~ controlfi a nultiple~er with a plurality of input channels to provide one of the analog ECG waveforms sampled at an input junction. Under control of the microproces~or, the input signal i6 differenced at the input iunction with another analog signal which is repre~entative of the value of the input signal one time period earlier. The difference is converted to a digital 6ample and transmitted to a latch for output to the preprocessor. The analog 6ignal differenced with lS the input ~ignal iB generated from a digital to analog converter with a much higher bit resolution than the analog to digital converter. because it is the difference between the two signals that is converted to a digital number, all of the bit resolution of the A/D
converter ~ applied to a smaller range.
-~ Thi~ operation is of 6ignificant advantage in providing high resolution samples of multiple input channels at a high clocX rate while using a minimum length digital word. The high resolution of the samples 25 iB needed o that the low amplitudes of the special features of the waveforms can be accurately measured.
The ignal conditioning means further includes a transmitter which takes each digital sample from the latch and tran~mits the digital word over a transmission line in a serial fashion to the preprocessor. Besides the digital word the transmitted data additionally have a plurality of framing bits interposed between the data bits in a unique pattern. The framing bits are placed in the tran~mitted word to provide means for detecting er~ors in the data word once it reaches the preprocessor.
The preprocessor iB a microprocessor based data control and proces~ing device using an input buffer to ~Z;'624~ ~ ~

communicate with the signal conditioning means and an output buffer to communicate with the main processor.
The preprocessor receives the transmitted data with a receiver and decodes the framing bits cuch that any data which are in error can be discarded. If the aata are ~udqed to be accurate, the preprocessor stores them in the input buffer.
During a preprocessor cycle the sampled data in the input buffer are read into the preprocessor and certain preprocessing functions performed thereon.
After the preprocessing functions are completed, the sa~plea data and additional preprocessed data are stored in the output memory buffer. The preprocessor shares access to the output memory buffer with the main procegsor and notifies the main processor data are ready by generating an interrupt signal at predetermined times.
The preprocessor functions include integrating the data samples to provide a set of reconstructed data samples from the difference inputs bandpass filtering the Bampled data to provide detection and labeling data;
filtering the ampled data for noise summing a plurality of the samples together for one lead to perform alias component filtering; and summing the nominally equivalent ~amples together to produce a ~ingle output for each lead.
The preprocessor therefore functions to accomplish two ~ajor tasks, that of comprecsing the data by preprocessing and that of buffering the data between the signal conditioning means and the main processor.
The preprocessing of the data greatly enhances the power of the main processor, as data which have certain attributes have already been provided without using the ~ain proce~sor time. It is noted that the preprocessor functions are all data content independent and do not include calculations on the samplea data. The separation of the preprocessing functions from the calculation functions are advantageous in that if a different evaluation w-re warranted, the 6ignal conditioning means and preprocessor would not need to be changed. Only the calculation functions which are c~ecuted by the main processor would have to be reprogrammed.
The main proce~sor takes the preprocessed data out of the output buffer ana detects and labels each beat waveform. Alignment and averaging of the wavef orms take place thereafter but before these waveforms are input to specialized detector means.
The detection and labeling of the beat waveforms are accomplished with the assistance of the bandpa~s filtered data from the preprocessor. An initial template i s formed from the bandpass data samples and a best fit for the template is formed by minimizing the ratio of the absolute difference of the template samples and the data samples to the absolute ~um of the template samples and the data samples.
Those waveforms which cannot be templated to a certain minimum ratio or which fail to meet other objective criteria a8 to length, peak amplitude, or dominate type are discarded as nonuseable in a composite average. An alignment routine in the preprocessor then generates a fiducial timing mark in each waveform by using ~ liding template to further minimize the best fit. The average type of waveforms with their fiducial timing mark are then averaged to form a noise free composite which is not contaminated by odd beat waveforms which could mask the high frequency, low amplitude special feature to be detected.
The composite average ECG waveform is subsequently input to one or more of a plurality of specialized high pass filters to detect the special features of interest. In a preferred embodiment one of the detection means is a finite impulse response filter which produces no phase ~hift or amplitude phase ~ 76Z41 reversals. This filter iB particularly advantageous in the detection of ~is bundle waveforms.
In another preferred mbodiment one of the detoction ~ean6 i8 a digital filter ~ynthesized from a four-pole Butterworth filtor in which the output data are filtered in both a reverse and forward time direction. This filter is particularly advantageous in detecting post QRS ~late potentials" which are predictive of ventricular tachycardia in post myocardial infarction patients.
These and other objects, features, and aspects - of the invention will be more fully understood and better described if a reading of the following detailed dew ription is undertaken in conjunction with the accompanying drawings in which:
BRIEF DESCRIPTIO~ OF THE DRAWI~GS
Figure l i8 a pictorial representation of a waveform processor constructed in accordance with the invention Figure 2 is a hardware block diagram of the waveform proces60r illustrated in Figure l;
Figure 3 is a pictorial representation of the waveforms for the X, Y, and Z leads which are measured with the waveform processor illustrated in Figure l:
Figure 4 iB a function diagram illustrating the operational functions for the signal conditioning means, the preprocessor and the main processor of the waveform processor illuætrated in Figure 2;
Figure 5 is a hardware block diagram of the signal conditioning means illustrated in Figure 2 Figures 5a-5b are detailed circuit diagrams of various components of the signal conditioning means illustrated in Figure 5 Figures 6 and 7 are hardware block diagrams of the preprocessor illustrated in Figure 2:
Figures 6a-6b are detailed schematic diagrams of the variou3 elements illustrated in Figure 6 ~ ~ 1Z76'~

Figures 7a-7b are detailed electrical ~chematic aiagrams of various component~ of the preprocessor illustrated in Figure 7;
Figure 8 i6 a hardware block diagram of the processor illustrated in Figure 2;
Figure 9 iB a hardware block diagram of the communication links between the plotter, CRT terminal and processor illustrated in Figure 2;
Figure 10 i8 a ~ystem flow chart for the program which controls the microprocessor illustrated in Figure 5:
Figure lOa is a system block diagram of the functional operation of the analog to digital conversion for the signal conditioning means illustrated in Figure 2;
Figure lOb is a pictorial representation of the sample store for the microprocessor illustrated in Figure 5;
Figures lOc-lOf are waveform diagrams of various control signals for the signal conditioning means illustrated in Figure 5;
Figure 11 is a 6ystem flow chart for the software program which controls the microprocessor illustrated in Figure 7;
Figure 12 is a graphical representation of the frequency response of the bandpass filters illustrated in Figure 11:
Figure 13 is a 6ystem flow chart for the software program controlling the microprocessor illustrated in Figure 8;
Figures 14a-14c form a detailed system flow chart for the routine QRSDC~ illustrated in Figure 13;
Figures 15a-15c form a detailed flow chart for the routine SYNCH illustrated in Figure 13;
Figure 16a-16b form a detailed flow chart of the routine RYTHM illustrated in Figure 13;

~3 ~ ~7624i . `

Figure 17 is a detailed flow chart of the routine APRG which is called from the routine GETSMPL
illustrated in Figure 13;
Figure 18 i8 a detailed flow chart of the S routine FIRFLT called from the routine PLOT illustrated in Figure 13;
Figure 19 is a detailed flow chart of the routine BU~FLT which is called from the routine PLOT
il~ustrated in Figure 13;
Figure 20 i8 a pictorial diagram of the sample points from the bandpass filters illustrated in Figure 11:
Figure 21 is a waveform diagram of a QRS wave illustrating the fiducial timing alignment template around the onset point;
Figure 22 is a detailed flow chart of the routine LATEP which is called from the routine PLOT
illustrated in Figure 13; and Fisure 23 is a pictorial composite of the output waveforms of the waveform processor illustrated in Figure 1.

DETAILED DESCRIPTIO~ OF THE PREFERRED EM~3ODIMENT
In Figure 1 there is illustrated a waveform processor which is particularly adapted to perform the processing of waveforms obtained from a human body by surface electrodes during cardiac depolarizations.
These waveforms, typically termed ECG or E~G waveforms, are generated by attaching surface electrodes to a patient 10 at particular locations. In the illustrated embodiment X, Y, and Z potentials are measured by leads 12-22 representing the combinations of the surface potentials X+, X-, Y+, Y-, Z~, and Z-, respectively. A
lead 24 i8 connected to the right leg surface electrode and is driven by the system from output RL to produce a feed back potential such that common mode rejection is enhanced. The placement of the electrodes envisions J

that the potential acro~s the oardiac chamb~r i~
measured in three a~es any two of which define a plane uch that three mutually perpen~icul~r planes are for~ed Electrode~ Xl, X- form one axis at the fifth interco~tal po~ition under each arm at the ides, ~lectrodes Z~, Z- form another a~is perpendicular thereto horizontally on the sternum and directly in back thereof, and electrodes Y+, Y- form another axis perpendicular thereto vertically on the ~ternum and the top of the left leg The analog waveform signals from leads 12-24 are input to a signal conditioner 26 which i8 located relatively near the patient under 6tudy 80 that the electroae lead lengths are kept reasonably short and ~tray capacitance is reduced If the capacitive coupling of the leads is too great, noise such as 60 cycle AC and other environmental noise will be uperimposed on the input waveforms The signal conditioner 26 digitizes the analog potentials input from the loads and tran6mits the digitized data via a transmission line 28 to a main processor apparatus 30 The main processor apparatus 30 communicates with a CRT
terninal 36 and a graphic plotter 42 through respective transmis~ion lines 34 and 32 An operator of the system by typing in commands on a keyboard 40 and following the instructions displayed on tho ~creen 38 of the CRT terminal 36 can produce ~everal different outputs from the plotter 42 The outputs which are available to the operator are wide band, low gain representations of the X, Y and Z
waveforms, wide band, high gain plots of the X, Y and Z
waveforms, plots of detected special features of the waveforms, and special numbers indicative of particular valuos for some of the special features In particular tho detoctod features of the waveforms are provided by high pa6s filtering the input data with a finite impulse response filter ~FIR) and high pass filtering composite average data with a bidirectional four pole Butterworth fllter.
Figure 3 hows pictorial representations of the input waveforms of the X, Y and Z potentials respectively. Each cardiac waveform can be e~pressed as a composition of a number of seqments or particular features. ~his is best seen in the Y waveform where the segments P, Q, R, S, and ST are visible as separately discernable feature~ in the overall waveform. As is well known, these segDents have a definite physical correspondence to the mechanical aspects of the heart rhythm. For example, the R segment peak i 8 the depolarization causing the contraction of the left ventricle. Each of the analog signals input for the X, Y and Z waveforms consi~t of a 6uccessive train of these beat waveforms. It is noted that the periodicity of the beats depends on heart rate and the physiological accuracy of the cardiac cycle in the particular patient. Each individual beat waveform may differ slightly in amplitude and shape from a representative one because of noise, movement, muscle artifact~, and respiration. Also evident is the variation in waveform caused by the different placement of the electrodes on the patient.
It iB evident that the most discernable feature in each waveform is the QRS comple~, which i6 of relatively high amplitude and relatively low frequency compared to microvolt potentials such a8 the His bundle potentials or the ~late potentials" which may follow the QRS comple~. These special features are not illustrated on the waveforms shown because of the scale difficulties but are of a microvolt amplitude compared to the millivolt amplitude of the R segment and are of frequencies in the range of 50-250 Hz as compared to R
segment dominant frequencies in the range of 10-30 Hs.

1~6Z~l `

As will be more fully explained hereinafter the waveform proce~sor is particularly aaaptea to detect these relatively high frequency ana relatively low agnitude features of the beat waveforms This discrimination $8 pr~vided by the waveform processor in ~n adv~ntageous manner by first taking high resolution ~amples from the particular leads and digitally filtering and processing the waveforms to form a composite average waveform which i6 substantially free of noise ~nd other a~ti$acts while still containing the high frequency, low amplitude features The composite waveform iB then detected by special filtering techniques to highlight the particular feature desired before being di6played on the plotter 42 Two particular embodiments will be described wherein His bundle potentials are detected by a FIR
filter, and ~late potentials" following the QRS complex which are predictive of ventricular tachycardia are detected by a four pole 8utterworth filter It will be evident that once a high reæolution composite average has been formed, other high pass ~pecial filtering techniques or the like can be used to detect other high frequency, low amplitude features of the waveforms The generalized hardware block diagram for the waveform processor i8 more fully illustrated in Figure 2 The ~ignal lead~ having information concerning the ECG waveforms are input to signal conditioning means 200. The ~ignal conditioning means 200 amplifies the individual waveforms and digitizes them for transmission to a preprocessor means 200 The transmission of the data is in a serial format via the transmission line 28. The preprocessor means 202 buffers the sampled data and applies certain preprocessing functions to the data before pas~ing them to a main processor 202 via a communicatiOn link 199 The main processor 206 performs the generalized calculations necessary for detection of low amplitude, 1;i~76Z41 high frequency features in the ECG waveforms and 8ystem e~ecutive function8. When the ~pecial feature8 have been detected, they and other representationB of the input sample6 can be output on the plotter 204 in a S number of different formats via the communication link 32. The CRT terminal 208 i5 proviqea a communication link 34 with the processor 206 to provide interactive communication and control of the system, particularly the plotter functions.
The communication links 32, 34, 199 with the main processor 206 are interrupt driven to cause digital communication in an advantageous manner whereby each device can access the main processor at asynchronous times. Since the data 6amples are being input at a congtant rate by the signal conditioning ~eans 200, the preprocessor 202 buffers the input 6amples prior to transferring data blocks by the interrupt driven communication protocol.
Each of the primary hardware parts of the ~ystem, the signal conditioning means 200, the preprocessor 202, and processor 206, are microprocessor based to produce a system that advantageously uses the power of digital processing to produce a high resolution waveform proces60r capable of sampling and processing large quantities of data from the input leads. A large quantity of data at the high resolution provided by the system is necessary for providing a highly accurate reproducible detection of the low amplitude, high frequency features of the ECG waveforms.
In Figure 4 there is illustrated a functional system block diagram for the major operational functions of the system illustrated in Figure 2. The signal conditioning means 200 functions in block 201 to input differences of the lead values LL, LA, Vl-V14 where these variables correspond to multiple values of the electrode potential~ Xl, X-, Y~, Y-, and Z~, Z- as will be more fully explained hereinafter. These lead differences are the ~ubtraction of an input sample from the previous input ample value for the same lead, e~sentially taking the fir~t derivative of the lead amples. Taking a difference in thi6 manner produces a S maller bit ~ize word with which to tran~fer data while t~ll producing high resolution data in the 6ystem. In general, the signal conditioning means 200 inputs saoples of each of 16 leads at a 4kHz rate. The ~ignal conditioning neans constantly send6 data to the preprocessor 202 at a 4000 samples/sec/lead rate and stores them in blocks of 256 samples. The blocks of 16 ~ 16 ~ample6 are u~ed for buffering purposes as will be more fully e~plained hereinafter.
After a block of sample6 is transferred from the signal conditioning means 200 at the input sampling rate, the preproce~sor means 202 in functional blocX 203 integrates the different ~amples back to the original values they had before the differences were taken. Next a noise filter in block 207 operates on the incoming data ~tream to filter out high frequency noise characteristics above a cutoff frequency of 500 Hz.
When this basic filtering has been accomplished the X, Y, and Z lead signals are formed in functional block 209 from nominally equivalent 6ignal samples. The objective i8 to reduce noise introduced into the amplification process by ~umming samples of the same le~d in parallel. The X lead i6 formed equivalent to the summation of (Vl-V2)+(V4-V6)+(V11-12), the Y lead is formed as the equivalent of (V3-V2)+(V7-V8)+(V3-V14), while the Z lead is formed from the equivalent of 2*Vl -(RL-V5)+(V9-V10). Thereafter, the X, Y, and Z samples are averaged over four consecutive samples by an alias filter in block 211. This averaging iB to prevent the àlia~ing of signal components above the Nyquist frequency of 500 HZ and to enhance high frequency noise ; rejection. Thus the output from the preprocessor 202 is at the data rate of 1000 samples/sec/lead.

~ ` 1Z7624~

In ~ddition to tr~n~ferring th~se lKHz signal~
of ehe X, Y and Z lead ~mple to the main procogsor 206, the preprocessor samples are additionally pagsed through ~ first bandpa~s filtor ln block 215 and a second S banapass filter in block 217. The bandpass filter 217 iB ~ore ~elective in frequency than the band pag6 filter 215 such that a smaller frequency band i8 passed through to the main proce~60r 206. These bandpa~s filters are to assist in the detection ana morphological labeling of the beat waveforms. The motivation for using the band pass filters on the raw data ~amples is the noise versus frequency spectra of the main part of a beat waveform or the QRS segment. The ~ajor components of the noise spectrum in a beat waveform are represented by low frequency baseline shift~ and high frequency muscle artifacts. Conversely, the QRS segment frequency ~pectrum peak6 in the region of 8 to 10 Hz and is relatively in6ignificant below 5 Hz and above 30 ~z.
Thus, the greatest ~ignal to noise ratio for QRS
detection and labeling can be obtained by bandpass filtering the raw data ~ample6 to eliminate frequencies other than the major QRS frequency components. The reason for the difference in the bandwidths of the two filters is that in the detection phase the rejection of low frequency events, principally ~ segment waves, and high frequency artifact6 i~ enhanced by a narrower bandwidth. Once a detection has occurred, a wider bandwidth for the second bandpass filter allows a greater di~crimination between the individual QRS
morphologies-It ~hould be noted that the raw data aretransmitted to the main processor 206 unchanged, ~he filtered data will later be used in the discrim~nation of the beat waveforms in tho raw data but the psocess has not changed the data in any manner. It is an advanta~e of this digital processing system that the filtered data ~amples can be obtained in blocks 215, 217 76Z41 ;`

without aodifying the raw data, which still lnclude the ~pecial features for detoction. By thi~ technique ~pecial information has been e~tracted from the input data which will be of further use in processing that data.
Still further, the preprocessor 202 functions to detect the aa~iaum amplitude difference between individual samples of a lead in block 213. This maximum difference detector i8 to allow the device to discriminate pacing pulses if the patient under consideration has an electronic pacemaker. The maximum detected difference, which i6 indicative of the maxi~um slope of the waveform, can then be com~ared against a reference value indicative of the ma~imum slope which --would be espected in a human without a pacemaker. If the maximum slope detected i8 greater than that expected -~
for the patient on his own, then it i6 determined the heart i8 being artificially stimulated, i.e., by a pacemaker. A flag indicating that a pacing signal has been detected is then transmitted to the main processor 206.
Therefore, the preprocessor 202 outputs four r''`
separate groups of information to the main processor 206 includlng a raw data ~ignal from function blocX 211, a selective bandpass filtered signal from function block 215, a aore selective bandpass filtered signal from function block 217, and a maximum difference signal from ~`
function block 213. ~he main processor 206 receives the ~-~
more selective filtered signal from function block 217 and performs a detection operation on the QRS waveform in function block 221. The system passes this detection information to a labeling function block 219 and a dominant rhythm selection block 223 after performing the function. aasically, QRS detection is a search for a maxiaum in the composite magnitude of the detection filter data samples where the composite magnitude is ,'`````.

:
, :.

~;æ7624~ .

defined as the sum of the magnitude~ of the X, Y, and z input leads.
Concurrent with the detection process, the input s~mples from the bandpa6s filter in block 215 is continuou~ly comparea with previously adopted templates of various QRS morphologies. A QRS signal i6 then labelea ~s to type according to the best fit for its morphology. If no template matches adequately a new template i~ created from the banapass filter ~amples.
Once a QRS signal has been detected ana labeled, a fiducial timing mark can be entered into the data if they are of the dominant type. The fiduci~l timing function i8 performed in function block 227 and encompasses aliqning the detected and labeled beats to a best fit and providing a mark in each beat waveform in the same relative position.
Additionally, from the output of the maximum difference detector in block 213 and the QRS detection in block 221, a dominant rhythm selection function in block 223 i~ performed. Thi6 function is provided in order to ensure the rejection of odd or ectopic Dorphologies during the averaging function. The function detects a dominant r~ythm and identifies a QRS
waveform as either that of the dominant type or not.
Initially, upon data acquisition the first QRS
encountered iB tentatively identified as the dominant type. This identification is retained as long as no QRS
(except the electronically paced complexes) is encountered which follows a longer RR interval than the observed average and which does not match the dominant type. If such a QRS i~ encountered it is newly labeled as the tentative dominant type. This process continues until a satisfactory minimum number of dominant cycles have been identified, at which time the tentative identification i~ made permanent. Those QRS complexes which are not of the dominant type are excluded from the average to prevent contamination of the signal.

~Z~76Z4~

From the output- of the fiducial timing function block 227, the ORS labeling block 219, the dominant rhythm election function block 223, and the raw data for the X, Y, and Z loads, a signal averaging block 229 combines the raw data The averaging consists of the signal ummation and normalization of the raw data while e~cluding noise and the ectopic beat waveforms The averaging i8 accompli6hed using the proper fiducial ti~ing ~ark applied from the fiducial timing function block 227 An adequate dynamic range is retained to preserve the QRS segment amplitudes accurately for display of the raw average data and for detection of the low amplitude high frequency features contained therein Subsequent to the 6ignal averaging function, the data are filtered by a high pass frequency filter in block 231 of the finite impulse response type Additionally the ~ignal i6 filtered by a four pole Butterworth filter indicated by block 233 After filtering by block 233, the ~quare root of the ~um of the squares of the individual lead signals is taken by a function block 235 over a predetermined part of the averaged beat waveform The raw data output, the output of the signal averaging block 229, the output of the function block 231, and the output of the function block 235 are all provided to a function block 237 of the plotter which plots the data to di~play particular features of each output These outputs are in response to commands for plotter operation by the operator The commands which produce these operations are typed into the system with the CRT terminal 208 and are handled by a system operating program in the main processor 206 The wide band or ~raw~ presentation of the data i8 generally useful in two purposes First in the absence of the filtering, obviously no misleading effect~ should be vi~ible in the output plot Small ~ 76Z4~ ;

deflections ~een in the wide band rocording thus Cannot be the results of any filtering. Furthermore, the quadrant of ~n observed deflection in the waveform is the real qu~drant, thi8 char~cteristic being useful whenever the vector orientation of the deflection may have significance. However, the utility of the wide band presentation is limited by the presence of the low frequency 6ignal component6 causing the output recoraings to go off ~cale. For this reason the gain of the unfilterea presentation must be kept lower than that for high pass filtered data.
~ The FIR filter 231 i~ primarily usea to remove the low frequency components which woula limit the useful degree of amplification of the wide band recording. Particularly this is the high amplitude, low freguency QRS segment of the ~ignal. The FIR filter 231 avoids most of the undesirable characteristics of typical high pass filters, such as ringing other forms of extended transient response. In the preferred implementation, the FIR filter 231 used has an absolute upper li~it of 8 milliseconds as the duration of a transient response.
These characteri~tics are most important immediately following the P segment and QRS segment of a beat waveform. Absence of ringing means no zero cros~ings in the output waveform will appear as an artifact of the FIR filter in the regions of interest.
The finite impulse response of 8 milliseconds indicates that no effects of the P wave or QRS wave will be present 8 milliseconds following the end of such segment. Both of the~e characteristics are useful for detecting small signals shortly after much larger 6ignals.
Another potentially useful feature of the FlR
filter 231 i~ it6 preservation of the polarity and amplitude of the signals whose frequency components are largely above 50 ~z. This means that, like the wide band recordings, the vector orientation of the high frequency signal6 such as His bundle deflection~ can be directly inferred.
The bidirectional Butterworth filter 233 i8 used ~pecifically to enhance the detection of post QRS
~late potentials". The objective of the bidirectional filter 233 is to eliminate any effects of the filter response which might blur QRS onset or termination.
This is accomplished by filtering the average 6ignal in a conventional manner up to the central portion of the QRS segment and then filtering in a reverse time direction the latter half of the cardiac cycle starting at the end of the cycle. The result is a sharply defined QRS onset and termination allowing accurate measurement of the QRS duration. This filtering provideæ a more unambiguous pattern for the detection of the "late potentials".
A Q~S duration detection function of block 225 al60 takes the average 6amples and detects the ostensible on~et and termination of the composite waveform. In thi~ detector, the onset and termination are obtained from an algorithm conforming to the American Hospital ~ssociation Rules for Visual Location of these landmarks. The output of the QRS duration detector 225 is provided to the plotter 80 that marks indicating onset and offset can be applied on particular waveforms. Other functional operations of the waveform processor will be more apparent in the following detailed description. However, these functions shown in Figure 4 however delineate the major operations necessary for detection of the small amplitude, high frequency special features of the waveform inputs.
With respect now to Figures 5-9 there is illustrated detailed electrical block diagrams of the circuitry comprising the ~ignal conditioning means 200, the preprocessor means 202, and the main processor means 206. Figure 5 is a block diagram of the signal ~27~241 condit~oning mean~ 200, Figures 6 and 7 are blocX
diagrams of the preproce~sor means 202, Figure 8 is a block diagram of the main processor 206, and Figure 9 is a block diagram of the communication links between the ~ain processor 206, the CRT terminal 208 and the pl~tter 204.
Detailed circuits for the blocks of Figure 5 are ~hown in Figure~ Sa-Sb, detailed circuits for the blocXs of Figure 6 are shown in Figures 6a, 6b, and detailed circuits for the blocks of Figure 7 are shown in Figures 7a, 7b.
If attention is now directed to Figure 5 a more detailed de~cription of the 6ignal conditioning means 200 will be provided. The signal conditioning means comprises basically an analog/digital converter which converts information supplied on channel leads X-, X+, Y-, Y+, Z-, and Z+ into digital data samples which can be output in serial format via transmitter 246 to the preprocessor 202. Each of the signal leads is connected to a set of multiple amplifiers 214 which form input channels of an input ~ultiplexer 216. The X-, X+, Y-, Y+ leads are amplified by three amplifiers ana are each input to three separate channels of the input multiplexer 216. The Z- and Z+ leads are connected to two amplifiers and are input to two channels of the input multiplexer 216. The multiple connections to the input channels of the multiplexer are to provide a parallel lead combination function as will be more fully explained hereinafter. It is seen that the input multiplexer receiveg 16 separate analog signals and outputs one of them to a combinational circuit 220 depending on a 4 bit channel address from a multiplexer address control 222.
As is conventional, the X-, X+ leads are aesignated references and are separately input to a combinational circuit 220. Additionally, a separate input for the Z- lead is input via an amplifier 212 to ;:

7624~ ~ ~

the com~inatioDal circuit 220. The X-, X+ and the 2-lead ~ignals are additionally fed back through a driver circuit 210 to the right leg electrode RL.
This configuration of terminal connections to a patient i6 termed a ~driven right leg~ ana is well known in the art. By differencing the opposite polarity ~ignal~ of the ~ame lead, for the example X+, X-, a waveform of a axis of the cardiac potential i6 obtained. Thus, signals for the X, Y and Z a~es are available from these connections which can be translated $nto three perpendicular planes.
The terminal signals for leads Xl, X-, and 2-are combined in the combinational circuit 220 to provide a reference voltage for each of the terminal leads input from the multiple~er 216. The reference output from the combination is subtracted from an input junction of the combinational circuit to provide a ECG wavefor~ with a common baseline. The output of the combinational circuit i~ an analog signal which i5 input to the conversion input I of an analog to digital converter 226.
Additionally subtracted from the input channel ~iqnal in the input ~unction of the combinational circuit 220 iB a feedback signal from a digital to analog converter 230. The feedback signal is the previou~ value of the analog signal for the particular channel input. The previous value is output in digital form from th- memory of a microprocessor 232 where it was stored to the digital to analog converter 230 for conversion and thereafter output to the combinational circuit 220. Therefore, it i6 the analog difference between the previous value of the channel a~plitude and the present value of the channel amplitude modified by the Wilson terminal reference signal that is converted by the analog to digital converter 226. In the digital context thi~ difference iB equivalent to taking the derivative of the input signal. A reference voltage generation circuit 218 provides an identical conversion .

6Z4~

reference voltage for each of the converter~ 226 and 230 such tha~ the ground levels of each are identical. This common reference level reduces any ground level shift between the devices during the conversions. The output of the an~log to digital converter 226, which is one 8 bit data byte, is input to the microprocessor 232 and to a latch 240 for ~torage purposes.
The conver~ion process is under program control of the microprocessor 232 which communicates with the D/A converter 230, the A/D converter 236, and the latch 240. The proqram control of the microprocessor 232 generates a clock signal CLKl which is input to a synchronization circuit 234 and a timing circuit 236. A
control strobe signal STB i6 further generated by the proce8sor under program control and i8 input to the A/D
converter 226, the synchronization circuit 234 and the latch 240 via an inverter 238. The synchronization control 234 generates a control 6ignal STBS from the strobe STB which i6 synchronized with the clock signal CL~l. The control ~ignal STBS is then gated by the timing circuit 236 to the D/A converter 230 and the multiple~er addre6s control 222 to cause a conversion and to cause a change in the channel address, respectively.
In qeneral operation, for an A/D conversion to take place, the microprocessor 232 outputs the previous value for a channel to be sampled in a 16 bit format and advances the address multiple~er control 222 to select that channel address. The value of the input ~ignal of that channel is then differenced with the previous value in the combinational circuit 220 and converted to a digital number by the A/D converter 226. Thereafter, the data are latched into the latch 240 for transmission to the preproces~or 202.
Resolution of the converted signal is 16 bits because of the digital to analog converter 230. This is accomplished by the accurate conversion of the ~;~7624~

previously stored value into an analog value before the difference i8 taken. Because only the difference of the two values iB transmitted, the A/D converter 226 with only 8 bits can be used without 1089 of the higher re601ution. This feature permits a high resolution ~ple of a waveform to be taken while minimizing the number of data bits transmitted for each sample. The feature thus saves bit length for the memories needed to store the sample6 and allows a higher data transmission rate.
Included in the timing circuit is a means for generating a high speed clock signal at 1024kHz and outputting it to a parallel to serial shift register 244 and a tran~mitter 246. After digital data have been stored in the latch 240, the parallel to serial shift register 244 will take the data upon receiving the sTss signal and serially shift them out to the transmitter 246. Interlaced with the data at the inputs to the shift register 244 are ~even framing bits which provide a unique pattern in the serial data output. The framming bits are provided by 6etting certain inputs of the register high or low depending upon the pattern desired.
Additionally, included in the serial data because of it6 input to the shift register is an interleaved channel zero ~ignal CH0. The CH0 signal is generated by a D type flip-flop 242 when it receives a detection signal from a channel zero detection circuit 224. The channel zero detection circuit 224 monitors the four address bits of the multiplexer address control 222 and determines when channel 0 of the multiplexer has been selected. The output of the channel zero detection circuit is a pulse which arrives at the D input of the flip-flop 242 and i~ clocked out of the Q output of the device by the ~trobe 6ignal STB via the inverter 238.
The combination of the unique framing bits, the eight data bits representing one difference sample, and 1Z70Zqt.

the channel ~ero detoction b~t ~re input in p~allel to the hift r-gister 244 upon the ~trobe ~ignal STBS and then clocked out with the 1024kHz clock tO the transmitter 246 in a erial fashion. The ~dentical clock ignal is supplied to the transmitter 246 which then transmits the data in serial format and its inverse along with the clock ~ignal and it6 inverse for synchronization.
The strobe ~ignal is presented every 16 micro~econds and therefore causes a conversion f~r each of the channels at this interval. A full cycle of all ~i%teen channels requires 250 microseconds for a sampling rate of appro~imately 4000 samples/sec/lead.
The microproces~or 232 run~ thi~ input circuitry with a oftware program looping through this operation which is synchronous to the other circuitry. The software loop is started by a power on reset ~ignal from circuit 228 which also initializes the multiplexer address control to channel 0.
With respect now to Figures 6 and 7 the block diagram of the preprocessor 202 is shown to advantage as receiving the clock and data output from the signal conditioning mean~ 200 at a receiver 248. The data and clock signals are then transferred to a serial to parallel ~hift regi~ter 250 from the output of the receiver 248 under the control of the clock signal CL~.
Si%teen bit~ of data are ~ynchronously clocked into the shift register 250 from the ~ignal conditioning means including the eight data bit~, the seven framing bits, and the channel 0 detect bit. Four of the framing bits are used by a frame detector circuit 252 in conjunction with the clock signal CLK to provide a clock æignal CLK
for inputting the data bytes to an input buffer memory 262.
If a correct framing byte sequence is not detected by the circuit 252, the clock signal CLKl will be inhibited and the bad data discarded from the shift ;~`3 regi6ter 250. Inaccurate data never are ~tored in the input buffer ~emory 262 b~cau~e of data errors on the tran~mission from the signal conditioning means 200 to the preproces~or means 202. Assuming a correct framing character has been detected, the data bytes are clocked ~nto a data latch 260 for input to the buffer memory 262. The clock ~ignal also increments an address control 258 which has address lines A0-A7 connected to the addre~s input lines of the input buffer Demory 262.
However, the data are not immediately loaded into the input buffer nemoran 262 until an output enable control line 275 iB provided with an enabling signal from an input synchronization control 268. The output enable ignal on the control line 275 allows storage of the incoming data when the microprocessor 272 of the preproce~or i8 not accessing the input buffer memory 262. Therefore, the enabling signal on that line indicates that the microproces~or is busy doing other tasks and the particular data word in the latch 260 may be ~tored.
This operation provides a synchronization for loading the input buffer memory 262 where a data word is input to the data latch 260 upon frame detection of the unique frame character and then stored until the input buffer ~emory 262 is accessable. The cycle continues with incoming data enabling the clock to increase the count in the address control 258 from zero to an address of 256.
The channel 0 detection bit is output from a shift register line 255 to two AND gates 254 and 256 in oraer to be combined with the frame character enabled clock CLKl. In gate 256, the input of the channel 0 detect bit is negated and therefore enables the clock for all channels e~cept channel 0. Gate 256 therefore provides another clocXing signal to the address control 258 for channels 1 through 15. Upon the occurrence of the channel zero detection bit and the clock signal læ~624~

CLKl, th~ output of gate 254 makes a transition to a low level to reset t~e address control 258 This providos a synchronirat~on of addr~-ses whereby the channel 0 input data are alway6 initiated from a momory aadress of 0 The addr-~s control 258 i~ further re-et by the control ignal RESET from the main procossor 206 a~ will be more fully e~plained hereinafter The address control circuit 258 loads the first 256 positions in the input buffer ~emory 262 with information received from the signal conditioning ~eans 200 When the address control 258 overflows it generates a carry signal CRY to a bank select circuit 270 to indicate that the first 256 memory locations are filled The bank elect circuit 270 thereafter generates a control signal A8 to the input synchronization control 268, causing it to generate an addres~ ~ignal on address line A8 to the input buffer ~emory 262 This address control line A8 will thereafter enable the ne~t higher 256 locations in the input buffer nemory 262 to provide another block of input ~emory to the input address control circuitry 258 $he bank select circuit 270 alternates the control ~ignal A8 such that the input address control circuitry 258 fills one 256 sample block and then the other by alternating between the two A bank select 6ignal BSEL
i6 generated and applied to the microprocessor 272 of the preprocessor 202 to indicate which bank is being filled by the àddress control circuitry 258 The bank opposite that being filled with the input data may then be read by the microprocessor 272 of the preprocessor via the data bus having data lines PD0-PD7. Addresses from which the memory is read are provided by ~ignals from a processor address decoding circuit 266. The address decoding signals are generated by the control lines and address bus PA0-PA15 of the microprocessor 272 of the preprocessor 202 A
read/write control line PW/R is provided to indicate ... ... ..... .. . . .. . . . . ... . . . . . . . ... . . . . . . .. . ...

1;~7624i when the ~nput buffer memory 262 should be read address lines from the aadress bus PAO-PA15 are provided to indicate Addresses in the input buffer memory 262 which are to be read; and the synchronization of the reading S is provided by the preprocessor clock ~ignal PCL~. The actual timing of the reading of the input buffer memory by the microprocessor 272 is provided by the input synchronization control 268 generating the signals R/W
and CS which select the input buffer memory 262 for reaaing and enabling the buffer memory, respectively.
With reference specifically to Figure 7 the microprocessor 272 receives the data from the input buffer memory via the data bus through a data transceiver 276 at it6 port, P3. Port, P3 is a bidirectional port and the data transceiver 276 is enabled by the read/write control line PR/W of the microprocessor 272.
Once the data stored in one of the input buffer memory blocks are brought into the microprocessor 272, an internal software program operates on the data to cause preproces6ing functions which are independent of the data content. After the data have been preprocessed, the data ~amples are stored in an output buffer memory 286. Along with the data samples, other preprocessed data are placed in the output buffer memory 286. The other data include the bandpass filter outputs, the maximum difference detection, a lead fail word, and a clock fail word.
The output buffer memory 286 receives the data from the microprocessor 272 via a data transceiver 276, the data bus PDO-P07, a data transceiver 282 and the output buffer memory data bus 283. Addresses for the data to be stored in the output buffer memory 286 are provided to the output buffer memory address bus via an address bus buffer 274, the microprocessor address bus PAO-PA15, and an address bus buffer 280. ~he addresses are provided by a software run routine which loads the ~ ?, 1 ' ,) ~Z~6Z4~ `

address buffer 274 v~a ports P3 and P4 of the microprocessor 272.
The reading and writing of the data in the output memory buffer 286 are under the control of an output buffer memory control 288 which enables the read/wriee line R/W and the chip select control line~
of the memory 286. The output buffer memory control 288 is under the dual regulation of the microprocessor 272 of the preprocessor 202 and a microprocessor 304 of the main processor 206. For access by the preprocessor 202, the output buffer memory control 288 receives the control signals R/W, CS, A8 and A9 from a preproces3sor memory decoding circuit 278. These ~ignals are synthe6ized from the microprocessor address lines PA8-PA15 of the address bus, the microprocessor clock PCLK, and the read write control ~ignal PR/W. When the microprocessor 272 request6 access to the output buffer memory 286, it also raises an enable line 281 which enable~ the data transceiver 282, the address bus buffer 280, and the output buffer memory control 288. This 6tructure provides a convenient operation for storing the data after they have been preprocessed. The ~torage of the data i~ at the rate of 1000 samples/sec/lead.
The output buffer nemory 286 may also be read from or written to by the microprocessor 304 (Figure 8) of the main processor 206. The output buffer memory control 288 also receives control signals R/W, CS, A8, A9 to generate ~imilar control signals to the memory 28~
from decoded control lines of the microprocessor 304. A
main processor memory decoding circuit 290 generates these signal6 from the microprocessor control lines MR/W
~2 of the main microprocessor clock, and a virtual ~emory access control line VMA. The addresses for the output buffer memory 286 are provided via the address 3S bus through a bus buffer 292. Data are transported through a data transceiver 294 between the output buffer data bus and the data bus of the microprocessor 304.

~he read~write control line MR/W of the m~croproces~or 304 ots the direct~on of the data transceiver 294, and an enabling signal on line 291 from the ~ain processor ~emory decoding circuit 290 enable~ the address bus buffer 292 and the data transceiver 294 To maintain ynchronization between the ~icroprocessor 272 of the preprocessor 202 and the ~icroproces80r 304 of the main processor 206, an interrupt generator 284 is provided to generate an interrupt ignal via interrupt line IRQ4 of the microprocessor 304 The interrupt is generated by ~oftware generated ~ignals from the microprocessor 272 in phase with the 02 output clock signal of the microprocessor 304 The interrupt generator 284 clears the IRQ4 6ignal upon receipt of the enabling signal on line 291 The IRQ4 signal is further read by the microprocessor 272 to determine whether or not the ~icroprocessor 304 of the main processor has cleared it.
In operation the microprocessor 272 maintains synchronization between the main processor 206 and the ~ignal conditioning means 200 by unloading the input memory buffer at a 4000 ~ample/sec/lead rate, preprocessing the data, and loading the output menory buffer at a 1000 ~ample/sec/lead rate After the microprocessor 272 ha~ loaded the output buffer 286 with the data ~amples and other preprocessed data, it will generate àn interrupt request via the interrupt generator 284 The interrupt is generated periodically at four millisecond intervals to provide a time base between the two processors Once the interrupt has been recognized, the microprocessor 304 of the main processor 206 knows that data are ready to be input and thereafter can access the output buffer memory 286 until the next four millisecona cycle i6 initiated Once the processor 304 starts to access the output buffer memory 286 the .~

lZ76Z4~ ) enabling signal on the line 291 from the mainprocessor decoding circuit 290 clear 8 the interrupt request. The acknowledgement of the interrupt is reco~nized via the feedback line ~t microproce~sor 272.
With respect now to Figure 8 there is shown the hardware block diagram for the main processor 206 and associated circuitry. The main processor 206 is a microprocessor based controller which receives and transmits data from the preprocessor 202, the plotter 204, and the CRT terminal 208. The microprocessor 304 preferably used in the implementation is identified as an MC 68000 processor commercially available from the Motorola Corporation of Schaumberg, Illinois. The control lines, data lines, and address lines nomenclature used herein will be that which is identified in the manufacturers user's manual for this device.
The main processor 206 includes the microprocessor 304 which has an associated dynamic random access memory DRAM 410 and programmable read only memory PROM 408. A software control program is stored in the PROM 408 to provide system control and processing routines. To acce~s the PRO~ 408 for instructions the system generates a memory select signal PROMSEL to a PROM bank decoder circuit 406. From this siqnal and control line siqnals UDS and LDS via a control bus buffer 302, an area in the PROM is enabled by address select lines PRO-PR7. The address select lines PRO-PR7 enable ehese areas in the PROM 408 such that the address location accessed by the address bus lines A0-A15 from the microprocessor 304 can be read. Instructions from the PROM 408 are output to the microprocessor 304 on the data bus via data lines D8-D15.
The dynamic random access memory DRAM 410 communicates with the microprocessor 304 via the data bus lines D0-D7 wherein each of these data lines is connected in parallel with both the DI~ and DOUT

.

terminals of the device. A DRAM refresh circuit 412 supplies the DRAM 410 with a plurality of column address ~trobe signals CAS and row address strobe signals RAS.
In addition a plurality of enable signalg RA0-RA8 to elect blocks of the DRAM 410 are generated from the refresh circuit 412. In combination with the address bus line~ AO-A15 and the read write control line MR/W, the DRAM 410 will be able to determine which ~emory address location i8 selected and whether the desired nemory cycle i6 a read or a write operation. Address control for the DRAN refresh circuit 412 is generated from the microproces60r control line signals UDS, LDS, AS and the random access memory 6elect signal RUSSEL.
An additional input to the refresh circuit 412 is an oscillator signal OSC which allows the circuit to refresh the memory location between read and write cycles by cycling the column and row addresses, as is conventional.
The memory select signals including RAMSEL and PROMSEL are generated by a memory 6elect decoder circuit 300 from the addre6s lines A12-A15 of the microprocessor address bu~ and addre~s lines A17-Al9 of the control bus via control bus buffer 302. Additionally the read/write line MR/W is decoded to form the memory select signals in the circuit 300. The memory select decoder 300 also produces a memory select ~ignal I/O for input and output from the peripheral devices.
The memory select decoder circuit 300 determines which of the memory areas of the memory space, i.e., DRAM, PROM, or I/O that the microprocessor 304 i6 accessing. The memory select decoder circuit 300 does this by decoding the address lines to determine which area in the memory ~pace a particular memory device or I/O device has been assigned. For I/O devices the memory select decoder 300 also receives the interrupt acknowledge 6ignal IAK from an interrupt acknowledge decoder circuit 298. The interrupt ~'7`t; ' . J
12762g~

acknowledge decoder Circuit 298 recoives a three bit word on ~nterrupt lines FC0-FC2 from the microprocessor 304 and the control line AS to detormine that the microprocessor 304 has answered ~n interrupt code.
The nicroprocessor 304 communicates with the preprocessor 302 by accessing the output buffer ~emory 286 with the address lines A0-A15 via address bus buffer 306 and data bus lines D0-D7 via a data bus buffer 308.
Control lines from the ~icroprocessor 304 used to access the output buffer memory 286 via a control line buffer 402 additionally include the phase two clock signal J2, the read write control line MR/W, the reset control line RESET, and the virtual memory access control line VMA. The ~2 ~ignal is generated from the E
clock output of the microprocessor 304 and is an internally generated clock signal phased to the processor cycle. The VMA signal from the microprocessor 304 indicates that the memory that is being accessed is not in the ~tandard memory space and in combination with the I/O signal is combined in an ANP gate 404 to become the VMA ~ignal to the output buffer memory 286. The read write control line MR/W is generated in a normal manner via the control bus buffer 302 from a control line of the microprocessor 304. The reset ~ignal RESET
iB generated by a Dicroprocessor reset circuit 400 which additionally supplies the 6ignal to the microprocessor 304 during power ups and for recovery of other special conditions.
The microprocessor 272 of the preprocessor , the CRT terminal 208, and plotter 204 communicate with the microprocessor 304 of the main processor via interrupt request line~ IRQ4, IRQ3, and I~Q7 which are decoded in an interrupt decoding circuit 296. The interrupt decoding circuit 296 decodes the request into a byte code on interrupt signal lines IPL0-IPL2 which are ~nput to the microprocessor 304. Interrupt hanaling -" i~76Z4~
` -35-routines there~fter eontrol elearing of the interrupts ~nd prioritizing the I/0 from these peripheral devices.
~ his system configuration shown in Figure 8 is ~ generally conventlonal 6ingle board eomputer system for a nicroproce-s~r control such as the MC 68000. The labelea microprocessor control, address, and data lines are those which are standardly used in the art to designate the functions described. The memory and ~election circuitry are commonly known to those skilled in the art and ean be e~panded or contracted depending upon needed ~emory 6ize. Since Figure 8 represents a standard eonfiquration for a MC 68000 microprocessor control, additional detailed description of the eireuitry illustrated in this drawing need not and will not be provided.
The hardware block diagram for the communication links between the plotter 204, the CRT
terminal 208, and the microprocessor 304 i8 shown to advantage in Figure 9. Data from the microprocessor 304 ~re transmitted ~ia a transceiver chip 610 to a pair of receiver-transmitter controller chips 600 and 602 respectively. The D0-D7 terminals of the chips are both input~ and outputs where the direction of the transeeiver ehip 610 eontrols the inflow and outflow of data between the plotter 204, CRT terminal 208, and mieroprocessor 304. Eaeh eontroller chip has a receive terminal RXD and a transmit terminal TXD by which serial data are input to and output from a buffer on the chip.
By controlling the other input~ of the device parallel data, one byte at a time, ean be input to and output from the transceiver ehip 610.
The controller ehips 600 and 602 run at a frequency controlled by the output of an oscillator 608 eonnected to their RXC and TXC terminals. The oscillator can generate any convenient frequency which eould be different for the recieve and transmit channels of eaeh deviee or different for the plotter 204 and CRT

` ~;Z76Z4~

terminal 208. ln the illustrated embodiment, however, each device i~ run at the ~ame frequency for both receive and transmit channels, preferably at 9600 baud.
The control chip 600, for esample, is dedicated to the plotter 204 and i6 connected at its transmit terminal TXD to the B input of a transmitter chip 606 which drives the transmit terminal XMT+ of the plotter.
The RXD or receive terminal of the control chip 600 is connected to the Ya output of a receiver 604 which receives serialized data from the RCV-, RCVI outputs of the plotter 204 at the A+, A- input terminals of the receiver.
Similarly, the transmit terminal TXD of the controller chip 602 is connected to the input A of the transmitter 606, which produces a serialized data output Ya to the XMT+ terminal of the CRT device. The receiver terminal RXD of the controller device 602 is connected to the Yb output of the receiver 604, which accepts serial data fro~ the CRT terminal 208 outputs RCV-, RCV+
at its input terminals B~ and B-. The interface between the plotter 204, C M terminal 208, and the receiver 604 and transmitter 606 is a conventional R232C
communication protocol. The receiver 604 and transmitter 606 perform a buffering and conditioning function for the ~erialized data and are able to transmit and receive characters or data bytes via the communication links to the plotter 204 and CRT terminal 208.
Control of the I/O for these communication links i6 proviaed by the address lines A0, A8-All and a coded select ~ignal line OSEL. Further control lines from the microprocessor 304 are the virtual memory access signal VHA, the phase two clock signal 02, and the read/write signal R/W. The com~unication links request information transfer with the interrupt request6 IRQ3 and IRQ7 to the microprocessor.

~ 76Z4~.

The ~ignal VMA notifies nonstandard memory space devices that they are being addressed and thus the VNA signal enables t~e controller chipg 600 and 602 by being applied to their CSl inputs. The particular chip electea, which determines whether the plotter 204 or CRT terminal 208 will be communicating with the main processor 304, is determined by the address output from the microprocessor 304 on the respective address lines and as decoded by an AND gate 612. The decoded addresses are applied to the CS0, CS2, and RS inputs of the devices 600 and 602. The inversion of the output of the AND gate 612 by an inverter 614 prior to its transmission to the ~ input of the controller device 602 provides address diwrimination between the two control chips. The read/write signal R/W from the ~icroprocessor is connected to the read/write terminal R/W of each control chip 600, 602 to determine the direction of data transfer and further to determine the direction of the transceiver chip 610. The E inputs of the control chips 600, 602 are connected to the phase two clock ~2 to provide timing for the data transfers.
In operation both control chips 600, 602 work identically in that for a read operation serial data are input from the receiver 604 to the RXD input where they are placed in a buffer. The buffer is 8 bits in length and has parallel outputs to the D0-D7 terminals of the chip. Once the data have been buffered, the particular controller chip will provide an interrupt request from its IRQ terminal to notify the main processor 304 that data are ready. In the main processor 304 an interrupt routine recognizes the particular interrupt and generates the address of the device havinq data with a reaa data signal on the read/write line R/W and a virtual ~emory access signal on the VMA line. This produces ~ byte output to the microprocessor data bus via the transceiver 610.

.. . . . ..

lZ76Z4 For a write operation data are output in paralle~ on the data bus D0-D7 to the parallel input ~ of one of the controller devices and loaded therein by the ~rite siqnal and the respective address signals. The data loaaea into the buffer of the control chip cau~e a erial transmission of the data bits from the TXD output to the transmitter 606. The transmitter thereafter transmits the particular digital data to the transmit terminal XMT+ of the device selected.
The controller 600, 602 chips appear as memory locations to the nicroprocessor 304 which may be read from or writter into in byte format. The controller chips 600, 602, transmitter 606, and receiver 604 perform the serializing of the data and the timing necessary for transmi~sion and reception of the data.
With respect to Fiqure 10 there is shown a flow chart for the control program storea in the microprocessor 232 ~figure 5a) of the signal conditioning means 200. The program initializes the system control of the 6ignal conditioning means by first inhibiting the interrupts to the microprocessor in functional block A10. ~ext the sample store is cleared in block A12 which allows a new set of data to be recorded therein. The sample store i8 an area in the microproces~or memory in which an integral sum of the digital aifferences for each channel can be stored. The ~ample store iB illustrated figuratively in Figure lOb and shows that it contains 16 memory locations each 16 bit~ long to provide storage for each individual channel.
Returning to Figure 10 the program continues its initialization ~teps by configuring ports Pl, P2, P3 and P4 of the ~icroprocessor as either input or output in blocks A14, and A16. Thereafter an output terminal SC2 i8 configured a8 a control strobe line in block 3S A18. Next in block A20 which is labeled LOOP the program ~imultaneously generates the analog to digital conver~ion output strobe along with outputting the 4~ ~ ) previous channel value for the ne~t channel and advancing the multiple~er address. ~hese commands are provided siJultaneously with one command by the ~icroprocessor via the output ports. Block A22 5 illustrates the actual AlD conversion of the digital word output by the software command. The circuitry of L
the ignal conditioning means thereafter carries out the software commands to produce the desired result.
After a cycle is started by generating the 10 hardware commandæ from blocks A20 and A22, the converted difference value of the channel input from the A/D
converter i6 read into memory. This difference value which is also latched into the data latch for further 15 transmission to the preprocessor, is then added to the current value for the present channel and the sum stored in the sample store at the appropriate location for the channel. These functions are provided at blocks A24 and -`~
A26 of the programming prior to executing the next block -~
A28 which transfers control back to the beginning of the loop at block A20.
The process of converting the multiple~ed input channels to digital difference values is performed by continuously looping through the blocks A20-A28 of the 25 microproces~or program and incrementing the multiple~er address channels. FIG. lOa is representative of a `--~
simplified block diagram of the conversion process for a "~
single channel. A su~ing junction 301 is representative of the combinational circuit 220 of FIG.
30 5 where a reference voltage REF is subtracted from the input signal value V6(t) from the multiple~er.
Additionally, the analog value of the signal at the time period just previous to the sampling V8 (t-l) iæ
subtractea at the summing ~unction 301. The output of 35 the summing ~unction then is V8 where the signal represent6 the difference between the sample values of the input signal over one time period. Since the sampling rate is relatively fast and the ECG signal ~, ' .
~' '' .
. , .

1;~76Z~

waveforms do not change quickly with re~pect to the sampling rate, V6 represents a s~all portion of the r~nge over which the signal V5(t) can vary and is the aigital derivative of the signal. The difference signal i6 digitized by the A/D converter 307 and latched into the latch 309 during one cycle.
The previous value 6ignal V6(t-l) is generated by the diqital to analog convsrter 303, and a digital intergrator 305 continuously summing the differences output from the A to D converter 307. ~he integrator 305 is represented as pesforming a digital integration which is the ~ummation of the differences output from the device 307 over a time period relatively long compared to the sampling time. If the digital integration is performed with a large bit size integrator and matching digital to analog converter, then the analog difference signal at the summing junction i8 of a very high resolution. Although the A
to D converter 307 converts only a portion of that signal, this high resolution is maintained with a analog to digital converter of lesser bit length than the elements 303 and 305 because only the difference is converted. In the preferred embodiment the bit size of the integrator 305 and the digital to analog converter 303 i8 16 bits and the bit size of the analog to digital converter 307 is 8 bits.
Figures lOc-lOf illustrate the timing for the conversion. The conversion cycle ~tarts with a flash conversion on the rising edge of the STB signal which produces the 8 bit digital output. Once the conversion iB complete, the next cycle is started by delaying a short time and then starting the A/D conversion and advancing the MNX channel address in Fig. lOe. Thi~
allow~ the maximum time for the analog signals to ~ettle down before the conversion. The cycle is ended by latching and storing the difference in Figure lOf at the falling edge of the strobe.

~Z76Z4~.

In FIG. 11 there is illu~trated a sy6tem flow chart for the progr~m ~tored in the micsoproce3~0r 272 of the preproce8~0r 202. ln that figure the program ~n~tiates at block A100 With ~ ~ubroutine that ynchronizes the clock of the signal conditioning means 200 with input of one block of data to the input buffer memory 262. After the memory has been ~ynchronized with the program control, the 256 word input buffer which is not in use i~ input to the microprocessor memory via 10 block A102. Ne~t the sample pairs of data are integrated in block A104 to provide a reconstruction of the signals which were differentiated in the conversion process.
The ~ample data is then fed through a bandpass filter in functional block AlOB prior to its passage through a ~econd bandpass filter in functional block AllO. The bandpass filters with respect to their frequency response are illustrated in Figure 12, where the more selective filter response is shown by a waveform 333 and the lesser selective frequency response is illustrated by a waveform 331. After the bandpass filters are applied, a noise filter in functional block A112 generates an average indication of the amount of noise that is in the sampled data. The program after 2S providing the noise filtering, checks for lead failure in block A114 before ~umping to a subroutine which detects pacemaker pulse~ by checking for ma~imum slope values between two samples for all the leads in block A118. The data blocks Zl-Z4 are then transferred to the output buffer memory in functional block A124. This provides a means for allowing the main processor 206 to access this data from locations in memory when the preprocessor 202 indicates they are available.
The three leads X, Y and Z are then formed by combining the differenced pairs and parallel summation inputs in blocks A126-A132. The X, Y, and Z leads are formed of their component parts and a lead for value SL

1~7624i i8 additionally formed in block A130 as the ~um of X, Y
and the Vl-V5, and the V9-V10 differonces. At this point the leads are averaged over four samples for alias filtering and formed of the parallel parts making up the individual leads.
The program then advances to block A134 where an interrupt is generated to indicate to the main processor that a complete cycle of the preprocessor 206 has occurred. Data for the main processor 206 are then available in the output memory buffer ana can be input to the nain processor for further calculations. The microprocessor of 272 the preprocessor 202 then executes a transfer of control to block 102 from block A136 to begin a new cycle.
In Figure 13 there is shown the system flow chart for the program ~tored in the microprocessor 304 of the main processor 206. A detailed program listing in the ~C~ language is provided for this program in the application just prior to the claims.
The main processor program initiates at the function block A200, where a number of variables are initialized, and structures, tables and arrays are set up for data manipulation. Thereafter, an operator controlled loop i8 entered in which the input data buffer from the CRT terminal 208 is checked to determine if any one of a number of control key6 have been operated. The operation of particular keys indicate the function which the operator desire6 the system to perform. In block A202, if a ~9" is found in the input buffer a transfer to routine called START is made in block A206. The routine START provides a reset function to place the system in an initialized state.
If a ~1~ key i8 found in the input buffer in the functional block A204, the affirmative branch of that decision block take~ the program to a subroutine call in block A208. In that block a call to the routine R~PLT i8 made to begin a rhythm chart recording of the ~' 1;~76Z4 X, Y, ~nd Z leads. The rhythm plot rout~ne wlll plotthe sampled data fro~ an lnput buffer in the main processor 206 and provide rhythm strip recording control for the plotter. After the plotter is done outputting S the rhythm trip record, the program advances to block A210 where the subroutine RESYNCH i~ called to resynchronize the progra~ to the inco~ing data.
The proqra~ ne~t checks whether a "2" is in the input buffer in block A212 and finding an affirmative answer branches to block A214 where the subroutine HIGAIN i~ called. The subroutine HIGAI~ is to provide a scaling of the data to a higher than average gain multiplication. ~fter this program has finished, the program makes another call to the routine RESYNC~ in block A216.
~ he program thereafter returns to the initial flow path where the CRT input buffer is tested to determine whether a U3 has been input. When the numeral representing thi6 key i~ found the program,transfer~ to control block A220 where the subroutine PLOT i8 called. The PLOT subroutine is used for the interface between the plotter and output variables of the proqram. The routine also proauces a call to the routine FIRFLT and the routine BUTFLT which performs and high pass filtering of the averaged data by a finite impulse response filter and a 4 pole Butterworth filter, respectively. The outputs of these filters are provided to the PLOT routine so they can be displayed on the plotter. By calling the subroutine PLOT the operator thereby produces a visual record of the special feature~ detected by the system. As with the other 6ubroutines after a call to the routine PLOT, the system reinitializes its clock with a call to the routine RESYNCH in block A222.
If eitber the key representing ~4~ or U5~ is pressed than the plotter magnitude control variable is changed. The maqnitude control variable PLTMAG is ~ ?~ ) 7~i24~

multiplied by two ln A226 for a key representing a "4"
and iB divided by 2 in block A230 for a key indic~tive of an input of a ~5 N .
A ~7" key in block A232 will produce a call to the ENTER ID subroutine in block A234. In this ubroutine a 6et format i6 output to the CRT display such that it requests the operator to enter his identification. For example, the routine requested the operator to type in the name of the patient, the time 1~ and other data critical to creating a record for the ~easurements. The program is thereafter resynchronized by making a call to the subroutine RESYNCH in block A256. The program will then return the main loop as previou61y de6cribed.
15In block 238 the character in the input buffer te6ted for a ~70~ which causes the program to call a ~ubroutine DUt~ in block A240. The DUMP subroutine is a specialized routine called by this particular character sequence to provide outputs of the data buffers and memory location6 for diagno6tic and other purposes. The Y~ RESYNC11 routine i- again called in block A242 after the DUMP routine in block A240 has been executed.
Next, if the data input key is equivalent to ~6~, a subloop of the main routine i6 executed in which the generalized averaging i8 accomplished. Initially the subroutine QRSDCT is called in block 245 to detect the QRS morphologie6 with the aid of the bandpass filter data. Next the 6ubroutine SYNCH is called in block A246 to calculate accurate timing marks for the input ~ample aata. The SYNCH routine produces the fiducial timing marks from which an alignment in performed between beat waveforms. Next the subroutine RY~M is called in block in A248 to produce the discrimination between average beat waveforms and the dominant rhythm complexes and subsequent to the execution of blocX A248 the subroutine DISP~AY is called in block A250 to provide a means for displaying failed leads on the CRT screen.

1~624~ ' `) After comploting the ta~ks in the prvious blocks, the variahle TINE is tested in block A252 to determine whether it iB equal to a predetermined number N. If not, T~ME is incremented in block 254 before transferring control to block A244. If, however, TIMæ
iB equal to N then the routine GETSMPL is called in block A256. Thi~ portion of the program insures that the routine GETSMPL is e~ecuted at least as often as the variable TIME reaches its test contact N. The GETSMPL
subroutine is used to input dat~ from the microprocessor data buffer and to call another subroutine AVRG which actually completes the averaging task. The program then returns to block A244 and continues the loop until another key is depressed other than the U6~ key thereby lS causing ~n e~it of the subloop and a return to the start of the main loop at block A202.
The following is a generalized description of the averaging process that provides X, Y, and Z
composite6 which are free from noise, odd beats, etc., while not 1O6ing the low amplitude, high frequency information nece6sary for the detection of the special feature6. The averaging process for the system comprises the detection and labeling of the beat waveforms, the synchronization of those waveforms which are of the dominant r~ythm, and thereafter the averaging of ~ampling points in each of the waveform~ which are acceptable for averaging. The detection and labeling function is accomplished by the routine QR3DCT which in general selects a number of types for the waveforms and a number of templates corresponding to each type from the bandpass filter samples. The routine sweeps the beat waveform6 through the set of the templates to determine if they match any of the chosen templates within a certain degree and labels those which pass as to type.
A beat waveform is considered to have matched one of the templates if a ratio can be minimized to a 1;i~7624~

particular referenco lovol. The ratio is formed from the absoluto difforence between the tomplato ~ample and the particular beat waveform ~ample being tested divided ~y the absolute ~um of the values. The division by the S um of ehe values determines the nearness of the sample value to the template as a percentage of the total. In the preferred embodiment, if a beat waveform matches within 15% of a chosen template it i8 considered of that type.
A dominant rhythm template i6 chosen to di6criminate between a dominant rhythm in the information received and other types of the beat waveforms in the routine termed RYTHM. Those waveforms which pass the matching process of the dominant rhythm template are then provided with a fiducial timing mark in the routine termed SYNCH which essentially marks the beginning of each waveform. The timing mark is produced by generating another template around the onset of the QRS comple~ and minimizing the difference between the template over a certain time interval of the QRS
waveforms. The interval i8 chosen such that it will be substantially certain the onset of the QRS falls within that time period. The onset of the QRS waveform is cho~en for the fiducial templating procesæ because it is a landmark which i~ relatively available and reproducible for many of the beat waveforms and does not change as much as the following portions of the QRS for variances in respiration.
After the fiducial mark i8 inserted in each waveform, the waveform can be summed with the other dominant waveforms which have been detected in the routine AVRG. The ~ummation takes place for all aligned ~amples of the waveform, and a number i6 recorded for how many samples were summed for each time position of the average waveform. The number of samples for each time position i~ necessary because all waveforms are not of the same length and thus some time positions may have ~ore ample8 ~dded to them than others. An ~verage composite waveforn for ~ach of the X, Y, and Z i~ formed from these data a~ples by dividing the time positions for ach ample by the number of samples which have been 5 u~ed for that position.
Figure 20 i6 a graphical illustration of part of the detection and labeling process. Wavefor~s 341, 343 illustrate the samples of the outputs from the bandpass filters 215, 217 re6pectively. Almost all features of the waveform other than the R-segment frequency have been attenuated. The peak points of the filtered data 335, 337, 339 are used as the peaks for the wavefor~s. Thereafter, a template is for~ed of the X, Y, Z values of both bandpass filters at this position. The nininization of the ratio of this template take6 place a6 previously described. Figure 21 illustrate~ the area in which the template for the fiducial ~ark iB obtained. The obstensible on6et 345 i8 bracketed by the range 347 which i6 5 millisecs before and 15 milli-ec6 after the on6et.
The routine QRSDCT will now be more fully explained with r-ference to Figures 14a-c. The QRSDCT
routine accompli~he- a detection and labeling function for the beat wavefor~s when it i~ called from the main program. If it has det-cted a dominant type waveform and labeled it it will return with a 0 6uch that the routine6 SY~C~ and RYTHM can be called to align the detected waveform with others of type 0 and prepare it for averaging. The routine begins at block A300 where the RR interval i~ set equal to the present time ~inus ; the la6t time. Thereafter, in block A302 the variables of the routine are initialized to their starting values and the program continues to deci6ion bloc~ A304. In that decision block it i~ determined whether or not there have been more than 350 preprocessor interrupts.
If this i8 the case then the data buffer for the main ; processor i~ loaded with sample data to a greater extent ~,~
~ ,,, lZ76Z4~ .

than necessary for the progra~ ~nd therefore ~ome of the older amples from the preprocessor c~n be discarded.
If the answer is affirmative the variables TIME
~na RR are incremented in block A306 prior to calling the ~ubroutine GETSMPL in block A308. Calling GETSMPL
cau~e~ one of ehe ~amples of the main processor data buffer to be taken and put into a working buffer for the detection and alignment routines. The routine also decrements the interrupt number such that a loop through block8 ~304-A308 discard6 the olde6t samples of that main processor buffer until the number is less than 350.
At that point the program continues to blocX
A310 with the last data taken by the routine GETSMPL in the working buffer. In block A310 the two variables RR
and TIME are again incremented to keep track of the position in the waveform and the amount of time spent in the loop respectively. Thereafter, in block A312 the routine GETSMPL is again called to provide a new sample for the working buffer. Two tests are now performed in blocks A314 and A318 to determine whether the lead failure variable LFAIL i~ not egual to zero or the key presently input from the CRT terminal is not equal to a ~6~. If either of tbese conditions are true which indicates there has been a lead failure or that the operator has pressed a different key than ~6", then block A316 i6 executed before the routine returns. The function in block A316 i~ to set the flag QRSF to 1 such that the averaginq and alignment routines will not be executed.
If these initial tests are passed then the program continue~ in block A320 where the RR interval is tested to determine whether it is egual to a constant 16. If it ~ then in block A322 a minimum power reference MNPWR is set equal to an initialized reference value. Next in block A324 ~ pointer Pb is developed for the detection filter data such that it can be : ~ . ... . ..

1;2 76Z4i addressed. Following this operation in bloc~ A326 the ~bsolute value for the X, Y, and Z ~ignals in the detection filter data are summed together to produce the variable POWER. This sunmation i8 an indication of the peak power level at the time position of the waveform being esamined. Ne~t tests in A328, A330 are accomplished to determine whether the power calculated in block A326 i8 greater than the minimum power variable MNPWR that was calculated in block A322. If the variable POWER is greater than the minimum power and at this time the peak power i8 still zero then the peak power variable PKPWR is set equal to the calculated power.
At this time the program has determined that the waveform has either passed the minimum power test or it haæ not in block A334. If the peak power is still zero, a te6t i6 performed to determine whether the peaX
time iB greater than 20 time segments after the peak in block A348. If not then the next 6ample and an iteration of the loop i6 accomplished by transferring the control of the program to block A310.
However, if the peak power is now greater than zero thereffl passing the affirmative test in block A334, a subroutine XFRTPT will be called in block A336 to transfer the detection filter template to a buffer labeled ZTMP. Thereafter, a ~ubroutine MATCH is called to match the present samples against the detection filter template. This routine minimizes the ratio for the samples and returns the absolute difference between the sample and the template and the absolute sum between the 6ample in the template at the time of the minimum match. Additionally the routine returns the variable QTYP which i~ indicative of the label type applied to the present data.
In block A340 the power term is compared to the peak power term and replaces it in block A344 if greater than that variable. If the power of the present sample lZ7624~ 3 i8 less than the peak powor then the peak time PRTIME i8 incremonted by one in block A342. Subsequently, the aecision block A348 i~ exocuted to determine whether the number of iterations has brought the program to a peak time of greater than 20. This point in the program indicates that the ampling and ~weeping of the waveform through the template has taken the present time position 80 milliseconds past the peaX.
Next in block6 A350-A354 the minimum power variable MNPWR is calculated to insure that it does not become greater than twice the variable AMIN. In decision block A356, if the number of QRS waveforms that have been detected i8 ~ero then the time variable TIME
i8 et in block A35B to the la6t time a QRS was detected minus a constant 10. Thereafter, in block A360 the pointer PS is et egual to the starting address of the match and filter templates to provide another templating proce~6. In block A362 the pointer PB is ~et equal to the addrees of the detection filter element ~0] which is calculated a6 the variable A. This is the detection filter sample data at the time of best match as determined from the match routine.
Thereafter in block A366 the program tests whether the ratio that was returned from the match 25 routine iB le-8 than 400. If the te6t is true the program continues to block A368 but if false the program ~kips block A368-A394 becau6e the ratio is too large to be minimized and it is evident that the waveform detected is not the type matched.
However if the program takes the path to block A368 a further template is 6tored by routine XFRTPT in the next memory area following ZTEMP which i8 the filter data one time period prior to the data stored in block A364. In addition subroutine XFRTPT is called again in block A370 to store another template in the next memory aroa of ZTMP which is the detection filter data one time period subsequent to the best match filter data. Next 76Z4i ~n block A372 ~nd A374 vari~bles DIFl, DIF2 and the pointer PB are initiali~ed. The polnter Pb i8 initialed to the first address of the template data buffer ZTMP.
A loop comprising blocks A376, A378, A380 and A382 are ~ecuted to calculate a value for the variables DIFl and DIF2 from the template data ~tored in the buffer ZTMæ. In blocks 386 and 388 the differences are then multiplied by constant and divided by the variable SUM which was returned from the initial match. In block A390 the difference DIFl i6 tested to determine if it is le6s than RATI0 and if it iB then in block A392 that value replace6 the value of the variable RATI0. If not the econd difference DIF2 is tested to determine whether it i6 le6s than the variable RATI0 in block A394. If the test is affirmative the value of the difference DIF2 replaces the value of the variable RATIO
in block A396. Thus, the routine checks one template before and after the best match template to ensure it has correctly found a minimum.
If by this time the ratio i8 less than 150 as determined by block A398 the program passes to black A412. However, if the ratio is greater than 150 the program ha~ decided that this i6 not a type 0 or type of waveform which i~ fit for averaging. Therefore in block A400 the number of QRS complex types, NQTYP, is tested to deternine whether it is less than 3, and if it is, then the program sets the last time equal to the present time minus 10 in block A404. The type label TYP for the waveform detected iB set equal to the present value of QTYPE in block A406 and that variable incremented one in block A408. Next the subroutine XFRTPT is called to transfer the filter detection template at the peak power point of that waveform in the buffer area template. If the number of QRS types is greater than 3 as indicated by a negative branch from block A400 then the type of the waveform i8 set equal to 2 and the program transfers control from block A402 to block A412.

`) In block A412 the program continues by decrementing the RR interval by the difference of the variable LTIMæ and (TIME ~ 10). Afterwards in block A414 the variable NQRS i6 tested to determine whether the number of ORS waveforms detected is O. If the ~nswer is affirmative then the RR interval is set qual to 200 in block A416 ~nd the program proceeds to block A418. In that block the number of QRS waveforms detected NORS is incremented by one and the variable TIME decremented by 23 in the next block A420. To exit the routine the flag QRSF ( indicating that a QRS
waveform has been detected) i8 set egual to zero in block A422.
The next routine that will be discussed is the part of the program SYNCH that provides the fudicial timing mark for the waveforms. The program i6 better illustrated in Figures 15a-c where it begins in block A423 by setting the variable ADJ egual to zero. The variable ADJ will be used to adjust the onset mark of a waveform such that it aligns with all the other - waveforms in a normalized manner. In blocX A424 the variable TYP is tested to determine whether it i~ equal to zero. If the waveform is not a type zero waveform then the synch routine automatically returns because only those waveforms of type zero will be averaged.
Thereafter the variable CNT is set equal to a number storea in the ZBAR array element tO] in block 425~ If ^-this count is zero as tested in block A426 then the program returns.
However if the count is less than eight a path including the affirmative branch of block A427 is executed to transfer control to block A428. In that block the variable PBAR is set equal to a number which i8 60 ~illiseconds prior to the detected peaX which is indicated as the variable QTRGGR. In the next block A429 the pointer Pz is set to point to a buffer area te~plate. Next a block of instructions from functional i ~Zq62~1 block A430-~436 ~8 exocuted to form an average tompl~te from ten incr~ents prior to the Q trigger detection point to ten units after that point. This template i8 averaged over the first eight counts of the routine as the loop i 8 e~cecuted.
Next if the count has now increased to eight the affir~ative branch of block A437 is taken to the call up the subroutine QONOFF in block A438. This ~ubroutine determine6 the onset and offset of the QRS
waveform from landmarks in the ~ampled data. After the onset has been determined, the amplitude of the particular waveform is calculated as the difference between the peak and the onset value in block A439.
This value is divided by four to generate a reference value with which to compare the template. Thereafter the end variable TEND is defined as the onset point plus fifteen in block A441. Next a loop i6 entered in which the absolute difference between the onset and the end point i8 co~pared to the magnitude of each sample and 20 the end point incremented until the test in block A442 i~ affirmative. When this occurs the two points QONSET, TEND have been moved acro~s the waveform to where they reach a point which has an amplitude which is one quarter of the R wave amplitude. Thereafter in block 25 A445 the pointer Pz i8 ~et equal to the beginning of the template address and a new template formed in loop 446-452 of twenty points from five milliseconds previous to the onset point to fifteen milliseconds after the onset point. The program then exit6 the loop with a 30 negative branch from block A446 to block A453 where the pointer PBAR is remembered as the variable PBARS.
For iterations greater than eight in block A454 the pointer PBAR i~ initialized to the constant PBARS
and the program continues to block A456. In that block 35 the variable AM i8 set equivalent to the sweep variable SWP, and in the following block A457 the variable ~IINDF
i8 set equal to a large con6tant. The pointer PZ i8 ~ ~ .

~Z76Z41 then calculated in blocX A458 a~ three times the quantity of a summation of four terms. The first term in the summation is the address PZIN of the input data buffer. The second term i~ the negative of the present S time minu~ the la~t ti~e plus Q trigger divided by four. The third term i~ -~ (P~AR-80)-ZBAR]/4 and the fourth term i~ the sweep variable SWP.
The pointer Pz indicates where to start the templating process in ehe raw data. In the next two blocks A459, A460 the program checks to insure that the pointer Pz i6 not less than the starting address of the input buffer ZIN. If it i6, then the address is incrementea b~ a con~tant (NRAW x NLD) which brings the pointer back to the beginning of the input buffer.
lS Thereafter the pointer Pb i~ ~et equal to the beginning of the temporary buffer ZTEMP where the calculated template data i~ stored. In the loop formed by next block~ A462-A470 the raw data from the buffer PZIN are transferred to the working buffer ZTMP. Each lead has 20 (SWPTOT 120) number of raw data ~amples transferred where StYPTOT $s equal to fifteen from previous program definition.
After the loop has been executed and all the data samples are stored in the temporary buffer ZTEMP, 25 the affirmative branch from block A462 takes the program to block A471 where the pointer Pz is redefined as its present value incremented by ((30-S~TOT) x NLD). Next the pointer Pb is set equal to the start of the temporary buffer ZTEMP in block A472.
A loop comprising blocks A473-481 follows in which the template data i6 subtracted from the raw data and the differences put back into the temporary buffer ZTEt~. The program continues after the transfer has been completed by taking the negative branch from block 35 A473 to block A482. In this operation the progra~
reset~ the pointer Pb to the start of the temporary buffer ZTEMP and set~ the pointer PBAR equal to a variable DIF~ST. Ne~t a loop i8 entered in block A483 where the program will repeat the 8tep6 of block A4B4 to block A489 until the pointer Pb is equal to the start of the buffer plu5 St~TOT s ~LD. In this loop the data in the temporary buffer ZTEMP are ~ubtracted from the template data and the difforence6 tested to determine whether they are less than a variable MINDIF. If the difference calculated i6 less than the previous minimum difference than that value replaces the variable MINDIF.
Accordingly, an adjustment factor ADJ is also remembered by setting it equal to the saved value ADJS.
Otherwise, if the value of the difference calculated in block A485 is greater than a previous difference, then the pointer PBAR i6 incremented and the adjustment factor ADJ is incremented in block A457. Thus an adjustment factor ADJS i6 calculated by searching for the minimum difference between the template data and the raw data.
The minimum difference in blocX A490 is set equivalent to a variable indicating a possible difference POSDIF which might occur between two of the adju6tment time periods. After that block is executed and only if the saved adjustment factor ADJS is less than StYP-2 (which is equivalent to five milli6econds) 2S does the program enter a loop 6tarting at block A492.
If on the other hand the adju6tment factor i8 greater than five millisecond6 then in block A498 the count is tested to determine whether it is greater than eight.
If it is then the waveform is labelled a type "6" in block A497 and if not simply returns to the location from where it was called.
If the adjustment factor ADJS i6 less than SWP-2 then a pointer PBAR is set equal to (ADJS ~ St~
DIFLST). For these variables a value for the variable POSDIF is calculated by a interpolation using a hyperbolic estimation between time periods. After the calculation i~ accompli6hed, in block A494 the variable `- ~Z~76Z91 POSDIF is to~ted to deter~ine whether it ~s greater than 2500 and if not the program ~imply returns. However, if the variable POSD~F i~ groator than this constant and the count iB greater than 8 a8 testod for in block A495 then the type for the waveform is set equal to 7 in block A496.
The routine RHYTHM will now be more fully explained with reference to Figures 16a-b. The rhythm routine performs certain tests on the type of beat waveform labeled in the QRSDCT routine and mandates a certain format for the waveform prior to averaging.
Additionally a template for the dominant rhythm or type O waveform i8 calculated in this routine. The last task of the routine i8 to assign the alignment mark which was calculated in the routine SYNCH.
The routine begins at blocX A600 where the pointers PZBAR, Pc, and Pb are initialized. The pointer PZBAR ~8 set oquivalent to zero while the pointer PC is initialized to the address beginning the Q~S buffer PQRSB. The pointer Pc initialized to the start of PORSB
plu~ an increment value found in the first element of the array QRSLST. The next two functional blocks A602 and A604 are to prevent the pointer Pb from obtaining a value greater than QRSLST~16. If that value is exceeded then the pointer Pb i~ reset equal to the beginning of the data list QRSLST in block A604. Next a test iæ
performed in functional blocks A606-A612 where the type of the beat waveform, its length, and power are compared against reference values. If the present waveform type as indicated by the variable TYP is not zero and its length is less than 45 millisecs, then the program considers this not a normal waveform and therefore the aetection must have been of either of transient noise or pos~ibly a T wave segment. If both of these conditions are true, then a ~econd set of tests is performed in block A610 and block A612 to determine whether the last type of the waveform LTYP is zero and whether the 1Z76Z4~.

present peak power PKPWR is le88 than the last peaX
~mplitude LPKAM8 If oither one of these questions ~s ~nswered in the affirmative then the progra~ transfer~
to block A614. In block A614 the variable TIME is reset to the value of RTIME and the number of QRSs (NQRS) decremented in block A618. Since the routine cannot average thi6 waveform, the progra~ will return from the location from which it was called.
However if the ample data pass the tests in blocks 610, 612, another set of tests is started in block A620, where it is determined whether the last waveform type QTYP was equal to zero and whether the last peak power LPKPWR i 6 greater than the present peak amplitude PKAMP. If this i6 the case then another test i8 performed in block A622 where the RR interval is tested to determine whether it is less than 45 millisecs or greater than 75 millisecs and the present type waveform TYP i6 zero. If all these conditions are present, then the previous waveform was also improperly counted. To take this improperly counted waveform into the account, RR interval is incremented by the constant RINT, the time RTIME is incremented by RR16, and the number of QRSs counted ~NQRS) decremented in block A624.
Subsequent to these two sets of operations, the program will now attempt to label the waveform as a type zero such that a template can be ~elected for the dominant rhythm. The selection consists of initially determining in block A626 if the number of QRSs detected, NQRS, to this point is greater than two and less than eight. If the variable NQRS is in this range, - the type variable TYP is not yet equal to zero, and the present RR interval greater than RR16/16 then ehe program will assign this waveform the label type 0. The number of QRSs detected is reset to 2 in block A628 and the template for the particular waveform is transferred in block A630 into the buffer TMPLT by the subroutine XFRTPT. Ne~t in block A632 the type variable TYP is set _5 8--equal to ~ero ~nd the number of these types counted NQTYP is set equal to one. Thereafter, in block A634 the average array ZBAR is cleared to zero.
As soon as the program recognizes eight waveforms of similar type in the QRSDCT routine it will assign a permanent template to the label type zero and this will become the dominant rhythm. If however not enough waveforms are detected to make a permanent as6ignment, the next waveform that appears that is not type zero and meets the other criterion will cause a relabeling of type 0. Thus, the dominant rhythm must appear for eight consecutive beats before the permanent labeling takes place.
At this point the program proceeds to block A636 where the variable QCNT is incremented to provide a running count of the number of QRS waveforms found to this point. ~ext in block A638 the variable NQRS is compared to the number 16 to determine if there have been sixteen QRSs counted to this point in the program.
If the answer is affirmative then the variable RR16 is set equal to the RR/4. Otherwise in block A642, the variable RR16 is set equal to the quantity (TIME-RTIME).
The values of the present variables are thereafter assigned in block A644 to values of the previous var~ables and the pointer PBAR calculated in block A646. The pointer PBAR i6 calculated as the position in the average data where the waveform should have the fiducial mark inserted. Ne~t in blocks A64~
and A650 the pointer PBAR is tested to ensure that it is not less than the beginning of the average data buffer ZBAR. If it i6 then its value is set equivalent to the start of that buffer in block A650. The value of the ~ pointer PBAR is stored in an intermediate variable -~ PZBARI in block A652 to remember that value.
~ 35 In block A654 the pointer Pc is calculated from ; the expression shown. The pointer is calculated to ~ point to where the fiducial timing mark should be stored ~ `

~`3 ~ ) in the raw data buffer ZIN. The location i~ calculated a~ a funct~on of a term indicating the start of the raw data buf$er PZIN, a term taking into account the peak period (TIME-LTIME-QTRGGR)/4, a term taking into account the fiducial mark in the average data (PBAR-ZBAR)/4 and the adjustment factor ADJ which was calculated previously in the ~ynchronization routine.
Next in the blocks A656 and A658 the program ensures that the pointer Pc i8 not less than t~e start of the raw data buffer ZIN. If it is, then Pc is incremented by a factor (NRAW ~ NLD) in block A658.
Thereafter the value of the pointer Pc is assigned to the variable PCYCLE in block A660. Next the pointer Pb iB as~igned to the QRS buffer pointer PQRSB in block A662. Having completed all of its functional tasks the RYTHM program then returns to the location from which it was called.
The 6ubroutine AVERG will now be more fully e~plained with reference to the detailed flow chart illustrated in Figure 17. The routine initializes two pointers Pb, Pc upon entry in block A670. The pointer Pb point~ to the average daea buffer PZBAR and the pointer Pc points to a buffer PQRSB containing inforDation on the last si~teen QRS waveforms which were averaged.
In block A672 a test is performed to determine if thi~ is the first element of the ZBAR array. If it is, as indicated by Pb ~ 0, then no averaging has taken place yet, and a preliminary path must be completed before the actual averaging routine can be accomplished. The program therefore continues to block A476 where the variable AYTYP i6 tested to determine whether it i~ not zero. If it i8 nonzero then the waveform ~amples are not of an average type and can not be averaged. Thus, the variable AVTYP is set equal to -1 in block A678 to prevent the routine from averaging any waveforms until the other routines detect a waveform ~27624~

o$ the ~pecified average type. The program then return~
from this path without doing any further calculation.
However, if the variable Avm i8 zero then an the preliminary averaging path formed of blw ks A6B0-A688 is esecuted. Along this path in block A680 three ~tarting values for each waveform are stored.
These values are used as values to subtract from the rest of the data samples to remove any offset value in the amplitudes. Next the sums of the first 100 elements for each lead is formed in block A682. The first 100 6amples is averaged because the averaging routine is catching up with the other parts of the program which may be already 20 millisecs beyond the peak of the present waveform. However, for time management purposes the averaging routine is not allowed to accomplish all the averaging the fir~t time through the loop.
Next in blocks A684, A686 the pointer to the raw data being averaged PZ and the pointer to the location where the average data is being stored Pb are remembered by the variables PZRAW, and PZBAR, respectively. Thereafter in block A688 the noise for the average data samples i8 calculated by taking the second difference of each point and incrementing a variable if it iB greater than the last noise value calculated. The program has now finalized the preliminary path for averaging and returns.
The next time the averaging routine is called Pb will not be equal to zero and the program will taXe the path to block A674. A test in block A674 is performed to determine if Pb is less than the end of the buffer ZBAR. If the program has not completed the averaqing, the answer to the test will be affirmative and transfer control to block A694.
In that block, the next four samples of the X, Y, and Z leads are added to the composites being formed. The program then continues by remembering the pointer values for Pz, Pb in blocks A696, and A698. For ~) ~;~76Z41 each time the routine ~s called thereafter until the end of the d~ta, four ~mples of the buffer are added to the values of the co~posite~. Thi~ operation maintains the a~er~ging of the samples subst~ntially ~ynchronous with obtaining of the samples by the GETSMPLE routine.
When the limit of the data buffer is e~ceeded in A674, the program will advance to block A690 where the variable AVTYP is set equal to -1. As was the case with block A678 thi~ action causes the AVERG to stop averaging data until the other routines find and detect more good data. Before exiting back to the calling routine the variable PZBAR is 6et equal to zero for a resetting of the program.
With respect now to Figure 18 there is shown the detailed flow chart of the FIR filter routine termed FIRFLT. The FIR filter routine takes the sampled data from the buffer where it was placed after averaging and produces a finite response filtering of the high pass type. The result of the digital filtering is stored in an output vector which is used by the subroutine PLOT to display the data. Initially the subroutine starts at block A500 where a pointer Pc is ~et equivalent to the address of the beginning of an output vector Vecb and the pointer Pd is set equivalent to the original pointer Pc ~7~. This e~tabli6hes two pointers, one to the start of the output vector and another to the eighth position of that vector.
The program continues with a test block A502 in which it is determined whether Pc is less than Pd. If the answer is affirmative, then the contents of the addresæ Pc is set equal to zero in block A504 and the pointer incremented in block A506 where control is returned to the test in block ~502. Thi~ incrementation and looping continues until the test in blw k A502 i8 failed. Thi- portion of the routine fills the first eigbe lw ations of the vector Vecb with zeroes.
Th reafter a pointer Pb is set equivalent to the 1;27624 starting addre~ of an input vector voca ~n block A508.
In addition, the pointer Pd iB given a new value (Pc~NAVG-8). ~hi~ sets the pointer Pd equivalent to the length of the input buffer which i~ NAVG. The program then transfers control to block A510 where the pointer Pc i- tested to determine whether it i8 less than the pointer Pd. If the teBt iB affirmative, then a test in block A512 e~amines the contents of the location in the input vector pointed to by Pb to determine whether it is ~ero. If the test is affirmative indicating that the value of data in the input buffer is zero then the corresponding element in the output buffer is set equal to zero in block A518. In succession the pointer Pc is incremented by one in block A516 and the pointer Pb is incremented by 4 prior before returning to the decision block A510. The program continues this loop until either all of the elements in the input array have been tested a6 indicated by a negative path from block A510 or a nonzero element in the input array i8 found as indicated by a negative path from the block A512.
~ At this point the test in block A520 is executed to determine whether the pointer Pc is less than Pd. If the te~t is negative then the computation in block A522 i~ executed. In this computation the location in the output vector pointed to by Pc is filled by the difference of two terms. The first term the ~ummation of the seventh and eighth terms of the input array following the location pointed by Pb and divided by eight whereas the second term in the computation is the summation of the next sixteen elements in the array after Pb divided by 16. This computation therefore calculates ~ value for the output array Vecb which is the one half the average of the æeventh and eighth elements minus the average of the next sixteen element6 of the input array. It is seen that if the elements Pb (7) and Pb (8) are the center elements of the sixteen used for filtering purposes. Subsequently, in blocks -- . . . .. ... . . .. . ..

1Z7624~

A524 and A526 the pointor Pc iB incromented by one ~nd the pointer Pb increnented by 4 to fetch the next ample which will be f~ltered. The loop filters each ~ample in this ~anner uccessively until ~11 the average data for the X, Y, and Z terminals have been filtered.
It is evident in thi- type of filtering that the re~ponse to the filter is not contaminated with aDples wbich are ~ore than 16 locations ahead of the location being filtered. Thus, the filter has a response that iB finite, does not cause a phase shift change and does not cause a change of polarity in the ignal or ringing on account of the filter. Therefore it can be assumed that the high frequency rever6als in a plot of the filtered data are caused by features of the wavefor~ and not by the filter.
With respect to Figure 19, a more detailed flow chart of the four pole Butterworth filter will now be ~ore fully esplained. The Butterworth filter illustrated in the figure i6 a digital synthesis of a four pole analog Butterworth filter having the transfer function T(s) where:
Y T(8) - Z
Y i8 the input, 2 is the output, S is the ~aplace v~riable, and T(8) ' _ 1 (1 - 2 8 ~ 8 ~2 Note thats T(s) - Tl(s) T2(s) where, Tl(s) - ~ Cl _z~

S2( ~t C21 1*76241 Where the two denom~nator terms each fcrm two poles of the filter and coefficients Cl and C2 are ~rbitrary filter constant~ to prov~de correct frequency re8ponse .
Each term can be repr-sented in the digital domain by rearranging the equations for the transfer functions Tl(s), T2(6) and twice integrating both sides of the resulting equations. Digitally the integration is performed by successive summations.
Zl e Y Tl( S) Zl ~ Y - Cl J Zl - S~ Zl (1) Z ~ Zl T2( 8) Z e Zl - C2 ~ Z - JJ Z (2) The integration for forming the two terms of the transfer function is done digitally by a successive summation first for the equation (2) and then for the equation (2) above as will be more fully explained hereinafter. Initially, the program starts at block A528 where pointers Pb and Pc are set equivalent to the starting locations of a pair of vectors Veca and Vecb, respectively. These vector~ represent an input buffer which has the unfiltered data in it and an output vector where the filtered data will be placed. Ne~t, a variable INC4 i~ et equal to four times the counting increment INC. Further in that functional block the variable C~T is set equal to zero.
Ne~t in block A532 a test is performed to determine whether the variable CNT is less than one half the variable constant NAVRG. NAVRG is a constant indicating the length of the input buffer data and CNT
iB a counter variable for determining where in the input data the pointers are referencing. The division of NAVRG by one half iB to provide a filter which will filter in a forward or rever~e direction from substantially the peak of the QRS waveform. It is noted that the increment INC can be either positive or ~Z7624i negative and thereforo when the subroutine is called ehe input data can be filterod in a forward manner up to the half way point of the waveform and thon reverse averagea from the end of the waveform by calling the subroutine again and simply negating the increment variable.
If the variable CNT i8 less than the final address, then the affirmative branch of block A532 transfers control to block A534 where the contents of the location pointed to by Pb i8 tested to determine whether it i6 zero. If it is, then CN~ is incremented by one, Pb is incremented by INC4, and Pc is incremented by INC in block A530 before returning to the test in block A532. This part of the program steps through the data in the input vector until it finds a nonzero element or the range of the data i6 e~ceeded. If the range is e~ceeded, the negative branch for block A532 transfers control to block A538, otherwise the negative branch of block A534 transfers control to block A536.
As ~oon a8 a nonzero element is located, the variables for the filter Sl, S2, S3, S4, Tl and T2 are initialized. The variables Sl, S3, S4, Tl and T2 are initialized at zero while the variable S2 is initialized to 16 times the value of the first nonzero element of the input array. After the initialization step in block A538, a test to determine whether the variable C~T is less than the constant NAVRG/2 is accomplished. If the result is negative then the program has filtered all the elements of the input data vector and has stored all the newly filtered values in the output data vector. If the result is affirmative the program branches from block A538 to begin the filter routine. In block A540 the variable Sl is replaced by Sl I Tl. Additionally, S2 is ~et equal to the old value of S2 plus the new value of Sl.
With these new values the calculation in block A542 is acco pli~hed where the variable Tl is set equal to the value of the location of the pointer Pb minus two lZ76Zql '` ~

~aditional ter~s. The first additional term is a constant times S2 ~na the ~econa term is a con~tant times Sl. Comparing the blocks A540 and A542 it is seen that the calculation accomplished in A542 is identical with a digital implementation of equation (1) where the input term has subtracted from it a first summation (Sl) and a second double summation (S2). This calculation therefore provides the fir~t two poles for the transfer function indicated above. Ne~t, in block A544 a gain equalization factor i6 applied to Tl because of the digital format of the filter.
Thereafter, in block A546 the variable S3 is initialized to the old value of S3 + T2 and the variable S4 is initialized as the old value of the variable S4 +
S3. In block A54B the variable T2 is set equal to Tl minus two terms. The first term is a constant times S4 and the ~econd is a constant times S3 + 1. As was noted for the fir6t two poles of the filter, blocks A546 and A548 i~plement equation (2) where a single summation (S3) i6 performed and a double summation (S4) i6 performed to i~plement the e~uation. In block A550 a gain correction factor for the output of the filter T2 is applied in much the ~ame manner as was the gain correction factor for the firgt equation in block A544.
The ~quare root of the output is taken in block A552 and the re~ult 6tored at the address pointed to by the pointer Pc. The program continues in this loop by incrementing the variable CNT by one, the pointer Pb by INC4, and the pointer Pc by INC before returning to the decision block A538. Thereafter, the loop continues until the first half or the last half of the input vector is filtered by the routine. At the end of the test when the ne~ative branch is taken from block A538 the output vector Vecb contains the results of the filtered data.
Figure 22 is the detailed flow chart for the routine LATEP which calculates the root mean square (~S) 1:~7624~ ~!

level of the ~late potentials" during the last 40 milli~ecs of the QRS-segment ana further calculates the the time in ~illisecs. that the "late potentials" exceed 40 aicrovolts. These two calculated values can then be u~ed to inform a doctor of the relative ~plitude of the ~late potentials" and their duration. ~o predict ventricular tachycardia or other functions, these number6 can be compared with empirical reference levels developed through studies as described in the reference to Simpson. The two calculations are performed by the routine LATEP and are output to the plotter by the routine PLO~ which calls the Hlate potentials" algorithm as a subroutine. Additionally, a noise level calculation for the "late potentials" duration is 15 performea.
The routine initiates at block A556 where the variable NSUM is set equal to O. Thereafter, the next forty samples after the peak ("IN I N~VRG) of the compo6ite waveform are summed in blocks A558-A564 to obtain a noi~e estimate. Thereafter, this forty sample length interval i~ translated to the end of the QRS-segment by adding the latest sample amplitude to the ~um and ~ubtracting the earliest in blocks A566-A572.
This translation continue~ until the test in block A568 iB failed where the forty sample interval has been translated to a final point of 250 6amples after the peak of the composite waveform.
During the translation, blocks A574-A578 constantly te~t the sum to determine whether it is less than the previous sum. If it is the address of the last sample of the ~um ~Pointer Pa~ is stored as the pointer Pb in block A578. When the test condition in block A568 ~ failed, the pointer Pb contains the address of the la~t sample of the minimum of the forty sample sums and the variable NMIN contains the value of the minimum sum.
Thereafter, the minimum sum ~IN is averaged and scaled in block A580 and the pointer Pa set equal to 76Z~ ~

a ~ample pos~tlon five sample8 preceding the minimum forty ~ample sum ~n block A582. The av~rage noi8e lovel ln the minimum forty ample interval ig then ~caled by aivi~ion with a constant in block A583 to provide the plotter with a value for the variable LPNOlS. This variable contain~ the average value of the noise level in the sample interval measured in unit~ of tenths of microvolts.
The next part of the routine finds the "late potentials" termination from this information. In block A586 the sum of five samples ~NSUM) is formed starting at Pa and then compared to the average noise level (l~IN) in block A588. If this sum is not gseater than the average noise level then the pointer Pa is decremented in block A590 and the next sum formed. The loop noves the sum NSUM backwards in increments of one sample toward the peak of the composite waveform (ZIN +
NAV~G) until it is greater than the average noise.
At this point the routine has decided that the sum NSUM may no longer be noise and thus may be the ~ termination of the late potentials. To proviae an additional check, the roueine takes the sum of twenty samples in blocks A592-A600 where 6eventeen samples are previous to pointer Pa and three are subsequent. If the termination of the ~late potentials" has been found the ~ummation of the potentials in 6amples previous to the termination should make this sum much greater than the noise level. Therefore, the twenty sample sum (NSUM) is divided by 4 before being teseed against the noise level NMIN in blocX A602.
If llSUM/4 is greater than NMIN then the program asæigns the sample pointed to by Pa as termination of the ~late potential~ locks A606-A610 provide a tran~formation from an address into a sample time for the termination point labeled LPOFF. Nest the square root of the sum of the squares is calculated for forty samples previou6 to the ~late potentials" termination in blocks A612-A624. The ample~ have addresses ranging fro~ Pb-37 to Pb ~ 3 a8 illustrated by the ~tarting condition in block A614 and the ending condition ~n block A616. The value of the variable LPRMS~ i8 output to the plotter after being et equivalent to the RMS
value for the forty samples preceding "late potential"
ter~ination.
In block A626-A634 the calculation for the duration the ~late potentialsH which are less than 40 nicrovolts i8 ~ade. The calculation i6 made by starting at the sample pointed to by Pb in block A630 and testing its value to see whether it is less than 40 microvolts.
If it iB, the loop continue~ by incrementing variable LPD40 in block A632 and decrementing Pb in block A634.
The loop therefore counts the number of samples which have an amplitude of less than 40 ~icrovolts until the test condition in block A630 is failed. At that time the variable LPD40 contains the duration of all those ~amples and can be output to the plotter.
Figure 23 illustrates the output of the routine PLOT for the co~oand~ developed at the CRT terminal.
~aveforms in block~ 700, 702, and 704 represent the wideband ~ignal which is measured from terminal X, Y, and Z. Blocks 706, 708, and 710 illustrated these 25 waveforms on a magnified cale. Blocks 726, 728, and 730 illu6trate the composite X, Y, and Z waveforms after they have been filtered with a finite impulse response (FIR~ filter. The features 726, 728, 730 which stand out are at the locationæ where the ~is bundle potentials are generally found. Block 720 illustrates the result of forming composite X, Y, and Z leads and then reverse and forward filtering each lead with a 4 pole Butterworth f~lter. The resultants were squared, added together and the ~quare root taken of the summation. It i~ ~een that onset 722 and termination 724 of the waveform predominate.

76Z4~ - ~

Whilo the prosent invontion has been illustrated and described in con~unction with various preferred embodiment8 thereof, it is to be understooa that numerou8 changes ~nd modifications may be made thereto without departing from the spirit and scope of the present invention as is recited in the following appended claim~.
There follows a detailed listing for the progra~ which controls the operation of the system with the main processor 206.

hrconl.h -~ con~mon slobal de~l~r~5tions ~or sisrlal averasir,s r~rosran, ~include ChrPer.h:~
~oefir,e size~vec) ~sizeof~vec)~
~defir,e NL~ 3 fdefine N~AW 2500 ~rjefirle NFLT 75 1define N~HY 2500 ~efine N~vRG 800 tuetir-e aTr~GGr~ 100 ir;t jlRVeC[~ interruPt vectors ~J
short rcvirRC8]i J~ interruPt counters ~f st.ruct ~
short 2in~4~NLII]i /~ 4 inr~ut samPle~ for 3 lecs~s eacrh 4n,s ~/
short ~fd~NLI~ detection filter inPut ~i shDrt zfnCNLIIii J~ nlatch filt.er inPut ~i u~lsi~nea short lfaili /~ leaà fail bits ~/
umsigrled ch~r Pflag; J~ Pacenaker f1as ~/
urlsistle~ char clock~ clork failure ~r.o ir,Put) if = 0 ~i - } zi~ufC400]- ~PZi~ll tP-ri~o; /~ inPut ~uffer with ir, g out Poir,ters ~Jirrl 20a~ ~4~NAvRG~ average cYcles for NLII leads ~f short 2in CNLII~Nr~W3; /~ ~ second ir,Put ~uffer for all leaos ~J
shrirt 2rh~CNLLl~Nr;HY]; /~ ~50H-.r samPlins rate rh~thn,i~uffer ~f st l'JLl. {
silol~t ottl ~NLII~NFLT]; /~ detectiorl fllter for 3 learis ~f short mtoh ~NLrl~NFLT~ RrS nlatch filter for 3 learis } ;:rlt.;
SilO~ ~ 2ac[~t8;5~N~ ; J~ ac interference filter outPut ~/
unsisrled thar oslot~250ii /~ outPut to Plotter ~uffer ~f urlii~r,eli char t.rnllcvC~5G]- trnlxn,tC250]; /~ ternir,~l rcv 8 XDIt ~uffers ~f short ~P-rflt; J~5: Puir,ter to 2flt current im~e~
s`rlolt ~r~2il~ Pointer to 2in current in~ex ~/
irlt ~s~2bari /~ Pcsinter to zi~3r currerlt ir,àex ~J
shrJrt ~P~raws /~ r~ointer to rin in uce ùY avrs ~/
sil3rt ~2rhYi, ~P2rhYoi ~ in ~ uut rhYthn, buffer Pointers ~f umsic~ned char ~PoPIoti /~ Plot buffel Pointer ~i ur,si~ned char ~Prcvi~ ~Prcvo; J~ tern,ir,al rcv iuuffer in ~ out PtrS ~/
ur,~i~lled L`har ~PXIilti~ ~XnltL'; J~ treuirlal xnlt ~uffer in ~ out Ptrs int ti,l,e ; J~ tine neasured in 4ns units ~i int nUI`5; i~ num~er of l~rs's oetecteà ~/
int nRtYP ; /~ nun,~er of urs shaPec ooserved ~f int rrl~; J~ sun, of last 16 rr inter~als ~/
unsi~ e~d int rawL-nCNLL~]- av2n[NLI~i J~ noise levels in inPut ~ avera~e ~J
sl-luc~. {
5hOlt tnlPltt2~;NLL~ 115 tenPl~te (~ Points ~ ~ leaàs~
int Qcnti /~ count of occurence~ of this Qrs ~J
rst8~ structure for Rrs tYPe ds~ta ~J
~tl~uct I
illt 5U~ dif~ ratio~ tine. tYP;
int Power- Pk~wr. Pktine- n~n~wr;
int rr~ adJ;
~ ~lrsv; J~ Rrs detectiorl scalar vcaria~les 5t ruct {
int rtine; Jt Rrs triscier tine ~/
~/

;~ s ~. ~; - ` 62~1 int rrint; /~ Preceding rr ir,terval ~/
int Phanlr~ r~eak a~Plitude fron dectectior, ~/
int RtYP; ~ r~rs tYPe ~/
int avtYP; /t Qrs tYPe for averasins PurPoses ~/
short tPc~cle; /t c~cle start Pointer t/
int tP~ari; /~ cYcle ~legir~ ~/
} orslst[16]~ ~ursa~ ~PRrS~ includins inPut (a) ar,d outPut (~) list Point ers ~1 ir,t ~O~ off; /t nrs onset L offset Poir,ters t4n,s) ~/
unsigned int Pltnlag. /~ scalins factor for Plots ~1 char ostrC~0]i /t outrut strins tenPorarY ~/
ch~r na~datC80~; /t na~e,'date/id strins t~
int lPor~ late Potential offset tibe ~/
int lPr~sa; /t late PDtential rns a~Plitude ~40ns int lPd40i /t late Potential duratiw, under 40uv ir,t lPr,oi~ late Poter,tial noise level ~i short ~Paccor~ C filter cor,tant Pointer ~1 int ~ltrhYi /t fla~ for star,dard rhYthb Plot t/
char tdata; /~ last ~ear,insful ter~inal ir,Put ~l : ~ ' ~Z76Z4 ~I; hires.c ~.~
~inrlude ~hrcom.h`
ain( ~
re~ister short tPb~ ~PC~ ll:P5;
int startl). amrJirR()~ pltirR;~ trnlirR();
J#;hC Constant5 sre ~21:~15) ~ cos (delta) ~nd delta is Phase chsrlge in lms ~/
static short acconC14~ ~18409- 23B87~ 13952. -1012~. -20887. -28715. 2058~R
12830. ~6510~ 1~2~1~ 0~ -101~6~ -lq2~1- 101~6~;
ehal ~tn~2~.ssc~ ) i rL'Vil`~ = 01 ~:frr~ (rCVirR~ rCVirR+9~ Ox10000);
Porlot - o~lot~ ~zrhYi = ~rhY-3i if (ir~1vec:C3J != Pltirr?~ irRvec~3~ = Pltira;
rcvir~?t3~ = 0. Pio~csr = 3- Pio.csr = Ox91;
~:~mti = trm~ t~ PX~to = trb~:bt~ Prcvi = trorcv. PrcVo = trnlrcv;
if (ir~?vec[7~ I= trnirR) irRvec[l~ = trmirR;
1.1a.c~r = 3, tia.csr = Oxq5;
tia.data '~005';
f .~ . t~
f ;i~ -- ' ') Paccfill = accon; else Pa.CCon = 8arcon[7~;
~i i z~f . ~ o = zc~f-1;
r~in - 2in- P.f1t - zflt.dtct;
~?r5v . mnP~ l - 2500;
ful ~'`h fl:'515t; Ptl C Rrsl5ttl~; P~ t= size~Rrslstco~)) Pt~ fVtYP = --l;
rs~'- Rrslst~ PRr5tl = flrslst~ Rr515t.avtYP = -1;
i~i' (irRvec~4~ != sn,PirR) irRvec~4] = 8~PirR;
rcvirR~4] = O~ rcvio.cbd.~Yte = Oxlei for (i tine ~ 200i ti~ett) get5ll~Pl()i cirsv.time = 167;
ci;,r, - (RIF:6GF; - lO)~C2. floff = taTRG6R t iO~C2;
Pltnlas 3~0;
= Pl`CVi;
i~Ji~P( ~;
xln~t (~o33[24ilHcopyrisht 1983. ART. All rishts reserved.');
for ~;;) if (rrcvi != Prcvo) r~rcvo = r~rcvi;
if ~tdats == '9') start();
else if ;tdsta == '7') PltrhY = 1~ rhY~lt~Q). resYnch()i ei5e if (tdata == '4') PltrhY = 0~ hissin~)~ resYnch()i else if ~tdat~ == '3') rlot.~). resYr,oh(~i else if ~tdata == 6 ) Pltn,as else if (tdata == 5 ) rlt~as ."~
else if ~tdata == 1 ) er,terid(), resYr,ch~;
else if ltdala == \004 ) duaP 1 ) . resYnoh ( );
fDr ( ;tdat.~
if (Qrsdrtt~ = 0) s~n~h( ) i rh~;tllrs, 1 ) i ~is~
-P~l s; -.i csVt`~P -' 10;
if ~iw~ r~ o) disr~lY();
ti.n,~Tt~ sLlsn,!lli s ' `
si~ ull<~ L~i~,r i.;"~ l)?!~r~?. lHEnter nane/III~date free-for~ or, next line (end with ~ETU~N ). ;
n~ \rNnN033[2K );
~oi ~b ~ nan,d~ti Pt! ~ nallldat~79; r~L+tj for ~ ; Prrvi == r~rcvo; ) ;
Prcvo = Previ;
~Ptl = tdsta;
if (~Sa~ == \r ) brea~;
if (~Pt~ ~- \037~) FL'---;
rontir,ue;
if (~s b -- Ox7f 8~ r~b ~ nandat) Xbtt ( \010 \010 ). ~L -= 2i else tio.~iatFS = ~Pb;
}

~-k Gi Q33~23~\033~2~ );
re tu rn;

rr~ lC~
{

rt--Sistel int r,;

re~ir~4] = 0;
for ~; reVirR~4~ == 0; );
r~bi ~uf~ P2~0 = ;!~uf-l~ r~zirl = 2in, Pzflt = ~flt.dtcti revirQ~4~ = 0;
fur (n = O; n ~ 625; ntt) tir,lett ~ sets~r~l ( ) i Xlbtt ~ ' \007 ' );
returrl i ~ulllP ~ ) re~ister urlsi~r,e~ r har ~r~a;
etlar besss~3];
sr?:l - o;
Y~lllt~; ( ' \033 . Z\001 ' ) i n,d~t ~;
for ~ xn~t~ (^N002'). Pa = ~ar; Pa C 2~art4~N~G; Patt) ~ esss~O~ P~ 4) t ~A'~ nlesss[1~ P~ ~ Oxf) t '~';
XOltP (~esss~;
XllltP ( ' \0;~3 Y ' ~;
returni hra~ct.~ ~
~inolude i`;hrcon,.h`
~define ~MIN 12Q0 ~ detection threshold ~ unit = 2 microvDlt~ ~/
Rrsd~t~) re~i~ter short ~po~ ~pc~ ~Ps;
int akamP~ n~iY- su~ difl~ dif~ QtYPi short ~tmPc2~NL~3;

Rrsv~rr = time - Rrsy~time - 13i Rrsv.~if = 30C00~ Rrsv~ratio = 30000. Rrsv~pkpwr = o~ Rrsv~pktime = o;
Rrsv.tYP = nRty~;
for ~ ; rcvil~t[4] ~ 350; ~
tibett~ Rrsv.rrtt- ~etsnPl (~;
fo~
{

tinet+~ Rrsv~rrtt;
setsm~
if` ~ursv.rr ~ 40) continuei i~ ~ w ata != '2' 88 Rrsv.rr " 250) return l;
if (~Rrsv.rr80;~f) == 0) Rrsv.n,r,Pwr -= (Rrsv.n,nPwr - ~IN/2)~ 4;

P~l = 8P~flt-`r~tCt;
Rrsv~powel = iabs ~p~++) t iabs ~PQ+t) + ia~s ~PQt+)i if ~rsv.PkPwr =- O 88 Rrsv.Power ~= QrSV.mnPwr) RrSv.P~Pwr = Rrsv~powar;
ir ~nr~v.Pk~wr != 0) . . {
~f`lt~t ~P`O-ll~NL~ ~t~P~i /~ for ~tJP = o~ ps = Rrs~t~tplt; RtYP ~ rlRtyp; RtYPt+. Ps+=si~ rsto~)) if ~Rrsv.ratiQ ~ 150 88 RtYP '~ Rrsv~typi ~reaki sum = o~ difl = Oi fol~ tnP~ pc - ps; PQ ~; ~tn~P+~NL~
{

sum t= ia~s(~Pc t tP~)i difl t= iabs~Pc+t - ~PQtt~i }
matoh ~difl~ sum~ Rt.YP~;
}

nl~c;~ (2t~1P)-if (Rrsv~POwer `~ RrsV-PkPwr) Rrsv~pkpwr = Rrsv.Power. Rrsv~pktinle =
else Rr5v.Pktimet+;
if (RrsV.Pkti~ 0) ~re~k;

RrSv.nll:Pur = (Rr5Y.nln~wl~ ~ Rr5v.PkPwr)~
if (l~rC.v.mrlPwr ~ 2~IN) Rrsv.~nPwr = 2~hIN;

~,Z7624~

if (n~tt~:P a_ Q~ ar~v.tine = tine - lOi if ~roYirQ[~] ~ ~00) Rrs~.ratio = 1000;
~5 - 8RI`5~Rr5~!~tY~.tnlFlt;
~l~ = tP~flt-~dtctl~ursv~tir"e - tibe - lO~NL~;
,~ r ~ P~, ~t~P ~;

ir ~ariv.r~tk ~= 150~
i f ~ t.~ 3 ) RrSv.tin~e = ti~e - 10;
1~1`5V . tYP = nGltYPtt;
,tfntPt (gP~flt-:~dtct~-NLI11:2Q]. ~ors~Rrs~.tYP].tn~Plt) }

elSt- C~l-sV-tY~ = 2;
al~v.rr - tine - Rrsv.tine t 10;
ir ~n~1). == o~ orsv.rr = ~00;
, ,t. rs ~ f ~
arsv.li~ne -- R'3;
rttlJIIl Oi ,, ~Z7624~
-7~-t, ~P1~ p,l~
5~ P~);
~ tel sh~rt ~P~ ~PC~ ~Pdi p~ _ p~;
~c ~ P1 - zflt.dtct + zflt.rltch - lOtNL~; if (PC C zflt.n~tch) PC += NFLTtNLII;Pd = PC + 8tNL~; if tPd ~= 8zflt.~tch~NFLT~NL~) Pd -= NFLT~NLIii ~P~tt = tPC+t t tPdttJ tP~tt = ~F~Ct+ t tPdtt~ ~P~tt = ~PCtt t 11~pd+t;
PC t= lltNL~ if tPC ~= 8zflt.~tch~NFLT~NL~ c -= NFLTtNL~;
Pd = PC + 8~NLII; if ~d `z= bzflt~rltch~NFLT~NLn]~ Pd -= NFLT~NLLI;
~Pt~tt - tPCtt t ~Pdtt~ ~Pt'tt = IIlPCtt t ~Pdtt~ ~P~tt -- tPCtt t tPdt+i r3t~lrrl;
}

1Z~'6~4~

hrrhYb . r include ~hrcor~. h:~
rhYthn, ~ ) ,~4ister short ~Ph~ ~PC;
re~ister ir~t ~r~ari F~L~I~ = O;
~e = r~QrS~;
Ph PC t si~(Rrslst[O~); if ~Ph ~= RrSlSttl6~ Pt = Rrslst;
if (Rrsv~t~p!=o 88 Rrsv.rrC=45) if ~ PC-~.RtYP=-O 1I RrSV.Pk~PWr~Pc-.~Pk.a~P~
{

RrSv.tir~e - r~c~ rtine~ rlRrs--;
returl I i if (r~c--~utYp! O gg Qrsv~pkpwl ~ PC-~Pk mP 88 (Rrsv~rrc=45 1l (Rrsv~rrc=75 ~ Rrsv.t~r~==u RrSv.rr t r~c-`rrint- Pc-~rti~e -= rrl6~ nflr r~t, = r~ci il ~n~wi.~ tg nRrs~8 8g Rlsv-t~P!=O 88 Rrsv~rr`~=rrl6i~4) r,~lrs = 2;
~:frn ;gRrslRrsv~typ~tb~lt~ 8Rrs~o]~tnlplt~ 18);
arsv~tYr~ = O;
nRtYP = l;
fDI` (Phar = 2har; Phar ~ ztlart4tNA~RG; ~ ~Ptlar+t = Oi }

ars~arsv .tYP~ . Rcnt+t;
if (nurs <= 16~
rrl6 = Rrsv~rr~c4;
else rrl6 - Rrsv~tibe - ~t-~rtine;
r~h-~rtin,n = ulsv.tinle;
P~-~rrint - ~rsv.rr;
PL~ :~PkanlP - ursv.ril.Pwr;
:~b~RtYp = ~. rsv . tYP i 1` (~<rsv.rr125 ~ rrl6~4) P~ avtyp = Rrsv~typ; else Pt~ avtyp = -1;
P~r - zL~ar t (QTRG6R~4) - ~(rrl6~.~3~2)i if ~P~lar C 2tar) Phar = zt~ar;
~L-'.~P~bari = Phar;
~C`: P*irl - ~((tine - ursv.tin~e + QTRGGR)~C2) - ((Phar - ~ar).~.~?) - Rrsv~adj~NLIl;
if (PC C 2in) Pr t= N~W~NLII;
PcY~le = PC;

1;~6Z4~

P~r5~ = P~;
I e~rll~

~,Z76Zg~

hr~et.c ~incl~de ~hrco~.h~
ex~erl-, int r,ext. lasti ~tg~Pl ~ ) rel~ister short ~P2~ ~P~r tPCi short ~Pd;
char ~nakasc();

for ~ ; rcvir~43 == 0; ) ;
rcvil~Rr4]--;
Pz - PzintNLrl~4; if ~PZ ~= zin+NLIl~NR~W) P2 = zin; Pzin = PZ;
Pb = Pz~otl; if ~Ph ~= zhuf+400~ Pb = 2huf; PZOO = Pb;
PC = PzflttNLII; if (PC ~= 2flt.ntch~ Pr = 2flt.dtct; P7flt = Pe;
if (Pb == Pzbi~ rawzr,C0] = 8000;
evr~
for iPd - Pc+NLII; PC ~ Pd; PCtt) Pc~ ntch[O] = Pb-:'zfm[O];
PC-'~trt[0~ = Pb-~2fd[03;
~P-~+t = ~Phtt;
for ~F(' - P~:t3~lNL~l; PZ; Pl~ PZtt = ~Pbtt;
~c~lt(~;

(r~r~ = 0) P. = Pzrh~i+NLrl; if (PZ ~= zrhYtNL~4NRHY) PZ = 7rhY; PzrhYi = PZ;
for ~P~ = ~zin. PC = PZt3; PZ ~ PC; Pbtt) ~PZt+ - (~P~ t ~(P~+3) + ~P~+6) + ~(P~+q)~2;
else if (I`CVil`11~3] ~ 50) pz - P2l~lYO;
if (P~ =~ Pzrh~
Pz++. rhYh~s (0~- next = 0;
XbtP ('SF`lIW0~4500~10300~6750PUP~1?0~5625PII~
else if ~PZ == PzrhYi) P2+t~ rhYt~as (1~ ncxt = Oi XbtP ('IW0-?250.10300t4500PUP~120.3375 else if (PZ == PzrhYitl) PZtt~ rhYhas (2)~ next = 0;
xmtP ('IW0-0-10300-2250PUP~120-1125P~R');

:

....

: " :

}

elsi if ~P2 == P2rhyi-4 1 I tdat~ 8t) {

P2rhYO = O;
xntP ~'IWPUPA10120-0~IIFN~0-6750--101~0-0-0--6750-101~0-0F'U'~;
xntP ( 'p~o~2~5oF~ ol2o~oF!uo~?25oprllol2o~oNupp~o~osp~
for ~; rovirr.~C3] != Oi ) i return;

~2 t= NLI~i if iP2 ~= 2rhYtNLrll:NF;HY) P2 -= NL~NRH~; P~rhYO = P2;
l~st ~ ni2xi` . ne~it = (t~P2 ~ Pltn~as) r ne~:t /= lq20;
if tnei~t f 11000) next = 11000;
else if tne~:t :: -11000) next = -llOOG;
:;LIt~ 4~ n~tP (bakasc (r,e~it-last~ r~strtl~))i rz P_ili;
ir ~i~b~ P~ ;(P2-l?~C`f.l) t ~iP2-~4)) ~= raw2ntO].i'i5) raw~ nCO:l++i else raw2n[Q~--i P~ l)f~l) t ~P2-?3)) ~= r~w2n[1]..f5) rawzr,~l]++i else raw2nCl]--;
ir ~ bs!~i~p~:~?) ~ lO~ :l) t ~(p2-??)) :;~= raii~2rlt?]f~ 5) r~wzriC`~]tt; else raw2r,[2]--i re ~ur~ ~ i i~ly~* ~ J
.i~ tlt-r~ r i rl~ sun;;

i ~ ir lt i~iN ~ == o) returni P, - zrh~, t l~i îl~`r '~:~unl ~: Oi P2 `~ 2rhYtl~O~lNLIIi P2 t= lOl:NL~ 5WI t= ~P2i ~or (SUnl ~f= 4l ~ = 2rhY t ld; P~ ~ 2rhYtNL~:Ni~HY; P2 t= NLII) ~P2 -= SUhi retul n;

-83- ~Z7624~
Pl~.C ~/
~ir,clude ~hrcorl,.h~
idisP ~ ) xn,tt t ' \033~2J\033C2J\033~2; lH\033~4\03~1\0~3~3' ~;
xrltt (' R~TE COUNT\n\r')i XD~tt ( ' ~TE COUNT\o\r ' );
x~tt ~ '\n\033t~ Noise (ù~\n\r' );
>:btt ~'\033~6 Ir,Put Averase Sca1e\n\r'~;
xntt ( '\033~6 \033[7nl \033C-l\n\r' );
xnlt~ 033~hX \033~7n. \Q33C~ \013C7rl \033C~ \033C7RI ~033[1n x\n \r' .~
for ( i r~xli,ii ! = Pxn,to ;
xn,ti'. ( ~\013~6 \033C7nl \033Cn\n\r' );
xntt ('\033t6Y \033C7b \033C~ \033C7n, \033Cb \033C7m \033[n,~r,~r')i xnitt (~033~6 ~033C7h ~033Cn~n\r');
x~tt ('\033~6~ \033C7n \033~ \033C7rn \033Cn, \033C7rh \033[1nRn~r's~i xrltt ~'~033~6 \033C7m \033Cr"\n\r');
for (; Pxnti != Pxnto; );
YHltt. ~l~nrlePress corresPor,diris nulnerie keY to:\r\n\n'~;
xn,tt ('l. Enter III 4. Plot hish gain 7. Plot rhYthn,\rl\r'~i xn~tt ~'2. Avera~e 5. I~ecrease ~air 8. StoP\rl\r'~i K~lltt ('3. Flot averase 6. Increase sain 9. Reset');
for (; PXllt`i != PYnlto; ~;
x!tt ~ ' \033[20 i 24 r\033C20; lH ' );
return~
}

~: :

: `

~ ~:

: ~ :

::
' ~ ' ~276241 t~i 5P~
re~ ter char JFbi r~ te short ~oi rtYister int count;
rha~ ak~asc~ ascdec(~;

o~tr~B] , ostrC17] =
f k ~lti !- 0~
~t~ - n,a~asc (~40000Xrrl~. ostrtl7~;
xr~tt ~ \03~Cl;~H ~. x~tt ~r~
x~,tt ~ \Q33C~;8H ). xn,tt (Ph~;
~h n,nkasc ~ t,ar[2~NA~G+3], ostr+l7);
~uillt ( \d-3tl;~6H )- x~tt iP~
Xli,tt ( \033~2;2~H ;~ xr,tt ~P~i ~C = P~bo i xl~ltl ~ 033[7;BH );
~ t-aifail~PxcO~ == 0) xnltt (zscdec ~rezwzr,~0~ 3- 1- ostr+l7));
elst! x n,t' ~'FAIL );
xr!n~ t (~Q33~9;8H )i if ~ lfailB3xla) == 0) xbtt (ascdec (raw2r,C~ 3- 1~ ostrtl7~);
el;e x0tt ( FAIL )i X~ltt l \033~11;8H )i if ((Pc-~lfailgOx2~) == 0) xntt (ascdec (raw~n[2]~3, 1. ostrtl7));
el~ae Xbtt ( FAIL )i xn,tt ( \033tl3;1H )i if ~Pr~ fail != 0) .
x~tt ( Misezind leads: );
if ((Pc-~lfailBOx80) != 0) xntt ( Xt );
if ~'~c-~lfailgGx40) != 0) xntt ( X- );
if (~r~-~lfail80~8) != 0) x0tt ( Yt );
if ((Pr-~lfeailgOxlO) != Q) xntt ( Y- );
if ((Pc-~lfail80x20) != 0) x~tt ( Zt );
if ~(~c~~lfetil80x2) != 0) x~tt ( Z- );
xn,tt ~ \033[K ~;
if khal~[2~NA~RGt3~ != 0 {

count = z~arC2~ Gt3~C~2;
x~tt ( \033C7;18H 1. xntt (ascdec ((54av2n[Q~lXcount~ 2~ ostrtl7~
x~tt ( \033~9;1BH 1~ xntt ~ascdec ((S~a~n[l~)/count. 2. ostrtl7));
xntt ( X033~11;1BH )~ xntt (ascdec ((S~av~n[2~Xcour,t. ~. o~trtl7));
X;btt ~ ~\033~9;34H ~;
it~ (rltnas C 320) 1~76;~4`i ~ :n,tt ~ '), xlntt (Il~ak~asc (3~0/Plt2l~d~ ostr+17))i else xmtt (makasc ~Pltn,as/3~0- ostrtl7))i ~n,l.t ( ~\033C20; IH' );
return;

-86- 1~6~ ~
!~ hrtl~t.o ~
~ir,clude ~hrr~on,.h"
Pl t~
{

r~ister int ~rbar~ ld~
r ~n~ asrt~i ~ Rr~ nRrs3~ offsetC3~ 10, dlO;

n~ L~ar[(nT~GGR;~4)+3]i if in-iY~ O) return;
r,lbl7 (~;
Pl~ ar t (RonC`;~2);
offietrO~ ~P~art+~ offset~ P~artt. offset~?] = ~P~artt;
for ~PIar - 2~2r; Pbar C z~art4tNA~RG; ) ~ rtt -- offset[O]. ~P~artt -= offset~l], ~Pbar+t -= offset[~]i if ~tP~rt+ C nRrs~
t(P~2r-4) = O. ~(PLar-3) = O. ~(r~bar-~) = 0l ~P~ar-l) = Oi Pltbr~
xl() = lQ~ltn~- dlO = Pltnas/lOi XbtP ~ ' SFlIWO.4500.7320,6750FUFA120.5625F'~')i Pltlri ~2b3r. 4- Nh~RG~ dlO)~ xn,tP ~'PA~0?5625'~;
Pltld ~2~cr~ 4. NA~RG~ '4'. Plt~as~ XbtP ('P~4120.5625')i firtlt (z~ar~ ~irl)~ Pltld (~in. 1- NA~R6. '4'~ xlO);
:C~tP ~ 0~2250-7320.4500PUPhl20.3375F~')i Piil~J ;~l~al~ti- 4. NA~F:G- '1'. dlO). XbtP ~'PA920-3375'~;
Pltio (2~artl~ 4. NA~RG. '4'~ Pltnas~. X~tP ('PA4120~3375')i firflt (2bsrt~, Zill~ rltld (2in~ 1~ NA~RG~ '4'~ xlO);
Ic~Y ~'IWOØ~320 ! ?250PUFA120-1125P~
Plt:ld ~L~art2~ 4- NA~RG- '1'~ dlO~- xn,tP l'PAq20-1125'~;
Pltld ~2~lart2. 4~ NAVRG. '4'. Pltnlas~. xnltP ~'PA4120.11~5'~i firflt ~hart2- 2in~- Pltld (zit~ 1~ NA~RG. '4'. xlO~;

~irltO~ O. xfrn (2in. 2intl. 4~NA~RG-2~;
~utfi1 k~lar. 2in. 1~ ~utflt (z~art4~NA~RG-4~ 2int2~NA~RG~
~ut~lt (z~ar+l~ zin- l)r ~utflt ~2~art4~NA~RG-3~ 2int2~NA~RG-1~- -l);
~utflt ~ art2~ zin~ utflt ~2bart4~NA~RG-?~ 2int2~NA~RG-l)- -1);
~btr~ ~ ' IWO.100.10300~675QPUP~7320-100PD');
Pltl~ ~zint550~ lr 375- '~'~ xlO);

~ 't ~P ~ ~;

:

~Z76Z41 xmt~ l'IWPUP~732t?~100P~PR~980~0~0~50~-10300,0~0~-~750,7320~0~0.sj750~;
xn~tP ( ~ PU- 3 200-0Fr~0--6750F~U-3200~0Prl0~67SOPU~ );
xntr~ ~ 'F'hl~-4500PIlPR7200tOPUO--2250PII-7200~0PU' ) i xnltP 5 'P~ xmtP 5sl,aki3~r (120 t Ron. ostrtlq) );
xn~t~ 5 ' .4600PIIPRO.-200RUO,-2050P~10.-200PU' );
xls!tr~ A')s x~tP ~kasc (1~0 t aoff~ ostrtlq));
~sn,t~ ~'.?150PIIPRO.200PUO.?050Fl~0.200PU')i XssltP ('F~')s x~tP ~I~k~sc ~920 t ~aon~2)~ ostrtl9));
xr~tP t~s~850PIIFF'O~-200PUO~-2050P~0.-200F'UO--2050PI10.-200PU');
x~t~ ('Ph'?-. xmtF 5~al~50 (920 t ~Qoff~C2). ostrtl9~);
xn,tr~ ( ' ''15QF'r!Pr~0~200~'U0~2050F'110~200F'UO~2050-PIIQ~200PU' ~;
xmtr f';'A')~ xmtP (me~a5c ~4120 t (QonCC2)? ostrtl9)~;
xn,t~ ( ' . 6~5GF~Irs:O~ ~OOPUO.-2050R110.-200PUO.-2050PI10~-200PU' );
xn,te 5'P~')s xn,te ~sb~kasc (4120 t 5Qo~f~2). ostrtl9));
s~ 15QPllrsiO.,?OOpUO~OeOPLO.~Or.?PUO.~050.P~0.200PU')i xn,tP ~'PA'). xnte 5mak2sc ~5120 t ~aon~3)S ostrtl9));
xnlt~ ! ' 6~5Q~;'IIPRQ-- 'OOPll0--6550PIIO--lOOF`U' );
,:n,~,e 5 'PA~3?0.200r-~1PRO.-?OOPUPs~' );
XsltP (sr,aki7s~ 5`jl t`~ t (1~uffC~3). ostrtl9))- XllltP 5'.0FIIFRO.lOOFUPA')i x~t~ ~ssle~kasc 55120 t ~off~3)~ ostrtlq))i ~mt~s~ o~rlF~ J!lOOPUO~65~0~1~0~OOPU')i XU~tP t 'SR~r~A40~6500L~llC-250H~\r\r,25nn,/s\r\n' ) i xn~ts~ 5a,c~ler (x10;~5~ 1- ustrtl9))- x-ts~ ('nm/n~\003');
xrsltP ('P~9~0,6500LPllC-250H2\r\nlOO-m/s~r\n'~;
xrOtP (ilie~iec (riltll,e~ei~5~ 2. ost5~tl9)). XbtP ('oD/u~1\003');
i'htP ( 'PA4160~6500Ls':s50-~50H2\r~nlOOoln/s\r\n' );
Xrs~tF~ (a~r~ser ~x~0~ 5- ,~ ostrtl9))~ xmtP ~'m-/uV\003')i : ~P ~ 'Ph73sSO~I;SOOLr~40-250H~\r\n200b3/s\r\r,' );
x~t~S (asic-iec ~x10`i'i5. ~ ustrtl9))- xntP ~'bn/uV\r\n')i xmtr~ 5'~r~ertor\r~nMasnitude\003');
xllts~ ~'FhqlOQ~SOQLI!QF:SII '). xmtr~ ~bakasr ~ooff-Ror,~ ostrtlq))i xmte 5'~;r\rlHFTrl ~)s X~tP 5bakasr (lr~off-oon- ostrtl9));
xml~ !'ms;r'~rlHF~140 ')- xn~tP (naltasc (lPd40- ostrtl9));
X511~s~ 5'1l~sNr~nHlRMsi~ ')s xmte (asrder (lp M~sa~ l. ostrtl9));
.n~t.~ 5'~ J`~ nH~i~o~ (Bscder ~lr~rlQis~ l~ ostrt x~ p (-lJ~003~

xlltl~ 5 'SJPllPAP.OSP; ' );

lor 5r-~2r = e~ar; r~r ~ ~Qart4tNAvpG; ~
r,t~rs3 = 3 t t;P~art3~;
for (Id = o; Id ~ 3; ldtt) ~ Pb~artt = ~5~tPQar t 0~7f~ t nRrs3~ ~7~ t 5te~ar ~ 7~ t nRrS3;
P5~artt;
}

fol 5 ; rrvirR[3~ != 0; );

6'~4~

returr,;
}

~276Z41 -8~-firflt (l~c~ vecL~
in~ veral~ vecb~;
rt~sist~r int ~r~ Pr~ I:Pd;

f~r ~Pr = vecb. Pd = Pc t 7; PC ~: Pd; ) tPCtt = o;
f;3r ~ = vec~r Pd = PC t N~vRG - 15i PC ~ Pd; P~ t= 4. ~PCt+ = o) if ~Pb != o) break;
frl~ ( ; p~ ~ Pd; P~ += 4~
~PCtt - ~ P~t7~4) + ~(P~t8t4))~C3~ - ~p~ - ~iPbt4) - ~P~t?~4~ -\
~(Pbt3$4) - ~r~bt4~4) - ~(P~t5~4) - ~P~t6~4) - $~P~t7~4) -\
~iP~t8~4) - ~P~t~4) - ~P~tl0~4~ P~tll~4~ - ~(P~tl~$4~ -\
~r~tl3~4~ tl4~4) - ~P~tl5~4))"~4i for ~Pd = r~r + 8i PC ~; Pdi ) ~l;Pct+ =
retu rr,;

butflt` ~vec~ vt~c~ inci int veL~ vecb~;
~e~i5te~ ir~t l~Pb7 IIIPC~ cnti int 51, s2, ~3. s4~ tl. t2- irlr4i int`4 - in~'~2~
P4 vec~, Pc ~ vec~i i'~!r ~rr,l = Oi cr,t C NA~G:~Ii cnttt. p~ t= inc4. pc t= inc) if ~PL != O) ~rea~;
52 = :~PLIC~4 i ~ ~l o~ s~ = o~ s4 = o~ t2 = o;
fci; ~; cnt ~ NA~RG~1; cnt+t, p~ t= inc4. pc t= inc~
sl t- 1,li s2 t= &1;
tl - ~ (52 + ~59~ 3))`,~4);
: tl -- ~tl t ~tl~ 4;
~ t2;
: s4 += S3;
1 - ((54 t 53 t ~s3~ 4);
t~ t2 + ~t2;~ 5;
.PC s~r~P~ t~);
:
~ return.
; ~ :}

; ~ :

~276240 ;Itld ~iveel ir,~ n~ s~ale) ~har ~r,t ivec~
regis~er int ~P~ ~P~ rnti int next~ lasti r~hal :llmal~50t);

~n~ ('FR');
fol 'F~h - ivec~ cr,t = n. ne>:t = 0; cnt `,~ 0; r~ += inc. rnt--~
if (ti~.data == ~8~ ) return;last = next. next = (~P~ ~ scale)~13;
if (ne>:t `; 11000) next = 11000;
else if Irle>:t C -llOOO) next = -11000;
xnltP ('~'). xmtP ~PX~ XbtP ~'.');
xntP Imakasc ~next-last- ostrtl9)~;
}
re~urn;
,~

P ( ~
re~i~t.er ir,t $1ia~ ~P~,. r~s~Jmi short ~Pci int nn~in~ sums. P255;

f~r (nsua, - 0~ Fa = 2in+N~vRG; Pa ~ zintNA~RG+80; ) nsunl += $Pat+;
for ~nmin nsun- P~ = Pa; Pa C ~intN~RGt500; ) ncun~ (Fa-4o)~ nsun t= ~Pat+i if ~nsun ~ nmin) nmir, = r~sua~- P~ = Pa;
n~in - (Stna~in)~4~ Pa = P~ - 45;
lPrlois - n~in~'7;
for ~ i Pa ~ zintN~RG; Pa--) nsum = ~ra t ~IPatl~ t ~(Pat2) t ~(Pat3) t ~(Pat4);
if Ir,sult ~ nmin) for ~nsunr = 0~ P~ = Pa - 17; P~ C Pa t 3; ) nsun~ t= tP~tt;
if (nsum~.~2 ~ nmin) ~reah;
}

} ~ ~
PC = F~a~ lPOff = PC - 2in. lPOff = IlPOff~ t 3;
for Insu = 0. SUmSQ = Q~ P~ = Pa - 37; P~ ~ Pa t 3; ) su~s~ t= ~P~4) ~ ~P~4)i r,sun, t= ~P~tt~4;

1:~76~4~

r,sun~ = nsunl~5 t 1~ sursa ~- 4i for tPass = Oi P~SS ~ 5i Pas5tt~ nsum = tsubsn~nsunl t nsub)~
lPrmsa = nsum; ~ lPrl~sa is ir, tenth6 of eirrovol~s il/
for tlPd40 = Oi P~ ~ 2intN~V~G ~ ~P~ ~ 2000i P~--) lPd40t+i r~turrli -g2- lZ76Zg~

.~i; hrhi~i.c ~:i ~include ~hrcon,~h`
hi~i~irl~ ~
r~!sister shDrt ~Ph~ ~PC~ ~Pdi sh;~rt sumCNL~. dif;

for ~Pb = 2int PC = ~rhY; P~ ~' 2in+NLIltNRAW; ) ~PC`t+ = ~r~++~

P~ = P2im - 2im t 2rhY t NL~; if ~Pk ~= 2rhYtNLll~Nf;~HY-NLII) ~ -= NLII~Nr~HY-NLlli PC Pf~ t L~NLII; if ~r~c .`~= 2rhY+NLlt~N~HY-NLII) PC -= NLIII:NRHY-NLIl;
r~d = PC t 8~NL~i if (Pd ~= 2rhYtNLll~NRHY-NLII) Pd -= NLIItNRHY-NLr!i PzrhYi = P~i for ~sunl~O~ = 0~ swl~l~ = 0~ SU~ = O; P~ != Pdi ) SUbl 0~ += ~Phtt~ su~l[l] t= ~P~tt~ su~,[2] t= ~P~tt;
if ~P~ ~= 2rhYtNL~:lNF;HY-NLII) PLLI -= NL~NRHY-NLrli fur ~Pb~ = PzrhYii Pd != P2rhYii ) {

s~ O~ t I;Pdtt - ~P~ dif = ~(~PC t ~ctNLI!~)CC3) - sum[O];
~P~tt = ~5~dif:~?;
PLrt;
sul~Ll~ t= ~Pdtt - ~Pb- dif = ~tPC t ~tPC`tNLrl))~3) - sum[l];
~Phtt = 25~dif:~2i PC~tt;
sunlr~] t= ~dt+ ~ r dif = ~PC t ~r~c+NLrl))C~3) - sun,~?];
~tP~tt = 25tdif~2r P~tt i if ~P~ ~= zrhYtNLll~NRHY-NL~) P~ -= NLII~NRHY-NLrl;
if ~PC ~= zrhYtNLl~NRHY-NLII) PC -= NL~NRHY-NLII;
if ~Pd `m= ~rhYtNLll~NRHY-NL~) Pd -= NL~tNRHY-NLII;
}
fL" ~; P~ P~; ) utt = O- ~P~tt = 0~ ~P~tt = Q;
if ~P~ ~= zrhYtNLrl~;NRHY-NLII~ P~ -= NL~:INRHY-NL~;
zrllY~NLIIli~NRHY-NL~ = zrhY~NL~l:Nf'iHY~2~NLI!~;
2rhY~NLIIllNRHY-NLrltli = zrhY~NLIl~NRHY-2~NL~tl~;
;.rh~J~ NLIll;llRHY-NLl!t2~ = ~rhY~NLII~NRHY-2~NLIlt2~;
~zrh~i -= NLII;
r~ P~ t. ~
re~urrl;

-93- ~ 2 q 6 2 4 r~y~lt~
cllc~r *~ e~

r~ <~
j.r ~rla.q = o {

Xa~P ('F'~40~6500L~0-25OH~\r\n~5~ZS\r\n'1;
X21tP t aSCder (~1O~P1 ~nlas)~5~ 1~ 05t rtl9~ Y~bt,P ~nl/n~\oo3 }

eI~e {
`:bt.P ~ 'ph4o~6~5ooLp5o-~5oH~Nr\rlloob~/5~r\n~ ~ i X~tP (ascdec ~1O~r~1t~ 5~ 2~ ostr~lq))~ x~tr~ /U~\003SF'1');
P~rnYo = P~rh~
re~IJrrI;

P~

d~ Q~ =~ O~
Ynltt ( ~ \007';- er~te r;d();

~:n~t~ ~'NO33.JINN033lI127;;17:\033.N1;1q:IP0~0~103O0t7~50SI.14~ \033.0'~;
fOr ~ ; rCVirr.1~3] != 0; ) ;
if ; Pio . data j ;
r~io.Csr = Ox11i SO~r81) == ; ) ;
if (~i~-data == '4' 1I Pio~dat~ == '3') X~lt.t ('\OO7\O33~23;1HF'LEASE LOA~ PAPEP IN PLOTTE~ AN~ PRESS ~ETUPN~
fOr ( ; ~I~CVi == Prc~o; );
xa~tt ~ ~ \033~

x~ltr~ ( ' SP~PAO-75~0l.~')- X~tP ( rla~dat ) . x~tr~ ( ' \003 ' );
xa~tr~ ~ 'PUP~40-5700LPX\003PA40.3450LPY\O03P~40-1~00L~Z\003');
r~Jrl~; `

~Z76241 hrllli sc c ~/
~inclu~e ~hrron~h~
rl ~p~ p~ n) chal- ~P~r ~rai resi~jter L`har ~P~ P2;
re~iister int cnti fr~ P1 - pr~ P2 = Pt~ r nt = r,; cnt :i~ O; cnt~-~ ~P2tt = ~Plt+;
r~turl,i 5il~i ~,t ~ L;2~ ) r~ d~a~ ~;
re~istLjll ur,sisr,ed char ~or (Pt' = data~ pc = PXllltii ~pi~ != Oi ~PLtt = ~P~tt;
~ f (Pe ~= tr~x~tt250) pc = trn,x0t;
Pxn, ~ PC;
tio.c ,r - Gs~
returl,;

X~ Pcha 1' ) ~J~lsi~ii,e~ h~ PL~Iar;
re4i~ter u-,sisl,e~ char ~Pt~ ~pc;
re~ister ir,t count;
t ~ us;
it (tio.data == '8') return;
for (p~ - Pchar~ pc = Poplot; ~p~ != 0; ~
for (; rcvir~[3~ ~= 200; ~;
tor (count = o; count ~ 50 gg ~p~ != 0; counttt) ~PCtt = ~P~tt;
if (PC ~= oPlott25o) pc = oPlot;
status = setsr (Ox2300);
PoPlot = pc;
rcvirRc~ t= counti set~r (status);
Pio . CSr Ox~1;

:

_ returr,;
}

:~27624~ -. text .glD~l _ia~s._~ax?~_ha~:3._,1,ir,?-_bir,3~_~,akasc~_as~dec .slo~l _Pltiru~_a~ire~ uf._P~i._rcvirQ~_rcvio~_Pio .slo~l -ai~st~if~-nl~ b2r~-sRrt ~globl -~atrh~-tiRier-nQt~p~-Rrsr-ursv slobl _oPlot~_Po~lot~ _setsr .slo~l _acflt~_zac~_P~in .globl _tr~,ira,_tio._i~xltD._~x~,ti._,~rrvi._tdata .slobl _avrs-_~O,_P~ibar-_PRrs~._rrl6-_av~n-_Pzra~
i a~s l~O~ 4 ( ~ 7 bge . 6 i r,es. 1 d7 ia~sq: rt~
_a.,~2: l,ove. 1 4~sP~d7 aJove. 1 8 (sP) ~d6 ea,~ .1 d6 d7 ~,~e . 5 ibaX21 ~-~r, ~e .1 Ij6 J rj7 lldx?~' rts R-~?. a,~vl~.l 4~5P~ti~7 ~OVrJ . l 8;5i~ ) ~d6 Cioi~ . 1 d6 ~ d7 i~g~ 5 ih~:31 n,t,v~ .1 d6, o7 nn,:31: anjve.l t2~sP)~d6 L lllr~ ~ d~S ~ d7 ,' ge . s n~ax32 n,ove . 1 d6 . d7 3~ rt~i 4 ~ sP ) . ti7 b~Ve 1 8 ( 5P ) ~ rd6 rln~ . I d6- d7 ) le .s nlin21 n,ove ~1 d6~d7 nin"t' rts _.ll;îl3 1~0ve.l 4(sPl~d7 ~ove . 1 8 ~ sP ) ~ d6 cnP .1 d6 ~ d7 ~le.s 1,in31 move. 1 d6~d7 nil,31: lbove~l 12(sP)~d6 t`alP.1 d6~ d7 ~le.s nin32 hove.l d6~d7 a,in32: rts _a ak~sc:
RitVe~l 4(sP)-dO
nove.I dO~d6 5 kal ~97~ ~Z76241 ne~.l dO
n,kal: ~ove.l B~s~)~aO
aoveR.l ~lO.dl nlk~a'~?' divu dl~dO
swaP dO
add.w 4'0-dO
~ove.o dO.-(aO) clr.~ dO
suaP dO
~ne.s ~ka2 tst 1 d6 l-s ~,Dve.~ .-(aOI
~ka3: bOVe.1 aO~d7 rts _ascdec:
n,ove.l 4(sP~dO ~ arsunent to ~e ronverted ~ove.l 8(sP)~d2 ~ disits after decibal Point (count) ~ove.l dO.d6 I~P1~5 ascdl ne~.l dO
ascdl: ~ove.l 12~sP)~aO ~ last address Ptr of strins boveR.l ~IO.dl ascd2: divu dl.dO
swaP dO
add.w ~'O-dO
n,ove.~ dO~-(aO) l.d2 ~ne. 5 ascd3 n,ove.~ -(aO~
ascd3: olr-w dO
swa~ dQ
~ne.s ascd2 t.s1, . w d2 l~l.s ascd2 tst.l d6 L~l.s ascd4 n,w e.L ~ -(aO~
a scd4. ~ ve.1 aO .d7 rts _l~atch ~ ve.l 4(sP)~a2 ~ bandPass filter tenPlate fDr this tine clr.l d2 t atYP
hove.l t_Rrs-al ~ Qrs.tnPlt ntchl: cn~.w _nQtYPt2~d2 ~ for (RtYP=O.Ps=Qrs~tnplt; QtYP~nRtYri Qt~Ptt-~st=) bse nltch6 ceP,w ~150~_QrsvtlO ~ it~rsv.ratio~l50 88 QtY~Rrsv.tY~) ~reak;
~cc.s ~tchO
c~P.w _Qrsv~18~d2 L~gt,s ntch6 -98- ~Z76Z4~
ntchO: cl r.l d6 ~ SUb = O
clr.l d7 ~ dif = O
oveR.l ~6~dl t accu~ulate ~ ite~s ~tch~ ' ~ove . w ~ al)~dO
add.w ~a2)~dO
~Pl.s atch~
neg.w dO
~tch3: ext .1 dO
~dd.l dO~$6 t sun t= iahs ~PC + ~P~)i ~ove.u (al)+-dO
su~.w (d~)t.dO
t~Pl . 5 bt~h4 ne~.w dO
stch4: exl.l dO
~dd.l dO~d7 ~ dir t= ia~s (~PC~t ~ tt);
sub~.w ~l-dl h ne . - ntch2 ~ ~veR . 1 1 00 ~0 cnP.l dO~d6 t if ~sun ~ lQO~ return;
~lt.s ~tch5 0,0ve.1 d7. dO
asl.l ~8-dO
asl.l t2~dO
divu d~dO ~ ratio = (1024~dif)/sun~;
cn,P.w _ursvtlO.dO ~ if (ratio ~= orsv.ratio) return;
~cc.s otch~
nove.l d7-_Rrsvt4 ~ Qrsv.dif = dif;
nLIve.l d6~_Qrsv ~ Qrsv.sun = sun;
~ove.l d2~_~rsvtl6 ~ QrSV.tYP = otYP;
nove.~ dO~dl t exPloits uPPer half dl = O
nLve.l dl._lirsvt8 t Rrs~.ratio = ratio;
nove.l -ti~e~-Qrsvti2 t cr5v-ti~e = ti~e;
cnP.w ~150.dO t if (ratio ~ 150) return;
~lt.s ntcl-k ntL`~a lea -12~a2)~a2 t ~tnP
lca 16(al).~1 ~ PS t=
2d~R . W ~l-d2 t RtYPtt ora btchl ;~tch~: r~s ; _s~lsr; cll.l d7 ,f~l d7 ~t5r 6(5P~
rts _t~ bi l`lA
iltSt ~O?_~iL`
. ~ leQ.S tr~xnt cn~P.Ll tO.Yl~_tiotQ
~ne.s trcvl -99- ~76Zgl nuve.t! ~Oxq5-_tio ~ stoe x~it on 'x-off rte ~I`L`Vl C`h~.~ 40xlll_tiot2 ~ne.s trcv2 nove.b 40xb5._tio ~ re-enat!le xnt irR or, 'x-on' rte trcv~: ove-l aO~-~5P) bOVe. 1 _PrCVi ~ 80 nuve.h _tiot2~_tdata nove.t! _tiot2~(aO)+
cnP.l ~_tr~rcvt250!aO
bne.s trcv3 lea -250~aO).aO
trrv3: ~ove.l ~O-_Prcvi tra.s trirRX
trn:n,t: o~st . ~l~_tio t.eR.S triruz ~ xnt buffer not read~
nove.l aO.-(sP) n~ve.l _PXnto~20 rn~.l _Pxnti-aO
br,e. 5 t l-CV4 nove.L~ tOxq5~_tio ~ disaole irR if nothing to x~it kra.s trirRx trcv4: ~ove.b ~aO)t._tiot2 cmP.l ~_trnxn,tt250~aO
hr,e.s trcv5 lea -250~aO).aO
trcvS: nove.l aO~_PxJto trirRx: nove.l (sP)t-aO
trira~: rte _P11,il Q:
btst 40 . _PiO
te~.s Pit`4 t no inPUt character rnr~.h ~Ox13~_Piot2 hne.s Pi rR3 ~ove.b ~Ox91~_Pio ~ sto~ transnittins on receiPt of x-off rte Pir~3 cn~P~h tOXll._Piot2 bne.s Pi rQ4-n,ove.b ~Oxtl~_Pio ~ reesta~lish transn,it irR ena~le on x-or, PirQ4: t~tst 41-_PiO
he~.s PirRx ~ transnit buffer not readY
tst.u _rcvirQt6 beQ.s PirQ2 ~ nothing to transnit c~P.~ ~OX13~_Piot~
heR~s PirR2 ~ do not xnit if Plotter shows x-off ~ove.l aO~-(sr~) nove.l _PoPlot-aO t current huffer Pointer (inPut to buffer~
suh.u _rcvirQt6,aO ~ su~tract count to get outPut Pointer cnrJ.l ~_or~lot~aO

!

t!CC`.5 PirQl le3 250(aO).aO t allowance for circular buffer PirrJl: oove.~ (aO~._Piot2 ~ transnit a new character su~.w tl~_rcvir~t6 ~ decrener,t count of characters to xmit ~ove.l ~sP~t-a~
Pira~: rte PirR2: ~ove.~ tOx~l~_Pio ~ stoP x~tr interruPts rte _anPiru:
aclot.. w ~l._rovirRt8 t count sa~Ple interruPts bF~1.5 airR
tst.t _rovio rte t isnore interruPts if count ~ O
~irR: noveo,.l sOXal/dO-d3~-(s hove.l _P~i.al ~ove.l t_rcviot256,aO
~ovec~ 64.d2 ~oveR.I t4-d3 airQl: eo w ~.l O~aO~.dO t4 sa~Ples of inPut data love.l dO~(al)t n,ove~.w 8(aOj-dO
n,ove~w dO.(al)t ac;da.w d2-aO
slJhR.w ~ 3 br,e.s airRl nlovei~.w O(aO~dO tdetection filter outrut ~ove~.w 4(aO).dl 5UC,` . ~ dl.dO t X = LA - LL
~ove.w dO.~al)t ooveP-w 16(RO)-dO
noveP.w 12(aO).dl suh.w dl-dO t Y = v3 - v2 nove.w dO.(al)t n,ove~.w 8(aO).dO
~over.u 24(aO).dl ~u~.w dl.dO ~ Z = vl - v5 ~ove-w dO.(al)+
n~oveP~w 32(aO).dO tbatch filter outPut ~oveP.w 36(aO~dl 5UC!.W dl.dO
nove.w dO.(al)+ t X = L~ - LL
noveP.w 48(aO)~dO
~oveP.w 44(aO).dl suh.w dl.dO
c~ve.w dO,~al)+ ~ Y = v3 - v2 sove~.w 40~aO)-dO
~oveP.w 56~aO)-dl ~ 5U~ . U dl~dO
-~ ~ove.w dO.(al)+ ~ 2 = vl - v5 ~; noveP.w 104~aO).dQ tlead fail douole ~Yte ' r ~ ?~

~ove.w dO~ t ~ove.~ lO~O~al)+ ~Pace~aher fla~ ~Yte aove.k lO~(aO).~al)~ tclock error ~if == O) c~P.l ~_z~uft~6000-~1 ~ne. 5 a i ru~
lea -16000~al)~al aira~: nove.l al~_Pz~i ~oven.l ~sr~+-aO-al/dO-d~
rte _~sdif:
.1 4~s~ 0 hove.l 8~sr~j.al ~ aQ S al have ~ddresses of vectors nove.l 12~s~)-d6 ~ the count of vector elements cI).l d7 ~ the su~ of aksolute differer,ces a~sdl. ~ove.u (aO)~dO
sub.w (al)t-dO
kPl.s aksd2 nes.w dO
absd2: ext.l dO
~dd.l dO-d7 suk~.w ~l~d6 kr,e.s aksdl rts _rrbl;:: hove.w ~800~d6 ~ the si2e of zkar vector hove.l ~_~kar.aO ~ the vector address r,nl: ~ove.l (aO)~dO
eove.l 12~aO)-dl ~ the nornali2ing nun~er of Rrs's asl.l ~l~dl add.l 12(aO)~dl ~ actual divisor i5 3tllRrs be~.s nn3 ~ shiP division kY zero divs dl~dO
r~ove.w dO-d2 e~t.l d2 as'.l ~7-d2 s~aP dO
ex~.l dO
a~ 7.dO
divs dl-dO
e~t.l dO
add.l d2~dO
nlove.l d4.(aO)~
n,ave.l (aO)-dO
divs dl~dO `
aove.~ dO~d2 ext.l d2 asl.l ~7~d2 swaP dO
rx~.l dO
a~l.l t7~dO
:

~Z76Z41 divs dl.dO
e~t.l dQ
add.l d2-dO
muve.l dO~(aO?t ~ove.l ~aO)-dO
divs dl.dO
~ove.u dO~d~
ext.l d2 a61.1 ~7.d2 5~1;3F dQ
e~:t.l dQ
a~ 7,dO
divs dl.dO
e:t.l dO
d~.1 d2-dO
ove.i dO.(aO)+
ad~Q.l ~4~aO
r,n2: SIJ~)~.W ~1. d6 ~r.e.s n~l rts ,r"~: ~ea 16~aO)~aO ~ skiP drouP of 3 sa~Ples g rourlt ~ra.s nm2 _avrg:
move.l _P2~ar~al l,ove.l _Pars~.a2 n,ove.l al.dl ~ if (P~ == 0~ .--.
~ne avrs20 tst.l 16~2) ~en.s avrsl ; oven .1 ~-1. dO
olove.l dQ~16(a2) ~ if (Po-~avtYP != O) rts ~ Pc-~avtYP = -1- return;
3vrgl: moveb.l d3-d5--(5 ~ove.l 24(a2).al add.w ~12-al ~ P~ = r~c-~P2~ari t 3 addn.l ~l~(al)t ~ ~P~tt += li ~ve.l 20(a2~.aO t P~ = Pc-~PcYcle move.l (aO~t._20 wve-u (aO)+-_20t4 ~ 20tQ~ = ~r~2tt. 20~ P~++~ ~Ot2] = tP2t+
c~ _2in+15000-30 ~c5 . s avrg2 lea -l OOO(aO).aO ~ if (P2 ~= 2in+NL~N~AW~ P- -= NL~N~W
avrs~: nove.l al-a2 ~ PC =
n,ove.u _zO~d3 oove.u _~Ot~.d4 - ~ove.u _~0+4.d5 a~r~3 ebP.l ~_2~ar+4800-al ~oo.s avrs4 t for (; P~ ~ 2~ar+a~RGG~tl6-400;) nove.u (aO~t-dO
5U~W d3.dO

~ . , -103- 1Z76Zg~
ext .1 dO
add,l dO.(i21)t ~ave.w ~aO)~.dO
sub.~l d4~dO
ext,l dO
add.l dO.~al)t sove.l~ ~aO~t~dO
sub-w d5~dO
ext,l dO
alid.l dQ~al)t addo.l tl~al)~
c~lP.l ~_~intl5000~aO
bes . s avrs3 l~a -15000(aO).aO
L ra.~ avrg3 c~rs1: ~love.l aO-_~zraw ~ove,l al-_Pzt~ar move.l _rrl6~dO
~sl.l ~2.dO
ove.l a, tal al;da~l dO~al e",~ zbartl2800.al t,cs. 5 avrg41 rRuve.l ~_ztartl2800,al avr~41' ~ove.l _avzrl-d3 n~ave 1 _avzrt4-d4 Inove. 1 _avzl-1-8-d5 avl~5' ~ve.l -64(a2~dO
asl,l ~l.dO
sub.l ~a2)~dO
~ju~l~l -128(a2)~dO
bPl . S avrs6 r,es,l dO
avr46' a&l,l ~5~dO
alll~.l d3.dO
bi~.s avrs7 adda.l ~i2~d3 av,~7: subQ.l ~l-d3 ~ve,l -60(a2)-dO
a~ ltdO
sub.l 4(a2)~dO
5ub. 1 -124(a2).dO
b~l.s avrg8 neg.l dO
avrg~: asl,l t5~dO
e~P,l d4~dO
~lt.5 avrgq addQ,l 42~d4 avrs~' subQ,l ~l-d4 nDve .1 -56(a2~dO

' -104- ~Z76Z41 asl~ dO
sut,~l ~(a2)~dO
suc.l -l~O~a2~-dO
~Pi .5 avrgl0 neg.l dO
avrslQ asl.l 45-dO
oeP.l d5.dO
blt.s avrgll addR.l ~2~d5 5ut~a .1 41.d5 .w ~64 anl~.l al.a2 hf`~; . s avrsS
~ove.l d3~_avzrl ~ave.l d4,_av2nt4 rnave.l d5,_av~r,t8 I~OVelh .1 ( SP ~t.d3-d5 rts 3vr'l20 C h~P .1 ~_z~ar+12800,al l~ac avrg30 ave.l _Pzraw-aQ
IbOV~-W _zO-dO
bOV~ .W _zOt2.ol ~uve.w _70t4.d2 ~wve~ 4~d7 avr~21: ~ove.w ~aO~+~d6 ~u~.w dO-d6 e:~t.l d6 a~li.l d6.(al)+
a,ove.w (aQ~t~d6 su~.w dl,d6 ewt.l d6 al5d.1 d6~al~+
~ave.~ ~aO~+~d6 suh.w d2,d6 e;~t.l d6 ~dd.l d6~al~+
adda.l ~ al~+
cn,P.l ~_zin+15000~aO
L~`5.s avrg2:i!
l~a -15000(aO~.aO
a~r~2~: suha.w tl-d7 t~re.s avrs21 ;~vr~24: ~ove.l aO-_Pzraw ~ P2raw = PZ
r,ove.l al._Pzhar t Pzhar = Ph rts t return . ~
avrg30: eoven.l ~-l-dO
n~ve.l dO~16(a2~ t Pc-~avtYP = -1 , -105- ~.Z76 ~lr.l _PZ~ar ~ Pzbar = 0 rts t return

Claims (20)

1. An apparatus for averaging a plurality of electrocardiographic waveforms having P,Q,R,S, and T-segments to form a representative heartbeat signal, comprising:
means for sampling said plurality of electro-cardiographic waveforms periodically and for generating a sequence of input data samples indicating the amplitude of the electrocardiographic waveforms at each sampled time;
means for selectively filtering a first frequency spectrum from said input data samples to produce first filtered data samples, said first frequency spectrum corresponding to the major signal frequency components of the QRS-segments of the waveforms;
means for detecting heartbeat waveforms from said input data samples corresponding to said first filtered data samples;
means for selectively filtering a second frequency spectrum from said input data samples to produce second filtered data samples, said second frequency spectrum having a greater bandwidth than said first frequency spectrum to include major signal frequencies of the P, Q, R, S, and T-segments of the waveforms;
means for classifying heartbeat waveforms from said input data samples into different heartbeat types corresponding to said second filtered data samples and said detected heartbeat waveforms;
means for identifying representative heartbeat waveforms from said input data samples corresponding to at least one type of said classified heartbeat waveforms; and means for averaging said representative heartbeat waveforms into the composite heartbeat waveform.
2. An apparatus as defined in claim 1 which further includes:
means for marking an equivalent time reference in each representative heartbeat waveform by marking each representative heartbeat waveform at a reference sample, and means for aligning each of the representative heartbeat waveforms based on said reference sample marking prior to averaging.
3. An apparatus as defined in claim 1 wherein the electrocardiographic waveforms exhibit a dominant rhythm pattern and which further includes:
means for determining whether each detected heartbeat waveform belongs to the dominant rhythm pattern of the waveforms; and means for discarding those detected heartbeat waveforms not classified as belonging to the dominant rhythm prior to averaging.
4. An apparatus as defined in claim 1 which further includes:
means for high pass filtering said composite heartbeat waveform.
5. An apparatus as defined in claim 1 which further includes:
means for detecting high frequency, low amplitude features of said composite heartbeat waveform.
6. An apparatus as defined in claim 5, wherein said detecting means comprises:
a high pass filter which provides an output in the frequency spectrum over 40 Hz.
7. An apparatus as defined in claim 6 wherein said high pass filter comprises:
a finite impulse filter having a sampling equation defining samples of a waveform as a function of the other samples of the waveform which obtains a finite number of samples of said composite heartbeat and filters the obtained samples according to the sampling equation to generate a filtered sample for each sample of the composite heartbeat.
8. An apparatus as defined in claim 7 wherein said sampling equation comprises:

where i = 15 is average of the next sixteen data .SIGMA. Si /16 i = 0 samples subsequent to the sample S0, S(7), S(8) are the seventh and eighth data samples subsequent to the sample S0, and Si is the filtered data sample corresponding to the actual data Sample S0.
9. An apparatus as defined in claim 6 wherein said high pass filter comprises:
a four pole Butterworth filter which obtains the samples of said average beat waveform and filters the samples according to a sampling equation to generate a filtered sample for each sample of the average beat data.
10. An apparatus as defined in claim 9 wherein said sampling equation is a digital synthesis of the analog transfer function:

where T(s) = a transfer function in the Laplace or frequency domain, and C1, C2 = are constants setting the frequency response of the filter.
11. An apparatus for sampling a plurality of electro-cardiographic waveforms indicative of corresponding potentials from surface electrodes placed on a living body comprising:
means for sampling the plurality of waveforms periodically and for generating data samples indicating the amplitude of the waveforms at each sampled time;
said data samples containing parallel sample values for each electrode for each cycle of the sampling period:
means for filtering high frequency noise from said data samples such that high frequency signals in excess of one half the sampling rate are attenuated;
means for averaging the parallel sample values of each electrode to generate electrode sample values corresponding to a waveform from a single electrode: and means for differencing corresponding electrode sample values to generate a heartbeat waveform representative of an electrocardiographic potential through one axis of the body.
12. An apparatus for sampling as defined in claim 11 wherein the surface electrodes are disposed on the body such that three waveforms are generated from three axes passing through the heart which are mutually perpendicular to one another.
13. An apparatus for sampling as defined in claim 11 which further includes:
means for averaging a plurality of electrode sample values such that the average forms one sample whereby aliasing components of the sampling frequency are attenuated.
14. An apparatus as defined in claim 11 wherein said means for sampling comprises:
means for digitizing said samples into difference samples as the difference between the present analog value of one of the potentials from said electrodes and the last previous value of that one potential; and means for transmitting said difference samples to a storage means.
15. An apparatus as defined in claim 14 which further includes:
means for integrating said stored difference samples back into data samples representative of the potential values of the waveforms at each sampled position.
16. An apparatus as defined in claim 15 which further includes:
means for determining the maximum amplitude difference between input samples of a heartbeat waveform; and means for comparing said maximum difference to a reference value indicative of the maximum difference for living body and for generating a pacer signal indicating the detection of an artificial pacing pulse if the determined difference is greater than the reference value.
17. A method for averaging a plurality of electrocardio-graphic heartbeat waveforms, having a QRS-segment and formatted as successive digital samples is a data stream, into an average heartbeat representation, said method comprising the steps of:
filtering said samples with a first band pass filter having a frequency pass band related to the major signal frequency components of the QRS-segment of an electrocardio-graphic heartbeat waveform, said first bandpass filter forming a set of detection samples corresponding to each of said digital samples;
filtering each of said samples with a second bandpass filter having a frequency pass band related to the major signal frequency components of the QRS complex of an electrocardio-graphic beat waveform but wider than the pass band of the first bandpass filter, said second bandpass filter forming a set of classification samples corresponding to each of said digital samples;
forming a template of template sample values corresponding to said sample values from said detection samples and said classification samples;
calculating a ratio for each sample value as the absolute value of the difference between a sample value and the corresponding template sample value divided by the absolute value of the sum of the sample value and the corresponding template sample value;
comparing said calculated ratios to determine the minimum ratio; and identifying the digital sample value at which the minimum ratio for a heartbeat waveform occurs.
18. A method for analyzing electrocardiographic signals to determine the level of high frequency energy in the late QRS-segment, comprising the steps of:
sampling a plurality of heartbeat waveforms periodically;
generating data samples indicating the amplitude of the waveforms at each sample time;
selectively filtering a first frequency spectrum from said data samples to produce first filtered data samples, said first frequency spectrum corresponding to the major signal frequency components of the QRS-segments of the waveforms;
selectively filtering a second frequency spectrum from said data samples to produce second filtered data samples, wherein said second frequency spectrum has a greater bandwidth than said first frequency spectrum;
detecting heartbeat waveforms as a sequence of said data samples with said first filtered data from said generated data samples;
classifying said detected heartbeat waveforms as to type with said second filtered data samples;
averaging at least one type of said classified heartbeat waveforms into a sequence of data samples forming a composite heartbeat waveform;
applying at least a portion of the late QRS-segments of said composite heartbeat sequence in reverse time order to high pass filter means; and determining the level of high frequency energy output from said high pass filter means.
19. The method as set forth in claim 18 wherein the step of applying includes:
applying the last 40 milliseconds of the QRS-segment of the composite waveform to said high pass filter means.
20. The method as set forth in claim 19 wherein the step of determining includes:
calculating the high frequency energy level as the root mean square of the output of said filter means.
CA000474673A 1984-02-21 1985-02-19 High resolution waveform processor Expired - Lifetime CA1276241C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US06/582,225 US4630204A (en) 1984-02-21 1984-02-21 High resolution ECG waveform processor
US582,225 1984-02-21

Publications (1)

Publication Number Publication Date
CA1276241C true CA1276241C (en) 1990-11-13

Family

ID=24328306

Family Applications (1)

Application Number Title Priority Date Filing Date
CA000474673A Expired - Lifetime CA1276241C (en) 1984-02-21 1985-02-19 High resolution waveform processor

Country Status (7)

Country Link
US (1) US4630204A (en)
EP (1) EP0195007B1 (en)
JP (1) JPS62500284A (en)
CA (1) CA1276241C (en)
DE (1) DE3580476D1 (en)
IL (1) IL74245A (en)
WO (1) WO1985003788A1 (en)

Families Citing this family (96)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA1233891A (en) * 1985-05-27 1988-03-08 Peter Gillingham Switched capacitor finite impulse response filter
US4769760A (en) * 1987-03-13 1988-09-06 Cherne Medical, Inc. Terrain biased dynamic multiple threshold synchronization method and apparatus
US4803996A (en) * 1987-09-28 1989-02-14 Nippon Colin Co., Ltd. Cardiovascular monitor
US4893632A (en) * 1988-04-13 1990-01-16 Siemens Aktiengesellschaft Method and apparatus for comparing waveform shapes of time-varying signals
US4961428A (en) * 1988-05-02 1990-10-09 Northeastern University Non-invasive method and apparatus for describing the electrical activity of the surface of an interior organ
US4993423A (en) * 1988-07-13 1991-02-19 Physio-Control Corporation Method and apparatus for differential lead impedance comparison
US4919145A (en) * 1988-07-13 1990-04-24 Physio-Control Corporation Method and apparatus for sensing lead and transthoracic impedances
US5020541A (en) * 1988-07-13 1991-06-04 Physio-Control Corporation Apparatus for sensing lead and transthoracic impedances
US4917099A (en) * 1988-07-13 1990-04-17 Physio-Control Corporation Method and apparatus for differential lead impedance comparison
US5025794A (en) * 1988-08-30 1991-06-25 Corazonix Corporation Method for analysis of electrocardiographic signal QRS complex
US4974601A (en) * 1988-09-05 1990-12-04 University Of North Carolina At Charlotte Portable heart monitor performing multiple functions
US4964410A (en) * 1988-11-15 1990-10-23 Coherent Systems, Inc. Time period and heart rate measurement system
US4890630A (en) * 1989-01-23 1990-01-02 Cherne Medical, Inc. Bio-electric noise cancellation system
US4947857A (en) * 1989-02-01 1990-08-14 Corazonix Corporation Method and apparatus for analyzing and interpreting electrocardiograms using spectro-temporal mapping
US5109862A (en) * 1990-03-19 1992-05-05 Del Mar Avionics Method and apparatus for spectral analysis of electrocardiographic signals
US5092341A (en) * 1990-06-18 1992-03-03 Del Mar Avionics Surface ecg frequency analysis system and method based upon spectral turbulence estimation
AU632932B2 (en) * 1990-06-26 1993-01-14 Compumedics Limited Analysis system for physiological variables
US5052398A (en) * 1990-06-29 1991-10-01 North American Philips Corporation QRS filter for real time heart imaging with ECG monitoring in the magnetic field of an NMR imaging system and NMR imaging apparatus employing such filter
US5490516A (en) * 1990-12-14 1996-02-13 Hutson; William H. Method and system to enhance medical signals for real-time analysis and high-resolution display
US5348020A (en) * 1990-12-14 1994-09-20 Hutson William H Method and system for near real-time analysis and display of electrocardiographic signals
AU645848B2 (en) * 1991-01-15 1994-01-27 Pacesetter Ab A system and method for post-processing intracardiac signals
US5341811A (en) * 1991-03-26 1994-08-30 Allegheny-Singer Research Institute Method and apparatus for observation of ventricular late potentials
US5382956A (en) * 1992-04-30 1995-01-17 Hewlett Packard Co Integrated circuit for physiological signal measurement
US5337230A (en) * 1992-04-30 1994-08-09 Hewlett-Packard Company Signal processing circuits with digital programmability
US5966692A (en) * 1992-05-12 1999-10-12 Telemed Technologies International Corporation Method and system for monitoring the heart of a patient
US5406955A (en) * 1993-03-12 1995-04-18 Hewlett-Packard Corporation ECG recorder and playback unit
US5435316A (en) * 1993-10-07 1995-07-25 Medtronic, Inc. Low amplitude pacing artifact detection amplifier circuit with driven right leg for filtering high frequency noise caused by multiple noise sources
US5713367A (en) * 1994-01-26 1998-02-03 Cambridge Heart, Inc. Measuring and assessing cardiac electrical stability
US5724984A (en) * 1995-01-26 1998-03-10 Cambridge Heart, Inc. Multi-segment ECG electrode and system
US5935082A (en) * 1995-01-26 1999-08-10 Cambridge Heart, Inc. Assessing cardiac electrical stability
WO1996025095A1 (en) * 1995-02-17 1996-08-22 Ep Technologies, Inc. Systems and methods for making time-sequential measurements of biological events
US5711305A (en) * 1995-02-17 1998-01-27 Ep Technologies, Inc. Systems and methods for acquiring endocardially or epicardially paced electrocardiograms
US5609158A (en) * 1995-05-01 1997-03-11 Arrhythmia Research Technology, Inc. Apparatus and method for predicting cardiac arrhythmia by detection of micropotentials and analysis of all ECG segments and intervals
US5628326A (en) * 1995-11-29 1997-05-13 Hewlett-Packard Company Calculating a heart rate from an ECG waveform by discarding a percentage of R-R intervals prior to averaging
JPH09173310A (en) * 1995-11-29 1997-07-08 Hewlett Packard Co <Hp> Method and device for classifying heartbeats from ecg waveform
US5682900A (en) * 1995-11-29 1997-11-04 Hewlett-Packard Company Method and apparatus for obtaining heartbeat measurements from a ECG waveform
US5613496A (en) * 1995-11-29 1997-03-25 Hewlett-Packard Company Method and apparatus for creating a representative heartbeat from an ECG waveform
US5715829A (en) * 1995-11-29 1998-02-10 Hewlett-Packard Company Method and apparatus for detecting heartbeats in an ECG waveform using an activity function and on-time search
US5623936A (en) * 1995-12-05 1997-04-29 Pacesetter, Inc. Implantable medical device having means for discriminating between true R-waves and ventricular fibrillation
EP0912137A4 (en) * 1996-07-17 2001-04-11 Cambridge Heart Inc Generation of localized cardiac measures
US5891047A (en) * 1997-03-14 1999-04-06 Cambridge Heart, Inc. Detecting abnormal activation of heart
US5827195A (en) * 1997-05-09 1998-10-27 Cambridge Heart, Inc. Electrocardiogram noise reduction using multi-dimensional filtering
US6070097A (en) * 1998-12-30 2000-05-30 General Electric Company Method for generating a gating signal for cardiac MRI
US6393091B1 (en) * 1999-12-13 2002-05-21 General Electric Company Methods and apparatus for non-uniform temporal cardiac imaging
US6512944B1 (en) * 2000-07-20 2003-01-28 Cardiac Pacemakers, Inc. Low distortion ECG filter
US6643539B2 (en) * 2000-08-03 2003-11-04 Siemens Medical Solutions Usa, Inc. Electrocardiogram system for synthesizing leads and providing an accuracy measure
CN1447668A (en) 2000-08-03 2003-10-08 美国西门子医疗解决公司 Electrocardiogram system for synthesizing leads and providing accuracy measure
DE10214459A1 (en) * 2001-04-05 2003-04-30 Univ Ilmenau Tech Arrangement and method for the detection of signals of biological origin
US6665385B2 (en) 2001-04-23 2003-12-16 Cardionet, Inc. Medical monitoring system having multipath communications capability
US20050119580A1 (en) 2001-04-23 2005-06-02 Eveland Doug C. Controlling access to a medical monitoring system
US6694177B2 (en) 2001-04-23 2004-02-17 Cardionet, Inc. Control of data transmission between a remote monitoring unit and a central unit
US6768923B2 (en) * 2001-12-05 2004-07-27 Cardiac Pacemakers, Inc. Apparatus and method for ventricular pacing triggered by detection of early ventricular excitation
US6931271B2 (en) * 2002-08-12 2005-08-16 Draeger Medical Systems, Inc System for adaptively deriving ECG chest lead signal data
EP1691683B1 (en) * 2003-11-26 2014-12-31 CardioNet, Inc. System and method for processing and presenting arrhythmia information to facilitate heart arrhythmia identification and treatment
US7194300B2 (en) * 2004-01-21 2007-03-20 Cardionet, Inc. Cardiac monitoring
US7587237B2 (en) 2004-02-02 2009-09-08 Cardionet, Inc. Biological signal management
US8010192B2 (en) * 2004-12-20 2011-08-30 Cardiac Pacemakers, Inc. Endocardial pacing relating to conduction abnormalities
US8290586B2 (en) 2004-12-20 2012-10-16 Cardiac Pacemakers, Inc. Methods, devices and systems for single-chamber pacing using a dual-chamber pacing device
US8010191B2 (en) 2004-12-20 2011-08-30 Cardiac Pacemakers, Inc. Systems, devices and methods for monitoring efficiency of pacing
US8050756B2 (en) 2004-12-20 2011-11-01 Cardiac Pacemakers, Inc. Circuit-based devices and methods for pulse control of endocardial pacing in cardiac rhythm management
US8014861B2 (en) 2004-12-20 2011-09-06 Cardiac Pacemakers, Inc. Systems, devices and methods relating to endocardial pacing for resynchronization
US8005544B2 (en) 2004-12-20 2011-08-23 Cardiac Pacemakers, Inc. Endocardial pacing devices and methods useful for resynchronization and defibrillation
US8423139B2 (en) 2004-12-20 2013-04-16 Cardiac Pacemakers, Inc. Methods, devices and systems for cardiac rhythm management using an electrode arrangement
US8326423B2 (en) 2004-12-20 2012-12-04 Cardiac Pacemakers, Inc. Devices and methods for steering electrical stimulation in cardiac rhythm management
AR047851A1 (en) 2004-12-20 2006-03-01 Giniger Alberto German A NEW MARCAPASOS THAT RESTORES OR PRESERVES THE PHYSIOLOGICAL ELECTRIC DRIVING OF THE HEART AND A METHOD OF APPLICATION
US20070078353A1 (en) * 2005-10-04 2007-04-05 Welch Allyn, Inc. Method and apparatus for removing baseline wander from an ECG signal
US8676303B2 (en) 2008-05-13 2014-03-18 The Regents Of The University Of California Methods and systems for treating heart instability
JP5991706B2 (en) 2008-10-09 2016-09-14 ザ リージェンツ オブ ザ ユニバーシティ オブ カリフォルニア Method, system, and apparatus for detection, diagnosis, and treatment of biorhythm disorders
WO2010071849A2 (en) 2008-12-19 2010-06-24 Action Medical, Inc. Devices, methods, and systems including cardiac pacing
US8200319B2 (en) 2009-02-10 2012-06-12 Cardionet, Inc. Locating fiducial points in a physiological signal
US9655518B2 (en) 2009-03-27 2017-05-23 Braemar Manufacturing, Llc Ambulatory and centralized processing of a physiological signal
US10588527B2 (en) * 2009-04-16 2020-03-17 Braemar Manufacturing, Llc Cardiac arrhythmia report
WO2010151181A1 (en) * 2009-06-26 2010-12-29 St. Jude Medical Ab Late potential detection
US10398326B2 (en) 2013-03-15 2019-09-03 The Regents Of The University Of California System and method of identifying sources associated with biological rhythm disorders
US10434319B2 (en) 2009-10-09 2019-10-08 The Regents Of The University Of California System and method of identifying sources associated with biological rhythm disorders
US9332915B2 (en) 2013-03-15 2016-05-10 The Regents Of The University Of California System and method to identify sources associated with biological rhythm disorders
US9392948B2 (en) 2011-12-09 2016-07-19 The Regents Of The University Of California System and method of identifying sources for biological rhythms
RU2559639C2 (en) 2010-04-08 2015-08-10 Де Реджентс Оф Де Юниверсити Оф Калифорния Methods, system and device for detecting, diagnosing and treating biological rhythm disturbance
US8565880B2 (en) 2010-04-27 2013-10-22 Cardiac Pacemakers, Inc. His-bundle capture verification and monitoring
WO2012125273A2 (en) 2011-03-14 2012-09-20 Cardiac Pacemakers, Inc. His capture verification using electro-mechanical delay
US9050006B2 (en) 2011-05-02 2015-06-09 The Regents Of The University Of California System and method for reconstructing cardiac activation information
US8165666B1 (en) 2011-05-02 2012-04-24 Topera, Inc. System and method for reconstructing cardiac activation information
EP2705464B1 (en) 2011-05-02 2018-04-18 Topera, Inc. System and method for targeting heart rhythm disorders using shaped ablation
US9107600B2 (en) 2011-05-02 2015-08-18 The Regents Of The University Of California System and method for reconstructing cardiac activation information
JP6072005B2 (en) 2011-05-04 2017-02-01 カーディオインサイト テクノロジーズ インコーポレイテッド Signal averaging
US9254095B2 (en) * 2012-11-08 2016-02-09 Alivecor Electrocardiogram signal detection
US9254092B2 (en) 2013-03-15 2016-02-09 Alivecor, Inc. Systems and methods for processing and analyzing medical data
US9247911B2 (en) 2013-07-10 2016-02-02 Alivecor, Inc. Devices and methods for real-time denoising of electrocardiograms
US9681816B2 (en) * 2014-02-13 2017-06-20 Biotronik Se & Co. Kg Device and method for lead failure detection
US11272864B2 (en) * 2015-09-14 2022-03-15 Health Care Originals, Inc. Respiratory disease monitoring wearable apparatus
WO2017059569A1 (en) * 2015-10-08 2017-04-13 深圳迈瑞生物医疗电子股份有限公司 Pacing signal processing method, system and electrocardiogram monitor
US10567041B2 (en) * 2017-08-18 2020-02-18 Apple Inc. High dynamic range NFC reader mode receiver
JP7164375B2 (en) * 2018-09-25 2022-11-01 日本光電工業株式会社 Pulse discriminator and electrocardiogram analyzer
US20210361219A1 (en) * 2020-05-21 2021-11-25 Medtronic, Inc. Qrs detection and bracketing
US11813464B2 (en) 2020-07-31 2023-11-14 Medtronic, Inc. Cardiac conduction system evaluation
CN112244865B (en) * 2020-09-24 2022-04-26 武汉联影智融医疗科技有限公司 Dynamic electrocardiogram analysis method, device, computer equipment and storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS526039B2 (en) * 1971-12-17 1977-02-18
US4000461A (en) * 1973-10-04 1976-12-28 Textronix, Inc. R-wave detector
US3939824A (en) * 1973-10-09 1976-02-24 General Electric Company Physiological waveform detector
US4023564A (en) * 1976-01-26 1977-05-17 Spacelabs, Inc. Arrhythmia detector
US4181135A (en) * 1978-03-03 1980-01-01 American Optical Corporation Method and apparatus for monitoring electrocardiographic waveforms
US4263919A (en) * 1979-10-12 1981-04-28 Levin Kenneth M Heartbeat detection and artifact discrimination method and apparatus
US4416288A (en) * 1980-08-14 1983-11-22 The Regents Of The University Of California Apparatus and method for reconstructing subsurface electrophysiological patterns
IL61465A (en) * 1980-11-12 1984-09-30 Univ Ramot Method and apparatus for monitoring electrocardiogram(ecg)signals
US4422459A (en) * 1980-11-18 1983-12-27 University Patents, Inc. Electrocardiographic means and method for detecting potential ventricular tachycardia
US4458691A (en) * 1982-02-11 1984-07-10 Arrhythmia Research Technology, Inc. System and method for predicting ventricular tachycardia by adaptive high pass filter
US4492235A (en) * 1982-02-11 1985-01-08 Arrhythmia Research Technology, Inc. System and method for predicting ventricular tachycardia by derivative analysis
US4458692A (en) * 1982-02-11 1984-07-10 Arrhythmia Research Technology, Inc. System and method for predicting ventricular tachycardia with a gain controlled high pass filter
US4478224A (en) * 1982-11-26 1984-10-23 Camino Laboratories, Inc. Artifact detector for heartbeat rate measuring system

Also Published As

Publication number Publication date
US4630204A (en) 1986-12-16
IL74245A0 (en) 1985-05-31
IL74245A (en) 1990-06-10
EP0195007A1 (en) 1986-09-24
JPS62500284A (en) 1987-02-05
JPH0560380B2 (en) 1993-09-02
EP0195007A4 (en) 1987-01-22
EP0195007B1 (en) 1990-11-07
WO1985003788A1 (en) 1985-08-29
DE3580476D1 (en) 1990-12-13

Similar Documents

Publication Publication Date Title
CA1276241C (en) High resolution waveform processor
Duskalov et al. Developments in ECG acquisition, preprocessing, parameter measurement, and recording
Fraden et al. QRS wave detection
US4136690A (en) Method and apparatus for vector analysis of ECG arrhythmias
US4721114A (en) Method of detecting P-waves in ECG recordings
US4802491A (en) Method and apparatus for assessing myocardial electrical stability
US20070129639A1 (en) Methods and analysis for cardiac ischemia detection
Vincent et al. Noninvasive recording of electrical activity in the PR segment in man.
Abboud Subtle alterations in the high-frequency QRS potentials during myocardial ischemia in dogs
US4720674A (en) Doppler signal analyzing apparatus
Abboud et al. High frequency electrocardiography of three orthogonal leads in dogs during a coronary artery occlusion
CN103110415A (en) Detection device and method for pace-making signal
EP0217953A1 (en) Doppler signal analyzer
Barbaro et al. New algorithm for the detection of the ECG fiducial point in the averaging technique
Farrell et al. Non-invasive information on the PR segment of the cardiac cycle: an assessment of the clinical potential of the electric and magnetic methods
CN109009071A (en) A kind of method and apparatus identifying electrocardio wave image characteristic point
Jemilehin et al. Design and Simulation of Electrocardiogram Circuit with Automatic Analysis of ECG Signal.
Starmer et al. Processing of arterial pressure waves with a digital computer
Watanabe Automated diagnosis of arrhythmias by small scale digital computer
Abboud et al. An advanced non-invasive technique for the recording of his bundle potential in man
Schreiner et al. A beat-by-beat analysis of electrocardiograms from cardiac transplant recipients
Malik et al. Identification of electrocardiographic patterns
KĘPSKI et al. Noninvasive recording of His‐Purkinje system (HPS) activity in man on beat‐to‐beat basis
Mori et al. Spatial magnitude electrocardiogram in normal men
Ainger Spatial QRS curves of the newborn infant: Spatial magnitude, velocity, and orientation (Frank system)

Legal Events

Date Code Title Description
MKLA Lapsed