topics- functions - index - search

Electrocardiography


What Does This Channel Measure?

From the ECG signal, heart rate, interbeat interval, heart rate variability and T-wave amplitude measures are computed.  The main variable extracted from this channel is the interbeat interval (IBI), the length of time between heartbeats.  ANSLAB uses the saved IBIs from this channel to analyze the raw data of several other channels, so it is important to have a clean ECG file.
First, ANSLAB displays a survey of the filtered ECG. The automatic threshold criterion for detecting R-waves that was applied to the differentiated ECG is also depicted in the figure.




This threshold can be changed in the menu to make it more conservative (reducing false positives in noisy files) or more progressive (reducing false negatives in noisy files).    After accepting (or changing) the threshold, ANSLAB calculates the IBI time series for the entire data file. The filtered ECG and R-wave detection accuracy can be inspected by selecting ‘Edit’ in the menu, which opens the editing window (in the modul EXAM), and allows flexible navigation through the raw ECG. In this editing window, ANSLAB identifies the R-wave of each heartbeat with a vertical blue line.  The distance between vertical lines, in milliseconds, is the IBI.  Typical values range from about 500-1300 ms.  Variations of about 200-300 ms as part of normal heart rate variability within a 5-min or so file are almost always normal.  The goal of editing ECG files is to make sure that ANSLAB has correctly identified the timing of all R-waves. For spectral analysis of heart rate variability, single spikes can seriously distort the spectral estimates. Thus, for this also certain subclinical or clinical arrhythmias (e.g., ectopic beats) need to be interpolated in some way. The second type of display, T-wave amplitudes, rarely requires editing since most outliers will be averaged out.  In the following editing instructions, focus primarily on the first window (R-wave) editing.






What Kind of Artifacts are Common in this Channel?

When editing, you are looking for abnormalities in height of the spikes displayed in the IBI window.  Artifacts in this data series, which appear as unusually low or high spikes, are misidentified or unidentified R-waves.  A misidentified R-wave will appear in the first window as either 2 very short IBIs or 1 very short IBI coupled with an unusually long IBI.  
If an R-wave is missing, you will see an unusually high IBI value, i.e. a high spike in the IBI series.  The IBI then typically is twice as long as average for a subject. For example, an IBI that hits a threshold greather than 1400 would suggest a missed R-wave for most subjects. ANSLAB displays an entire file in one window.  Depending on file length, artifacts may be quite obvious or more ambiguous.  The shorter the file, the more subtle artifacts may appear.   Always use the vertical axis (IBI in ms) when considering whether a spike in the graph is unusual. 






How Are Artifacts Removed?

When you spot what appears to be an outlier in the graph, select option ‘2’ in the editing menu. Then mark several suspicious areas by clicking to the left and right of the unusual signal. Blue lines will appear at these points. 





Mark all suspicious spikes this way.  The best length for an interval is about 15-20 seconds (in this example, about 70 seconds were selected, which typically is not recommended).  This will allow you to see both the overall pattern of R-waves and the individual irregularities.
By typing “0”, you will switch displays so that you can see the raw ECG and actual detected R-waves as blue lines.  A new window pops up showing you the first 6 seconds of this file, ...





... and you can go from there directly to the first suspicious area you marked by typing “0” again.  ...




If the interval you marked is not ideal, you can zoom by typing “z” and clicking twice around the desired area.  Unzoom with “u.”
Usually, what you will find is that one of the R-waves has not been detected because of some distortion in the data.  A misidentified R-wave appears as a vertical line that ‘misses’ the nearest R-wave or a vertical line, which has mistaken a movement/technical artifact for an R-wave. It is almost always obvious where an R-wave should be. Remove incorrect identifications by typing “#” and clicking close to the vertical line.  Insert the correct or missing R-wave by typing “!” and then click in the signal where you want to insert the event. A blue line will appear, telling you that the program treats it as an R-wave now.
By hitting “0” again, you can directly go to the next area you previously marked as suspicious (if any). Here you repeat what you’ve done above. Once you have examined all suspicious intervals, click in the right bottom corner to leave this window.  The distance between R-waves does not have to be uniform, as long as the cycle is correct. Usually it is not recommended to remove R-waves that have been correctly identified to make the distance between them even, unless they are due to arrhythmic cardiac activity and you later want to analyze heart rate variability.  
ANSLAB will redisplay the IBI window with the changes you have made.  If you have edited correctly, the unusual spikes and dips should no longer appear.  If there are new abnormal spikes, you can go through the editing process again; sometimes, smaller artifacts that were not as prominent in the first window now show up as unusual. 

A quick kind of outlier editing is option 3, which activates the outlier box function (see respiration pattern editing). Since such manually excluded outliers will be interpolated, this is not as exact as editing based on the raw ECG.  
Another quick kind of display of the raw data that does not allow editing can be activated by selecting “display segment” in the editing menu. Then click twice in the signal to tell the program which segment to display.  You’ll then be given the ECG-signal, and a green line.  The green line indicates the actual time that elapsed between 2 detected R-waves, and gives you additional information as to where the program might have missed an R-wave (then the green line is high, i.e. a lot of time has elapsed).  You can simply leave this window by clicking somewhere in it.
When you are satisfied that you have made all necessary corrections, hit return to select "exit editing".

Next, a window displaying the TWA (T-wave amplitude) will pop up. 






Suspicious areas can be looked at similarly to IBI editing by choosing option 2, then marking a suspicious area with 2 mouse clicks, and then going to EXAM by typing <0>.


   



The T-waves are marked in dark blue, the place where the R-wave was detected (but is now cut out) is marked in light blue. The values of the T-waves are displayed next to the T-waves.  Here, you should focus on misdetected T-waves, mostly due to artifacts. Those will often be manifested by outliers, i.e. spikes.  Go to the suspicious intervals by typing <0>. If in the data you cannot detect the T-wave (zoom in to make sure), but the program has detected T-waves, you should delete those. To do that, type <q> to leave EXAM, and then in the window showing the TWA draw exclusion boxes.  You do not have to be very accurate because typically the averaging over periods will overcome single outliers.  Generally, you don’t have to insert any events. If you are done, select exit editing and select "Save reduced data (existing files will be overwritten)" if you want to save your changes.
     
What Qualities Must Be Preserved In Editing?

The most important element of ECG editing is consistent and accurate identification of R-waves.  Unlike other parameters that are often just used to compute means over minutes or so, any outlier in the IBI affects the quality of the heart rate variability analysis.

Special Cases:
     
What Do I Do When ANSLAB Does Not Identify Any R-waves?    
Sometimes the ECG is unusual so that the standard detection parameters do not work well. In ANSLAB, you will see a window that shows extremely long intervals between R-waves. Or, ANSLAB will display a straight line if no R-waves have been detected. This is a frustrating problem but easy to solve.  
Instead of manually inserting every R-wave, you can choose another threshold for R-spike detection. Or (for more advanced Matlab users), you can select in the header of the the R-spike detection program to use other settings for the detection algorithm.

For example:
High pass filtering on/off
Cutoff frequency in Hz (e.g., 2)
Reversal of signal (e.g., yes, if the R-spike is downward)
Detection window size (e.g., 150 sample points)

If change in these settings do not significantly increase the number of R-waves identified, you can experiment raising or lowering ‘Backward Comparison Point’ and ‘Increase from point in mV’.

Backward comparison point (e.g., 8 sample points)
Increase from point in mV (e.g., 0.005).