Professional Documents
Culture Documents
Biomedical Instrumentation File: Submitted By: Preeti Gupta
Biomedical Instrumentation File: Submitted By: Preeti Gupta
Biomedical Instrumentation File: Submitted By: Preeti Gupta
INSTRUMENTATION
FILE
SUBMITTED BY:
PREETI GUPTA
EXPERIMENT NO. 1
Aim: Write a MatLab code to perform the following filtering actions
1. Remove frequencies above 90 hz.
2. Remove frequencies below 0.5hz
3. Remove frequencies between 50 to 60 hz
Theory:
In this experiment we use butterworth filter in low, high and bandpass configuration to perform
the required task. It is assumed that a total of 1280 samples are taken in 1 second. Hence we can
get the sampling frequency which is used to normalize the cutoff frequency of the respective
filter.
A low pass filter is used to remove the frequencies above 90hz. The output from butter function
is used in the filter function to get the desired plot. Similarly high pass filter is used to remove
frequencies below 0.5 hz and band pass filter is used to remove frequencies between 50 to 60 hz.
MatLab code:
close all;
val=val(1,1:500);
plot(val); %%plotting the ecg filter
f=1280; %%assuming the samples are taken in 1 sec
OUTPUT
Input signal
Output after removing frequencies above 90hz.
MatLab code:
%%% ECG SIGNAL DENOISING BY THRESHOLDING ITS DWT COEFFICIENTS
val=val(1,:);
% decomposition up to level 3
level=3;
In this experiment we use the fft function in matlab to perform the discrete Fourier transform.
The signal is given as input to the fft function and the absolute value is plotted.
MatLab code:
x=val(1, :);
y=fft(x);
z=plot(abs(y));
Output
EXPERIMENT NO. 4
Aim: Write a MatLab code to calculate the number of R-peaks in the given signal.
Theory:
In this experiment, we calculate the number of R-peaks in the given ECG signal. The heart-beat
could also be calculated if the time duration for supplied ECG signal is known, by just dividing
that R-peak count with the time duration.
To calculate the number of R-peaks in the signal, an optimum value for threshold is chosen
according to the input wave (e.g for the ECG wave input used, threshold has been taken to be
150).
Then, a count variable is initiated to zero and whole ECG signal is traversed using a simple loop
checking each value for:
i) greater then the threshold;
ii) current value is larger than the previous value; and
iii) current value is larger than the next value
If the all the above conditions are met, the value of count is increased, and loop is continued.
MatLab code:
count=0;
b=size(val,2);
threshold=150;
x=val(1,:);
for j=1:1:b
if x(j)>threshhold & x(j+1)<x(j) & x(j-1)<x(j)
count=count+1;
end
end
Output
EXPERIMENT 5
AIM: Simulation of respiratory system in MatLab using SIMULINK.
THEORY:
The airways are divided into two categories: the larger or central airways and the smaller or
peripheral airways, with fluid mechanical resistances equal to Rc and Rp, respectively. Air that
enters the alveoli also produces an expansion of the chest wall cavity by the same volume. This
is represented by the connection of the lung CL, and the chest wall Cw compliances in series.
However a small fraction of the volume of air that enters the respiratory system is shunted away
from the alveoli as a result of the compliance of the central airways and gas compressibility. We
account for this effect by placing a shunt compliance, C, in parallel with CL and Cw.
The pressures developed at the different points of this lung model are:
Ppl in the pleural space. These pressures are referenced to P0, the ambient pressure, which can be
set to zero.
Suppose the volume flow-rate of air entering the respiratory system is Q, then the objective here
is to derive a mathematical relationship b/w Pao and Q.
Simply by applying the Kirchhoff’s laws then taking the inverse Laplace of the resulting
differential equation and putting the values of various pulmonary parameters we have the
transfer function as:
Q (s ) s 2+ 420 s
= 2
P ao ( s ) s +620 s +4000