g.RTanalyze: Specs & Features
online and real-time biosignal processing library for use with SIMULINK
g.RTanalyze is a biosignal processing blockset for use with Simulink (MathWorks Inc., Natick, USA). The g.RTanalyze blocks can be used for on-line simulations under Simulink and for real-time applications with Highspeed Online Processing for Simulink.
Drag and drop the pre-processing, parameter estimation and classification algorithms into your SIMULINK real-time application to accelerate your research, encourage creativity and reduce project costs. The blockset enables you to quickly compare multiple algorithms. Use the blocks as templates and make your own modifications.
The blockset is divided into general purpose blocks and biosignal processing blocks. General purpose blocks are derivations, filters and different algebraic blocks. Biosignal processing blocks are used for pre-processing, parameter estimation and classification of off-line or real-time EEG, ECG, EMG, respiration or galvanic skin response data.
Included parameter estimation blocks are: Hjorth parameters, Barlow parameters, Bandpower, Variance and Adaptive Autoregressive Models with RLS, Kalman and LMS algorithms, minimum energy, EMG coactivation index and EMG spasticity. All important methods for BCIs based on P300, motor imagery, SSVEP/SSSEP and slow cortical potentials are included. The ECG block allows you to calculate heart-rate and heart-rate variability parameters. Furthermore, respiration rate/deepness and the change rate of galvanic skin response can be calculated. The blockset contains also blocks to control a system with EOG and EMG activity for human computer interaction.
The apply classifier block allows you to use linear and non-linear classifiers for the on-line classification of parameters. Examples are linear discriminant analysis or support vector machine based classifiers calculated in g.BSanalyze. The classifier block also performs a statistical analysis to realize a zero class for BCI control. This means that the BCI system will not make a decision if the subject is not paying attention. Furthermore, blocks for majority voting and change rate calculation are included.
- Optimized pre-processing, signal processing, feature extraction and classification blocks
- Helps you design your real-time application rapidly
- Code can be used for off-line and on-line biosignal analysis
- Algorithms for fast, accurate, flexible simulations and estimations
- Blocks for EEG, ECG, EMG, respiration and GSR analysis
- On-line classification with LDA, SVM,... included
- Zero class detection integrated
Calculating Physiological Parameters
To open the g.RTanalyze block library, type gRTanalyze in the MATLAB command window.
The following model shows the calculation of heart-rate, heart-rate variability, respiration rate and galvanic skin response parameters.
Perform the following steps:
- Open the gPhysioObserver model and start it. The model reads in ECG, respiration and GSR data acquired at 256 Hz.
- Double click on the Scope to visualize the biosignal raw data. The ECG data is bandpass filtered between 5 and 100 Hz to remove artifacts, the GSR data is lowpass filtered at 5 Hz and the respiration signal is filtered between 0.1 and 10 Hz. Double-click on the HR & HRV block to open the configuration window for the QRS complex detection. The window also allows you to define parameters for artefact removal and to select output parameters.
- Set the Base HR to 60 bpm, the Maximum HR to 180 bpm and the Minimum HR to 30 bpm.
- Set the Maximum RR increase to 70 % and the Maximum RR decrease to 40%. Heart-beats outside of these thresholds are not considered.
- Define the Calculation interval as 1 min. This is a running time window used for the parameter calculations.
- Select Calculate mean HR [bpm] as output signal.
- Double click on the HR Time Domain block and set the Reference interval to 60 seconds. The Reference interval defines the interval used for the heart-rate calculations.
- Set Min HR to 30 bpm, Max HR to 180 bpm, Max RR decrement to 40%, and Max RR increment to 70%. These parameters are used for artefact removal. Set the Sampling frequency to 256 Hz and the Validation window to 2 s. The Sampling frequency must be equal to the data acquisition frequency of the amplifier. The Validation window is used for the signal quality parameter calculated with the Kurtosis.
- Open the ECG Scope to view the unfiltered and filtered ECG signal (channels 1 and 2). Channel 3 indicates the validity of the computed RR intervals and derived HR time domain parameters (0 – not valid, 1 – valid) and channel 4 shows the calculated Kurtosis as quality parameter. The Kurtosis measures how well formed the QRS complexes in the ECG signal are over a certain period of time. If the Kurtosis goes below a certain value, then the data is rated as not valid. The duration is defined by the Validation window parameter.
Then, open the HR Parameters Scope.
The first and second channels represent the beat-to-beat heart-rate and the mean heart-rate in beats per minute. Channels 3 and 4 represent the RRMSD [ms] and pNN50 [%] parameters. All these parameters are calculated from the moving Reference interval. Channel 5 represents the ratio between the normalized heart-rate and the normalized RMSSD parameters (channel 2/channel 3). Both are normalized to their minimum and maximum values gathered during the reference period at the beginning of the experiment (first complete Reference interval). The last two channels show the maximum and minimum heart-rate.
- Open the Changes Rates HR block and define a Reference interval of 30 seconds, a Sampling rate of 256 Hz and a Reference start delay of 15 seconds. Set the Evaluation window to 5 seconds. Set the Method to Mean.
- Open the HR Changes Scope to show the Change Rate and the Running Rate for the beat-to-beat heart-rate. The change rate between the Evaluation window and the Reference interval is calculated. For the Change Rate, the same Reference interval at the beginning of the experiment is used. For the Running Rate, the Reference interval moves along with the Evaluation window as time proceeds. The time period prior to the Evaluation window is selected as the Reference interval.
- Open the Change Rates GSR block of the GSR signal and set the Reference interval to 20 s, the Sampling rate to 256 Hz, the Reference start delay to 0 s and the Evaluation window to 2 s. The GSR Changes Scope visualizes the raw and filtered GSR signal, the Change Rate and the Running Rate as described above.
- Open the Respiration block and set the Sampling rate to 256 Hz, the Downsampling parameter to 10 Hz and the Blank time (within which no other respiration minimum or maximum may occur) to 0.3 s to avoid artifacts. Open the Respiration block and set the Sampling rate to 256 Hz, the Downsampling parameter to 10 Hz and the Blank time (within which no other respiration minimum or maximum may occur) to 0.3 s to avoid artifacts.
- Open the Change Rates Respiration block and enter 20 s as Reference interval. The Respiration Changes Scope shows the change rates of the respiration rate.