AMSRES user manual; Scoring the Respiration Signal
AMSRES is part of the software package that comes with the VU University Ambulatory Monitoring System (VU-AMS) for the continuous measurement of ECG R-wave to R-wave intervals and thoracic impedance (serial numbers 44 or 46). The AMSRES program can be used to view and interactively correct the respiration signal as obtained from filtered (0.1 – 0.4 Hz) thoracic impedance signal. The program contains an automatic scoring algorithm for detecting the begin and end of inspiration and expiration, and computes from these values the respiration rate (RR). Heart period variability that is associated with respiration is often referred to as Respiratory Sinus Arrhythmia (RSA). Within each breath cycle, RSA can be derived according to the peak-through method (Grossman, van Beek, & Wientjes, 1990): Using the R-wave to R-wave intervals time series of the ECG, two inter beat intervals (IBIs) are extracted. The shortest IBI during a prolonged inspiration interval, starting at the begin of inspiration and ending 1000 msec after the end of inspiration and the longest IBI during a prolonged expiration interval, starting at the begin of expiration and ending 1000 msec delay after the end of expiration. The RSA is calculated by the subtraction of the shortest from longest IBI, provided that the shortest IBI (highest HR) is part of an accelerating series and the longest IBI (lowest HR) of a decelerating series. If either the longest or shortest IBI is missing for a breath cycle, or a negative value is obtained on subtraction, the RSA is set to zero for that breath cycle.
A study on the validation of the use of the VU-AMS to obtain respiration rate and RSA is reported in De Geus, Willemsen, Klaver, & Van Doornen (1995). Comparison of VU-AMS derived RSA to spectral power and time domain measures of heart rate variability is reported in Vrijkotte, Riese, & De Geus (2001).
The AMSRES program automatically scores the respiration signal, using both amplitude and frequency criteria to reduce error. The user can tailor a number of parameters in this automatic scoring. In addition, interactive scoring of the respiration signal and the IBI series is allowed within the program. Parts of the signals can be rejected manually, or where appropriate, markers for the begin and end of respiration can be repositioned.
This manual first summarizes the main functions of the program (loading, viewing, and scoring data as well as program output) followed by a detailed overview of the options in the main menu and the various submenus. Finally, an algorithm is presented to standardise interactive scoring.
Data can be loaded in two ways, depending on whether you want to score an AMS data file (.ams) for the first time or load a previously scored AMS data file. In the latter case, the corresponding AMSRES file (.rsp) can be opened in which your previous corrections have been saved.
Loading a raw, unscored file
For the first respiration scoring on a new subject, use the 'Import AMS File...' command from the 'File' menu to import the raw .AMS data file. The program will first filter the thorax impedance signal and then detect the begin and end of all breath cycles in the entire registration. The automatic scoring algorithm also computes inspiration time, expiration time, respiratory sinus arrhythmia, and shortest and longest IBI’s for each breath cycle.
As soon as you save data in the AMSRES program, a binary AMSRES file (with extension .rsp) is created with all automatic and manual scoring thus far.
Loading previously scored file
Use the ‘Open RSP File..’ command from the ‘File’ menu to load previously scored AMSRES files. If you have scored a file before but accidentally load this file in AMSRES using the 'Import AMS File...' command, the program will automatically detect and load the accessory .rsp file.
Viewing the respiration signal and IBI time series
After loading your respiration signal the following window is displayed:
This window displays the following information:
In the main panel 3 physiological signals are shown for the time period indicated at the X-axis of the graph.
- The raw impedance signal (dZ in Ohm, gray).
- Continuous heart rate (in beats/min, gray with red and blue marks). On this graph the highest heart rate (shortest IBI) during inspiration, provided that it is part of an accelerating IBI series, is indicated by a fat red mark. The lowest heart rate (longest IBI) during expiration, provided it was part of a decelerating IBI series, is indicated by a fat blue mark. The currently selected breath is indicated by the black vertical line.
- Respiration as filtered from the impedance signal (black). On this graph the beginning of the inspiration is indicated by a red triangle (D ), and the beginning of the expiration by a blue triangle (Ñ ).
The upper right panel shows the Fourier transformed respiration signal. The spectrum belongs to the breath cycle currently selected. Spectra are calculated over 30 sec. windows; using data 15 sec before and 15 sec after the currently selected breath cycle.
In the upper left corner text box the following information is given:
Insp : inspiration duration in msec
Exp : expiration duration in msec
RR : respiration rate in breath cycles per minute (cpm)
RSA : respiratory sinus arrhythmia in msec
Short : shortest IBI (highest heart rate) during inspiration
Long : longest IBI (lowest heart rate) during expiration
Label : label information from AMSGRA. If no label information is available this is indicated by N/A. (To make this information available for the loaded file you have to make sure that the adequate label file (*.lbl) is present in the same directory as the *.ams file.)
Sometimes AMSRES can’t detect a respiratory phase-related acceleration or deceleration (a longest or a shortest IBI) within one breath cycle. An error code –1 and/or –2 is given for ‘Short’ and/or ‘Long’, and the breath is assigned a RSA error code. This error code indicates the reason why RSA couldn’t be calculated:
RSA : -1 undetectable ‘shortest IBI’
RSA : -2 undetectable ‘longest IBI’
RSA : -3 both ‘longest IBI’ and ‘shortest IBI’ were undetectable
RSA : -4 ‘longest IBI’ is shorter than the ‘shortest IBI’
The space taken up by each of the windows may be changed in the standard MS-Windows way by dragging the borders of each window. The X- and Y-axes can be rescaled by placing the mouse cursor on the axis at the very end or beginning of each of the axes. Push the left mouse button and expand or shrink the axis to a desired scale. The offset of the axis can be changed in a similar way by placing the mouse cursor.
Navigation can be performed by using the menu icons or obvious keyboard keys, e.g.
Ctrl End for “Goto end” (of the AMSRES file)
End for “Goto end of Block”
Page Up for fast scrolling forward
Page Down for fast scrolling backward
As soon as you have saved data in the AMSRES a text output file (.rsr) is created. These files contain the information on each breath cycle on a single line. Note that if you exit the program without saving no .rsr file will be saved.
Example of a RSR report file (.rsr):
Description of the different columns (note that AMSRES can optionally write a descriptive header at the beginning of the file) :
column 1 : Subject ID
column 2 : Breath cycle number
column 3 : Beat-to-beat sequence number (starting at 0)
column 4 : date (dd-mm-yy)
column 5 : time (hh:mm:ss)
column 6 : Inspiration time [ms]
column 7 : Expiration time [ms]
column 8 : Shortest accelerating inspiration
column 9 : Longest decelerating expiration
column 10: RR
column 11: RSA
column 12: Mean IBI (per breath cycle)
column 13: Correlation between mean IBI and RSA
column 14: Rejected (R) or accepted (A)
column 15: Label sequence number (starting at 1) (0 if N/A)
column 16+: Labels (N/A = not available)
Import this ASCII text file in e.g. SPSS for outlier detection, aggregation and further statistical analysis testing pertinent your research question. In view of the huge number of breath cycles to be scored in 24-hour ambulatory monitoring, an optimal trade off between scoring time and accuracy can be obtained between superficial checks in AMSRES and more rigorous checks in SPSS (possibly going back to specific parts of the AMSRES file for rescoring). See ‘RSA_oulier_detection.sps’ for an example of how to use SPSS as a tool in the scoring process.
Open RSP file : opening of scored AMSRES file.
Import AMS data : opening of raw unscored AMS data file
Save rsp file : saving AMSRES file after scoring
Import Biopac data : Enables you to import respiration data (excl IBI’s) from a datafile created with AcqKnowledge™ (see www.biopac.com)
Attach to label file : Enables you to explicitly attach to another label file
Import Events : Enables you to import events from an ASCII file (See AMSASC for supported file format.)
Close : standard
Print : standard
Print Preview : standard
Print setup : standard
List of most recently scored files : standard
Exit : standard
Edit - adjusting scoring and deleting unscorable parts of the signal.
Insert cycle : insert a full breath cycle (consisting of a red triangle D , and a blue triangle Ñ . When a red triangle is selected, the new breath (beginning with a blue triangle) will be inserted immediately after the selected red triangle. When a blue triangle is selected, the new breath will be inserted immediately before the selected blue triangle. Move the inserted triangles to the correct position on the respiration signal.
Delete cycle : delete the current selected full breath cycle (both the red and the blue triangle belonging to that particular breath).
Shift left : move the current selected triangle into the left direction.
Shift right : move the current selected triangle into the right direction.
Filter settings : Filter settings for selecting a filter type and the bandpass frequency range for the raw dZ signal. The filtered dZ signal is used as the respiration signal.
Below the ‘filter setting’ window with default settings:
Selection of filter type:
The default filter setting is a FIR filter. Finite Impulse Response (FIR) filter is a time domain filter. Fast Fourier Transformation (FFT) filter is a frequency domain filter. Filter characteristics of both filters are highly comparable, however the FIR-type is preferred since it calculates slightly faster and uses a running window so disturbing edge effects - as occur when using a FFT filter - are absent.
Defining the passband:
Low cut off frequency (Hz) : 0.1 (default)
High cut off frequency (Hz) : 0.4 (default)
Re-score cycles : Below the ‘respiration scoring’ window with default settings:
Relative threshold [0…1] : 0.33 (default)
Purpose: The purpose of this option is to be able to alter the sensitivity for the detection of breaths. AMSRES calculates a running average of dZ signal amplitudes to distinguish between (relative) small and (relative) large dZ-fluctuations. The relative threshold defines the minimum (relative) amplitude difference which must exist between two neighbouring triangles. The running average dZ amplitude is calculated over the 20 seconds preceding the current selected breath cycle.
Adjustment: A higher threshold decreases the sensitivity (less breaths will be detected), and a smaller threshold value increases the sensitivity for amplitude differences.
DZ-HR Phase shift (in ms.) :1000 (default)
Purpose: This defines the time ‘delay’ after the end of inspiration or expiration, in which AMSRES is allowed to search in the IBI series for a shortest or longest IBI, respectively.
Adjustment: Increasing the phase-shift increases the time-delay.
Note: The default phase-shift seems to be adequate for the majority of normal subjects in normal real-life settings. If the automatic scoring program fails to find the longest or shortest ibi for a lot of breath cycles, a visual check on the delay between the respiration signal and the ibi signal is advised to see whether the default settings are appropriate.
Note: For participants with a very high respiration rate, a shorter dZ-HR phase-shift might be more appropriate whereas for participants with a very low respiration rate a shorter dZ-HR pahse-shift might be more appropriate.
Automatic respiration rate artefact detection : is “on” when ticked
Purpose: The purpose of this option is to automatically reject breaths with an unusually small or unusually high respiration rate as compared to the running average of the 20 preceding breaths.
Adjustment: The ‘maximum allowed deviation’ (default 50%) enables the scorer to specify how much the respiration rate of a breath needs to deviate from the running average in order to be excluded by the automatic scoring program. Increasing the percentage means allowing for larger deviations from the running average.
Note: For participants with a truly large breath to breath variability in respiration rate, the maximum allowed deviation might need to be increased in order to prevent false rejects. Conversingly, the maximum allowed deviation might need to be decreased for people with a very low breath to breath variability to prevent false accepts.
Automatic impedance range check : is ‘on’ when ticked.
Purpose: The purpose of this option is to automatically reject clipping (i.e. where the raw respiration signal turns into a flat line at dZ = 1 ohm or dZ = –1 ohm).
Adjustment: Although the default values generally seem to work well, some recordings may require an automatic impedance range check that is a fraction more or a fraction less strict. Some scorers regard it as a waste to reject breaths that are not deviant from the normal respiration rate nor show any other deviant features, just because the signal clips for a short moment. Therefore, the option of ‘minimal duration’ (default 2000ms) is added so clipping is only rejected when it occurs for the time specified by the scorer or longer.
Note: The default of 2000ms is suggested because for this setting, the risk of errors for respiration rate is very low, while most breaths with a bit of clipping that nevertheless seem acceptable are kept.
Automatic variability check : is ‘on’ when ticked.
Purpose: The purpose of this option is to automatically reject spikes in the ibi-signal. Spikes occur when an ECG-top is interpreted as an r-top while it’s not, or when an ECG-top is not interpreted as an r-top while it is. This results in ibi’s that are twice the length they should be, or half the length. The automatic variability check inspects the relative differences between an ibi and its neighboring ibi’s.
Adjustment: The allowed magnitude of these differences can be specified by adjusting the ‘maximum allowed deviation’ (default 50%). The algorithm runs back and forth through signal looking for ibi’s that x% longer then their precursor. Increasing the percentage means allowing for larger deviations as compared to neighboring ibi’s.
Note: Occasionally, participants with a high RSA may show true high RSA’s which are falsely detected as spikes by the automatic variability check. Although checks for these false rejects have been included in the automatic variability check, this remains a point of attention.
Note: When ibi-signal frequently exhibits spikes and there is a low risk for false rejects (i.e. RSA is low) it might be justified to decrease the percentage to about 40%, resulting in a more sensitive variability check.
Reject short artefact free intervals : is ‘on’ when ticked.
Purpose: Applying the above mentioned options of the automatic scoring program often results in small bits of signal here and there in which the majority of breaths is rejected except for a couple. Some scorers do not feel comfortable accepting breaths that are surrounded by unreliable breaths. Using the reject short artefact free intervals- option allows the scorer to reject bits of signal that are surrounded by breaths previously classified as unreliable.
Adjustment: The ‘minimum allowed intervals’ (default 4000ms) enables the scorer to specify the length of signal between unreliable breaths that has to be automatically rejected i.e. when the length of the artefact free interval is 4000 ms or shorter it will be automatically rejected.
Note: The consequences of the default setting would generally be that one breath surrounded by rejected breaths will be rejected, but not two breaths. For participants with a low respiration rate the minimum allowed interval might need to be increased in order to reach the same effect. On the other hand, the minimum allowed interval might need to be decreased for people with a very high respiration rate.
NOTE: Rescoring your respiration signal means that the automatic scoring and error detection (when ticked ‘on’) is renewed. Previous automatic scoring information is lost. Manual rejected breath cycles saved in the binary .rsp file are still saved in the .rsp file. However, manual inserted cycles (red and blue triangles) will be lost!!
NOTE: These options and defaults have been developed for the massive amount of data that is the result of 24hr ambulatory monitoring sessions. In order to reduce data-loss in smaller datasets where time-efficiency is less of an issue, one might want to restrict rejection by the automatic scoring program in favour of a critical manual scoring, since this is still considered superior as compared to automatic scoring.
Options : Options with regard to the Report file.
Below the ‘AMSRES options’ window with default settings:
Create report file when saving data : is “on” when ticked
Extra information in report file: tick the option(s) you want:
Write file header : is “on” when ticked
Long data/time format (dd-mm-yy hh:mm:ss)
Relative time in seconds
Write file identifier on each line : is “on” when ticked
Skip non-labelled breath cycles if a label file is available: is “on” when ticked
Write Respiration rate and RSA : is “on” when ticked
Write RSA-IBI correlation : is “on” when ticked
Tool bar : is “on” when ticked. Tool bar on top is displayed.
Status bar : is “on” when ticked. Status bar on the bottom is displayed.
Split : for changing the ratio between the main lower panel and the stretched upper right and upper left panel.
Show raw Dz : is “on” when ticked. Raw Dz signal (gray) is displayed.
Show filtered Dz : is “on” when ticked. Respiration signal (black) is displayed.
Show tachogram : is “on” when ticked. Continuous heart rate signal (gray line with red and blue vertical bars) is displayed.
Note that clicking the right mouse button in the main panel, were the three physiological signals are displayed, gives these latter three signal display options as well.
Spectrum axis (units) : Hertz (Hz)
Cycles per minute (cpm)
Zoom 1 min.: zoom as indicated.
Zoom 5 min. : zoom as indicated.
Zoom 10 min: zoom as indicated.
Zoom in : zoom as indicated.
Zoom out: zoom as indicated.
Zoom in : zoom as indicated.
Zoom out : zoom as indicated.
Begin of recording
Begin of block
End of recording
End of block
Help topics : AMSRES Application Help.
About AMSRES : Information about this AMSRES application.
Standardised Interactive Scoring
Fortunately, automatic scoring of the respiration signal works quite well in most subjects. Mostly, it will suffice to just load the .AMS data file into AMSRES as described above and briefly browse through the signal having set the time axis at a low temporal resolution. However, a number of points to check are recommended:
Have a swift look at your respiration signal by running very fast from the beginning to the end of the file and check the following:
- Is the peak of the high frequency respiration power (stretched upper right panel) well within 0.1 and 0.4 Hz? If not, change the ‘Filter settings’ (under the main menu item ‘Edit’) to an appropriate value. This option is mainly implemented for rescoring the data of subjects with very long respiration cycles so the frequency range can be extended. Be careful not to restrict the filter frequency range to much and throw away essential respiration information; you would end up with a pure sinus signal which is easy to score but gives you no information at all about a subjects RSA!!
- Are all inspirations and expirations scored on the respiration signal (indicated by blue and red triangles?
(a) Pay special attention to the breath cycles measured during the night!!! Is the scoring of respiratory time intervals correct during the night? Some subjects show strong abdominal breathing which seriously affects detection of the respiration signal by thorax impedance. This can often be repaired by ‘rescoring the cycles’ (under the main menu item ‘Edit’) changing the ‘relative threshold’.
(b) If this doesn’t work try adjusting the ‘Filter settings’ for a better automatic scored respiration signal. For example: if the raw dZ signal is quite noisy / largely occupied by higher frequencies, change the filter settings to get rid of the disturbing high frequencies. Take care that only the unwanted high frequencies are taken off the signal and not the parts of the respiration signal you want to score!!
(c) Note that the AMSRES software is fitted with automatic breath cycle amplitude detection which uses a running average to decide whether a certain amplitude of a breath is valid or not. This means that under normal conditions when the amplitudes of the breaths increase (e.g. with increasing physical activity) or decrease (e.g. characteristically when a subjects starts his/her night-time sleep period), a changed amplitude will still be detected correctly. Under normal conditions also when a subjects starts his/her night-time sleep and the amplitudes substantially decrease!
Then, let the real scoring procedure begin. Use both the tachogram signal and the raw dZ signal, for confirmation of your respiration signal scoring. Start at the beginning of you file and:
- Check whether the program has automatically scored all the breath cycles (red and blue triangles). If the program has omitted a breath cycle and you think it should have scored this breath: insert a breath cycle as described under the Edit menu functions. Move both the inserted red and blue triangle to the correct position on the respiration signal.
- Sometimes a breath cycle cannot be scored because there simply is no respiration signal to score, e.g. due to abdominal breathing. If the program has omitted a breath cycle and you think that this is due to a low amplitude respiration signal due to bad detection of the signal insert a breath cycles by hand or delete the unreliable breath(s). When the respiration signal is too flat to repair you should reject that part of the signal. Rejecting breath cycles by hand can be done in three ways: a) click on the starting point of the period you want to remove and drag the mouse to the end point. You will be queried to reject this fragment of data, b) reject a single breath cycle by pushing ‘R’ (=reject) on your keyboard or c) use the option under the ‘Edit menu’. Grey bars at the bottom of the signal window indicate which breath cycles have been rejected.
- Check whether the program has rejected all deviant IBI’s (spikes). This is indicated by grey bars at the bottom of the signals window. Additionally check for spikes in the heart rate signal (HR [bpm]); this is one beat with a double or half the heart rate frequency of the (average) ongoing heart rate. Spikes indicate that during the registration of the ECG either a R-top was missed or a T-top has been identified as a R-top. If necessary, reject the breath cycle(s) belonging to the spike by hand.
- Sometimes when a subject moves a lot, the registration of the raw dZ signal (light gray line) is disturbed. You can easily detect this because the dZ signal is plotted as a straight horizontal line in the top or bottom of the display (clipping effect). The filtered respiration signal obtained from this part of the raw dZ signal is unreliable: reject all breath cycle(s) for this period.
- What to do when RSA values are zero? Do not reject the breath cycles with RSA = 0 offhand! If it happens often, check some actual breaths with RSA=0. Most of the time you will see that the scoring of the respiration signal is correct and that RSA is truly zero.
- What to do with RSA values below zero? Negative RSA values are used to indicate different events that cause shortest and longest to be unusable for RSA computation (see above). Recode these RSA values into zero (0) before starting your final statistical analysis. Create a separate variable indicating which percentage of the breath cycles was zero due to which type of event.
De Geus EJC, Willemsen G, Klaver CHAM, van Doornen LJP (1995). Ambulatory measurement of repiratory sinus arrhytmia and respiration rate. Biological Psychology 41:205-227.
Grossman P, van Beek J, Wientjes C (1990). Methodology. A comparison of three Quantification methodes for estimation of repiratory sinus arrhytmia. Psychophysiology 6(27):702-714.
Houtveen JH, Rietveld S, de Geus EJC (2002). Differential contribution of cardiac vagal tone, central respiratory drive, and respiratory parameters to RSA during mental stress and physical exercise. Psychophysiology 39: 427–436.
Vrijkotte T, Riese H, de Geus, EJC (2001). Effects of workstress on ambulatory heart rate, heart rate variability, and blood pressure. In: Fahrenberg J, Myrtek M (eds). Hogrefe & Huber Publishers, Seattle, WA, USA. pp345-360.