# Teoria de filtors

Páginas: 7 (1686 palabras) Publicado: 8 de junio de 2010
ECG SIMULATION USING MATLAB
Principle of Fourier Series

Presented by R. KARTHIK B.E. (E.C.E), 6TH Semester College of Engineering, Guindy, Anna University, Chennai – 600025 e-mail: may_62003@yahoo.co.in

Introduction: The aim of the ECG simulator is to produce the typical ECG waveforms of different leads and as many arrhythmias as possible. My ECG simulator is a matlab based simulator andis able to produce normal lead II ECG waveform. The use of a simulator has many advantages in the simulation of ECG waveforms. First one is saving of time and another one is removing the difficulties of taking real ECG signals with invasive and noninvasive methods. The ECG simulator enables us to analyze and study normal and abnormal ECG waveforms without actually using the ECG machine. One cansimulate any given ECG waveform using the ECG simulator.

Significant features of ECG waveform: A typical scalar electrocardiographic lead is shown in Fig. 1, where the significant features of the waveform are the P, Q, R, S, and T waves, the duration of each wave, and certain time intervals such as the P-R, S-T, and Q-T intervals.

fig 1.Typical ECG signal

Main features of this simulator: •Any value of heart beat can be set • Any value of intervals between the peaks (ex-PR interval) can be set • Any value of amplitude can be set for each of the peaks • Fibrillation can be simulated • Noise due to the electrodes can be simulated • Heart pulse of the particular ECG wave form can be represented in a separate graph

Principle: Fourier series
Any periodic functions which satisfydirichlet’s condition can be expressed as a series of scaled magnitudes of sin and cos terms of frequencies which occur as a multiple of fundamental frequency.

n=1

n=1

f (x) = (ao/2) + Σ an cos (nπx / l) + Σ bn sin (nπx / l), ao = (1/ l ) ∫ f (x) dx
T

, T = 2l , n = 1,2,3…. , n = 1,2,3….

----

(1) (2) (3)

an = (1/ l ) ∫ f (x) cos (nπx / l) dx
T

bn = (1/ l ) ∫ f (x) sin(nπx / l) dx
T

ECG signal is periodic with fundamental frequency determined by the heart beat. It also satisfies the dirichlet’s conditions: • Single valued and finite in the given interval • Absolutely integrable • Finite number of maxima and minima between finite intervals • It has finite number of discontinuities

Hence fourier series can be used for representing ECG signal.

Calculations:If we observe figure1, we may notice that a single period of a ECG signal is a mixture of triangular and sinusoidal wave forms. Each significant feature of ECG signal can be represented by shifted and scaled versions one of these waveforms as shown below. • QRS, Q and S portions of ECG signal can be represented by triangular waveforms • P, T and U portions can be represented by triangularwaveforms Once we generate each of these portions, they can be added finally to get the ECG signal. Lets take QRS waveform as the centre one and all shiftings takes place with respect to this part of the signal.

How do we generate periodic QRS portion of ECG signal

Fig 2. generating QRS waveform

From equation (1), we have f(x) = (–bax/l) + a = ( bax/l) + a ao = (1/ l ) ∫ f (x) dx
T

0 < x <( l/b ) (– l/b)< x < 0

= (a/b) * (2 – b ) an = (1/ l ) ∫ f (x) cos (nπx / l) dx = ( 2ba / (n2π2 )) * ( 1 – cos (nπ/b)) bn = (1/ l ) ∫ f (x) sin (nπx / l) dx
T T

= 0 ( because the waveform is a even function)

f (x) = (ao/2) + Σ an cos (nπx / l)
n=1

How do we generate periodic p-wave portion of ECG signal

Fig 3. generation of p-wave

f(x) = cos ((πbx) /(2l)) (–l/b)< x < (l/b)ao = (1/ l ) ∫ cos ((πbx) / (2l)) dx
T

= (a/(2b))(2-b) an = (1/ l ) ∫ cos ((πbx) / (2l)) cos (nπx / l) dx = (((2ba)/(i2π2)) (1-cos((nπ)/b))) cos((nπx)/l) bn = (1/ l ) ∫ cos ((πbx) / (2l)) sin (nπx / l) dx
T T

= 0 ( because the waveform is a even function)

f (x) = (ao/2) + Σ an cos (nπx / l)
n=1

Implementation in MATLAB: Code: Save the below file as complete.m x=0.01:0.01:2;...

Regístrate para leer el documento completo.