Heart Rate Variability
The program processHRV was written to read in either Biopac AcqKnowledge (.acq) or text files containing EKG or pressure pulse heart data, pick/edit peaks, and save interbeat intervals (ibi) to text files. It also gives an estimate of the respiratory sinus arrythmia (RSA: natural log power in the 0.15-0.40 Hz HF band) and also the ratio of the LF(0.04-0.15Hz)/HF(0.15-0.40Hz) log powers.
processHRV is started for Biopac data by typing 'processHRV('acq',4)' at the Matlab prompt where the second argument 4 is the channel containing the EKG data. For text files containing heart pulse data from the MRI use 'processHRV('text',1000)' where the second argument is the sampling rate. If for some reason Matlab can't find processHRV then type 'addpath /d1/local/matlab/HRV/processHRV' for Linux or 'addpath W:\d1\local\matlab\HRV\processHRV' for PC at Brogden; or at Keck 'addpath /apps/brogden/matlab/HRV/processHRV' for Linux or 'addpath W:\brogden\matlab\HRV\processHRV' for PC. After entering this command an Open File dialog will appear allowing the user to choose an input file. The figure above shows processHRV after reading in a text heart pulse file recorded in the MRI. The control window in the upper right contains buttons for manipulating the EKG graph (upper left), the plotted peaks (yellow circles), and the peak threshold (cyan line). Directly below this EKG window is a plot of the interbeat intervals (IBIs) with IBI times in milliseconds on the vertical axis and recording time in seconds on the horizontal axis. Note the skipped beat at approximately 260 seconds - we'll fix this now.
Expand the EKG time scale by clicking on <--> in the EKG plot frame and scroll to 260 seconds by clicking the right arrow (>). The EKG plot should appear as shown below with the missed beat clearly visible: Click on the 'o' peak marker to the left or right of the missed beat to select it (turning it red). Next in the 'Peaks' frame click on the appropriate button 'Add Left' or 'Add Right' to approximately place a new 'o' peak marker over the missed peak (actually, it is placed half way between the selected peak and previous/next peak). Select the new peak and use the Up/Down/Left/Right buttons in the Move Peak frame to move it onto the missed peak. Increasing (-><-) and zeroing (<) the time scale reveals (below) in the IBI window that all missed beats have been found and corrected. Interbeat interval data can be saved to a text file by clicking the IBIs button in the Save frame. Ten hertz spline interpolated IBI data can be saved by clicking the IBIspline button. It is probably best to save both output files. The HRV frame in the EkgControl window displays several important parameters: natural log power LF(0.04-0.15Hz); HF(0.15-0.40 Hz RSA); LF/HF ratio and heart rate.
Some EKG data files may not be so easy to clean. It may be necessary to raise or lower the threshold (cyan line) and click on the Find Peaks button in order to improve on the initial peak picks. For good estimates of respiratory sinus arrythmia (RSA), it's best to have several minutes of good data. UPDATE (July 2008): Added ability to read in text respiration files, select epoch of good data and get an estimate of the power spectrum of the respiration allowing for a more accurate estimate of respiratory sinus arrythmia (RSA). Also added the ability to select a peak marker and move it by clicking on a new location. Currently this update is a separate version of processHRV. In order to run it you need to remove the Matlab path to the old version and add the path to the update At Brodgen: rmpath /d1/local/matlab/HRV/processHRV addpath /d1/local/matlab/HRV/processHrvResp At Keck: rmpath /apps/brogden/matlab/HRV/processHRV addpath /apps/brogden/matlab/HRV/processHrvResp After starting processHRV the updated interface will look like: Notice that the EkgControl window now has additional buttons in the second column. These allow the user to move the lower and upper bounds of the high frequency (HF/RSA) range in order to get a better estimate of RSA if respiration data are available. Click the Plot button in the respiratory frame to open the respiration data file recorded at the same time as the EKG data. Choose the correct file from the file open dialog. The respiration data are then plotted in red above the EKG data in the top plot window. Two vertical white lines in the respiration plot can be used to select a continuous section of good data for estimating the power spectrum of the respiration data. These lines can be moved by clicking on one or the other to select it then moving the cursor to a new location and clicking the left mouse button. The respiratory power spectrum is plotted in the PSD window in red. As described above the low and high HF boundaries can be moved to match the respiratory range and thus show a better estimate of RSA in the HF window.
Click here for a detailed description of heart rate variability data processing.