DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

36
Respiratory monitoring DSP II – Final presentation 16/12/2008 1 Hans De Clercq & Rogier Corthout

Transcript of DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Page 1: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 1

Respiratory monitoring

DSP II – Final presentation

16/12/2008

Page 2: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 216/12/2008

Some background…

Page 3: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 3

Project integrated in master thesis:◦ “Textile-integrated data-acquisition system”◦ Prof. Dr. Ir. R. Puers◦ Optional course in Biomedical technology

Application for monitoring breathing disorders (e.g. SIDS) during sleep for babies

Accelerometer-based design measuring movements during breathing

Started from scratch shaped our own DSP-project…

16/12/2008

Some background…

Page 4: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 4

Non-uniform chest/abdomen expansion measurement variation of inclination using accelerometers placed sideways on the chest/abdomen

XY-plane modulus & angle

16/12/2008

Some background…

Respiration

g

Page 5: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 5

Raw signal vs gold standard

Accelerometer (angle) Spirometer

16/12/2008

Time (samples @ 20 Hz)

Time (s)

Page 6: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 6

Signal conditioning•Noise cancellation from low-cost accelerometers•Offset cancellation

Adaptive filtering •Extraction dominant breathing frequency using adaptive band-pass filter

Information processing•Extraction RMS•Phase shift with reference signal

Decision making •Fuzzy clustering: distinction heavy/quiet breathing, coughing, apnoea…

16/12/2008

Objectives project DSP II

Page 7: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 716/12/2008

Block scheme

Offset & noise

cancellation

Nishimura or

N-points FFT

Adaptive BPF

Extraction dominant frequency

RMS

Accelerometer signal

Spirometer signal

Phase shift

Decision making (fuzzy logic)

Breathing rate

Breathing pattern

Error rate

Page 8: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 8

Noise cancellation from low-cost accelerometers outside useful breathing BW◦ Noise limits accelerometer resolution:

1000μg/sqrt(Hz)◦ Analog filtering (simple RC) anti-aliasing: sample

frequency ADC ~ 10 Hz Offset cancellation

◦ Simple, but steep high-pass IIR-filtering (cut-off ~ 0.01 Hz)

◦ E.g. third order Chebychev Normalization with reference signal

16/12/2008

Signal conditioning

Signal conditioning

•Noise cancellation from low-cost accelerometers•Offset cancellation

Adaptive filtering

•Extraction dominant breathing frequency using adaptive band-pass filter

Information processing

•Peak and amplitude detection•Phase shift with gold standard

Decision making

•Heavy/quiet breathing, coughing, talking and undefined signal

Page 9: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 9

Signal conditioning

•Noise cancellation from low-cost accelerometers•Offset cancellation

Adaptive filtering

•Extraction dominant breathing frequency using adaptive band-pass filter

Information processing

•Peak and amplitude detection•Phase shift with gold standard

Decision making

•Heavy/quiet breathing, coughing, talking and undefined signal

Objectives:◦ Cancel the noise inside the useful breathing BW,

obtaining only the “sine wave”-like signal◦ Obtain the dominant frequency as a parameter

for the pattern detector

Comparison with gold standard…

16/12/2008

Adaptive filtering

Page 10: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 10

Two methods explored:◦ Nishimura method◦ STFT-method

Algorithms tested on 3 different signals:1. Sine wave with Gaussian noise

4 different frequencies/amplitudes SNR < 2dB

2. Spirometer measurement (gold standard)3. Accelerometer measurement (test signal)4. … and those two combined …

16/12/2008

Adaptive filtering

Page 11: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 11

Concept: adaptive band-pass filter (IIR!) Filter is tuned in real-time to maximize the

output of the bandpass filter:◦ Basically, input is a “sine wave” with a variable

frequency covered in noise…◦ Bandpass filtering for maximum output

= looking for the frequency band with maximum power!

16/12/2008

Nishimura method

Page 12: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 1216/12/2008

Input signal

Frequency (Hertz)

Time (s)

Page 13: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 13

2nd order IIR-filter:

α0 determines the selectivity of the filter…

16/12/2008

Nishimura method [2]

20

1 21 0 0

1 1( ) .

2 1 ( )(1 )B

zH z

k z z

Increasing α0

