This script imports a text file containing a set of data. The text file can be created by cutting a section of data from one of the Excel files, pasting it into a new Excel document and saving it as "text file (tab delimited)".
It then filters the data to eliminate noise, using Buttworth lowpass filter for the left ventricular and atrial pressure (eigth order, 20 Hz cutoff), the aortic pressure (eigth order, 30 Hz cutoff), the aortic flow (eigth order, 50 Hz cutoff) and the intracardiac volume (twelvth order, 15 Hz cutoff). A Butterworth band pass filter (fourth order, passband 0.01 Hz to 250 Hz) is used for the ECG.
The result is a matrix with seven columns which contain the time indices, the left ventricular pressure, the aortic pressure, the atrial pressure, the aortic flow, the ECG and the intracardiac volume.
This script calculates the scale factors of the intracardiac volume for a previously imported data set DS1, along with statistical data like the mean, variance and standard deviation. The scale factor is necessary since the 'raw' volume data is uncalibrated.
The script searches for the beginning of each ventricular systole by looking for a point where the ventricular pressure rises above the atrial pressure. The ventricular pressure also has to be below 70% of the maximum of its range since the first criterium is also fulfilled at several points during the systole. Then, it integrates the aortic flow over 128 samples and compares the result to the difference in intracardiac volume.
Also, it gives a plot of the ventricular and aortic pressure waveforms and marks the spots where it detected the start of the systole for verification.
Similar to the previous script, this one searches DS1 for the beginning of diastolic filling. It records the points in the array T and plots the atrial and ventricular pressure waveforms for verification.
This script will be useful later on for analyzing large data sets automatically.
This script calls FindDiastole.m to determine the starting points of diastolic filling in a data file that has been previously imported as DS0. It then calculates a sample-by-sample average of the 100 samples following the starting point. In effect, this creates an "average" waveform for the data set, as long as the heart beats are about the same length.
Similar to the previous script, this one searches DS1 for the beginning of diastolic filling. It records the points in the array T and plots the atrial and ventricular pressure waveforms for verification.
This script will be useful later on for analyzing large data sets automatically.
A SIMULINK model file containing the complete diastolic filling model including the variable heart valve aperture. Running the model in SIMULINK instead of using a Matlab script has several advantages. There is no need for a separate equations file, any variable in the model can be accessed simply by connecting it to an output block, and the function of the numeric integration algorithms used in SIMULINK is clearer than that of the ODE commands in Matlab, for example.
A SIMULINK model file containing the diastolic filling model with a constant mitral valve aperture.
A SIMULINK model file containing the complete diastolic filling model including the variable area heart valve model aperture. It has been modified for artificial atrial and ventricular pressure waveforms like step and impulse signals.
These two matlab scripts can be used to plot the output of a SIMULINK simulation run. The first file compares the results of the simulation against a previously imported data set DS1, while the second script only plots the simulation results.
This file uses an iterative process to match the pressure waveforms of the model to a previously imported data set by adjusting the parameters in each iteration, using simple rules. So far, the script adjusts ventricular and atrial stiffness, atrial inflow and the magnitude and time constant of the exponential pressure decay in the ventricle. It works well, but should be considered "experimental".
A script that plots the convergence of the parameters after running the iter.m script file. It displays a plot of the change of each parameter with every iteration - if this value converges to 0, the paramater has converged.
A Word document containing a brief introduction to the use of the Matlab and Simulink files