Page 14: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 14

2nd order IIR-filter:

α0 determines the selectivity of the filter α1 determines the center frequency of the

pass-band:

α1 is iteratively tuned in real-time to maximize the output of the bandpass filter…

16/12/2008

Nishimura method [2]

10 1

1cos ( )k

T

20

1 21 0 0

1 1( ) .

2 1 ( )(1 )B

zH z

k z z

Page 15: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 15

Iterative updating scheme for α1:◦ Gradient algorithm towards maximum output

power

◦ μ determines the convergence speed, and is heavily related with stability…

16/12/2008

Nishimura method [3]

2

1

( )2 ( ) ( )

( )

y ky k k

k

xμ+

y(k)

Δ

u(k)HB(z) G(z)

1 0

0 0

( ) ( )(1 ) ( 1)

( 2) (1 ) ( 1)

k k k

k y k

1 1( 1) ( ) ( ) ( )k k y k k

Page 16: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 16

Strengths Weaknesses

16/12/2008

Nishimura method: results

Page 17: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 17

Update filter for every new input value Computational efficiency real-time

implementation possible

16/12/2008

Nishimura method: results

xμ+

y(k)

Δ

u(k)HB(z) G(z)

1 0

0 0

( ) ( )(1 ) ( 1)

( 2) (1 ) ( 1)

k k k

k y k

1 1( 1) ( ) ( ) ( )k k y k k

Page 18: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 18

Strengths Weaknesses

16/12/2008

Nishimura method: results

Page 19: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 19

Limited convergence speed if varying frequency…

E.g. on sine wave signal with varying frequency and amplitude…

16/12/2008

Nishimura method: results

Time (s) Time (s)

Dete

cted

dom

inan

t fr

eq

uen

cy (

Hz)

Am

plit

ud

e in

pu

t si

gn

al

Page 20: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 20

Strengths WeaknessesLimited convergence

speed if varying frequency

Stability problems of IIR-filter

Update filter for every new input value

Computational efficiency real-time

implementation

16/12/2008

Nishimura method: results

Page 21: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 2116/12/2008

Nishimura method: conclusion Works “fine” on artificial sine wave signal… Biomedical signals aren’t deterministic at all

limited convergence speed = bottleneck in detecting the dominant frequency

E.g. on simple spirometer signal…

Time (s) Time (s)

Dete

cted

dom

inan

t fr

eq

uen

cy (

Hz)

Am

plit

ud

e in

pu

t si

gn

al

Estimation of real

frequency

Unstable working regime…

Page 22: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 22

After paper Hung & Bonnet… Divide signal in 51.2s (1024 samples)

segments with 1/6th overlap between windows for edge continuity

Assumption: continuity over time window Calculate spectrum and detect maximum

freq. of accelerometer signal f0 ∈ 0.1-1Hz Filter the signal in pass-band:

using a 4th order Butterworth filter…

16/12/2008

STFT-method

0 0max(0.1 , 0.4 ) 0.4Hz f Hz f f Hz

Page 23: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 23

Strengths WeaknessesAccuracy: Heisenberg

principle

Not in real-time

No convergence problems

No stability problems

16/12/2008

STFT-method [2]

Page 24: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 2416/12/2008

STFT-method [3] E.g. on spirometer signal (trivial on sine

wave)

frequency time

less smearing out of low breathing

frequencies

Page 25: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 25

E.g. applied on spirometer signal… Limited frequency resolution But still more reliable than Nishimura for

long term monitoring…

16/12/2008

STFT-method [4]

Time (s) Time (s)

Dete

cted

dom

inan

t fr

eq

uen

cy (

Hz)

Am

plit

ud

e si

gn

al

Filtered signal Detected frequency

Page 26: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 2616/12/2008

Comparison using accelerometers

Original signal

Filtered (STFT method)

Filtered (Nishimura)

Similar results:• STFT more reliable and

intuitive• Nishimura hard real-time

potential… STFT seems to be the

wisest choice for long-term applications!

Time (s) Time (s)

Dete

cted

dom

inan

t fr

eq

uen

cy (

Hz)

Am

plit

ud

e si

gn

al

Time (s) Time (s)

Dete

cted

dom

inan

t fr

eq

uen

cy (

Hz)

Am

plit

ud

e si

gn

al

Am

plit

ud

e si

gn

al

Page 27: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 2716/12/2008

Comparison of performance on spiro & accelero

Accelerometer signal Spirometer signal

Filtered signal using STFT

Filtered signal using Nishimura

Detected frequency using STFT

Detected frequency using Nishimura

Consistent detection on both signals

Inconsistent detection due to unstable

behaviour…

Page 28: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 28

Dominant frequency (supra) RMS-value of BP-filtered signals Phase shift with gold standard

◦ Normally consistently small during quiet breathing [GOLLEE]

◦ Exception: transient/fast movement, e.g. forced expiration (coughing)

◦ Implemented, but not yet used for this application…

16/12/2008

Information processing

Signal conditioning

•Noise cancellation from low-cost accelerometers•Offset cancellation

Adaptive filtering

•Extraction dominant breathing frequency using adaptive band-pass filter

Information processing

•Peak and amplitude detection•Phase shift with gold standard

Decision making

•Heavy/quiet breathing, coughing, talking and undefined signal

Page 29: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 29

Signal conditioning

•Noise cancellation from low-cost accelerometers•Offset cancellation

Adaptive filtering

•Extraction dominant breathing frequency using adaptive band-pass filter

Information processing

•Peak and amplitude detection•Phase shift with gold standard

Decision making

•Heavy/quiet breathing, coughing, talking and undefined signal

Determination of breathing pattern from processed information

Clustering of sampled values for all parameters using fuzzy techniques Advantage: clustering techniques can reveal

structures in data without relying on assumptions common to conventional statistical methods, such as the underlying statistical distribution

16/12/2008

Decision making

Page 30: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 30

Data set to be clustered:

Every time sample has its membership function μik:

16/12/2008

Decision making [2]

11 1

1

N

n nN

z z

Z

z z

Time samples k=1…N

Clu

ster

vari

able

s 1…

n

1

1

0,1 , 1 , 1

1 , 1

0 , 1

ik

c

iki

N

iki

i c k N

k N

N i c

Page 31: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 31

Objective is to minimize the fuzzy c-means functional:

Implementation of Gustaf-Kesselson algorithm in Matlab◦ Complex iterative algebraic problem, further

mathematical details omitted…◦ Only input parameter: expected number of clusters c

16/12/2008

Decision making [3]

2

1 1

( ) , 2i

c Nm

ik ikAi k

J D m

Membership function of sample k to cluster i

Distance of sample k to center of cluster i

Page 32: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 32

Output of algorithm:◦ Partition matrix with all

membership functions U

◦ Cluster prototype matrix V with cluster centers

◦ Cluster covariance matrix F

16/12/2008

Decision making [4]11 1

1

N

c cN

U

11 1

1

n

c cn

v v

V

v v

11 1

1

n

c cn

f f

F

f f

Time samples k=1…N

Clu

ster

num

ber

1…

c

Cluster variables k=1…n

Clu

ster

num

ber

1…

c

Cluster variables k=1…n

Clu

ster

num

ber

1…

c

Page 33: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 33

Detection mean amplitude or average power per breathing pattern

Application on artificial test signals obtain low error rates during clustering:◦ ε < 15% using Nishimura◦ ε < 5% using STFT-BPF!

16/12/2008

Results and discussion

Page 34: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 3416/12/2008

Results and discussion [2]

Dominant frequency (STFT)

RM

S S

TFT

-BPF o

utp

ut

Long-term measurement using only accelerometers…

Quiet breathin

g

Heavy breathin

g

No breathin

g

boxplot RMS

boxplot dom. freq.

point cloud

Cluster number

Clu

ster

num

ber

Page 35: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 35

Gustaf-Kesselson starts with random cluster centers use statistical information to initialize clustering more reliably

Expand frequency detection & fuzzy clustering to other signals (ECG, oximetry,…) in order to:◦ Obtain redundant measurements increase

reliability◦ Examine the correlation between those signals

during apnoea

16/12/2008

Future work & potential…

Page 36: DSP II – Final presentation 16/12/2008 1Hans De Clercq & Rogier Corthout.

Hans De Clercq & Rogier Corthout 36

Respiratory monitoring

DSP II – Intermediate presentation

16/12/2008