56
Biomedical Signal Processing Lecture 2 梁梁梁梁 梁梁梁梁梁 [email protected] Office: 梁梁梁梁 416R, Tel: Ext. 62549 Lab: 梁梁梁梁梁梁梁梁梁梁梁梁 ( 梁梁梁梁 301R) http://ncbci.csie.ncku.edu.tw/

Biomedical Signal Processing Lecture 2 梁 勝 富 成功大學 資訊工程系 [email protected] Office: 雲平東棟 416R, Tel: Ext. 62549 Lab: 神經運算與腦機介面實驗室

Embed Size (px)

Citation preview

Biomedical Signal Processing

Lecture 2

梁 勝 富 成功大學 資訊工程系 [email protected]

Office: 雲平東棟 416R, Tel: Ext. 62549

Lab: 神經運算與腦機介面實驗室 ( 雲平東棟 301R)http://ncbci.csie.ncku.edu.tw/

2

Outline

Typical Measurement System Analog Signal Processing

Source: Chapter 1 of Biosignal and Biomedical

Image Processing, John L. Semmlow, Marcel Dekker, ISBN: 0-8247-4803-4 3.

3

Typical Measurement Systems

Typical bioengineering measurement contains Transducer: converts energy from

one form to another. Amplifier Analog Signal Processing:

Analog Filtering Analog to Digital conversion Time Sampling

4

Typical Measurement Systems

5

Transducers A transducer is a devices that convert

energy from one form to another. The purpose of energy conversion: to

transfer information. In measurement systems: (input)

transducers convert non-electrical energy into an electronic signal.

The exception: electrode, that converts electrical energy from ionic to electronic form.

The output: a voltage (or current), whose amplitude is proportional to the measured energy.

6

Transducers The energy that is converted by the

input transducer may be generated by the physiological process itself:

cardiac pressures: pressure sensor electrical activity: E‘x’G)

indirectly related to the physiological process:

positron emission tomography (PET, 正子造影 )

an external source: e.g. x ray

7

Transducers

8

Chemical Transducer 酵素反應感測器

• 酵素轉換生物體物質 ( 例如 : 葡萄糖 ) 過程中會產生過氧化氫 (H2O2)•山葵過氧化氫酶 (horseradish peroxidase,HRP) 催化發光胺 (luminal) 與過氧化氫產生化學反應•發光胺產生氧化反應而發射光•設計 CMOS 冷光感測晶片利用光二極體吸收反應所產生的冷光並轉化成電壓訊號輸出以偵測待測物的濃度

9

Chemical Transducer 酵素反應感測器

• 酵素轉換生物體物質 ( 例如 : 葡萄糖 ) 過程中會產生過氧化氫 (H2O2)•山葵過氧化氫酶 (horseradish peroxidase,HRP) 催化發光胺 (luminal) 與過氧化氫產生化學反應•發光胺產生氧化反應而發射光•設計 CMOS 冷光感測晶片利用光二極體吸收反應所產生的冷光並轉化成電壓訊號輸出以偵測待測物的濃度

10

血氧感測器

•脈動含氧血紅素飽和度 (Oxy-hemoglobin saturation by pulse oximetry)

•Hb 與 HbO2 對不同光線波長之吸收率不同,分析光二極體偵測之紅光與紅外光,經換算得知血液含氧比例。

11

Electrodes

Sensors from left to right:Cable harness incl. EEG, EOG and EMG electrodes, ECG electrodes,2 effort belts, snoring microphone, finger sensor, thermistor, nasal prong

12

Electrodes

Invasive electrode for BCI (Hochberg et al., Nature, 2006)

Flex Sensor Flex Sensor 為一可變電阻,電阻值會隨著不同的彎

曲程度而改變

Flex Sensor

手握拳 ( 手指彎曲度最大 )

手攤平 ( 手指彎曲度最小 )

Accelerometer

15

TI eZ430-Chronos

http://www.actiwatch.respironics.com/default.asp.ADXL335

16

Analog Signal Processing The first stage depends on the basic

transducer operation E.g., ExG: convert the variation in

electrical property into a variation in voltage.

Single ended: constant current operation.

Different change: bridge circuit.

17

Analog Signal Processingtt RR Single ended

18

Analog Signal Processing

Characteristics of Ideal Op AmpsInfinite gain for the differential input signal Zero gain for the common-mode input signal Infinite input impedances Zero output impedance Infinite bandwidth

19

20

Analog Signal Processing

0)( ttTout RRIV

R

VRRV sttout )(

stt VRRR ]/)[(

柯希荷夫電壓定律

21

Noise Noise is what you do not want and

signal is what you want. Noise in biomedical measurement

Physiological variability: biological influences other than those of interest

Environmental noise or interference. E.g. fetal ECG is corrupted by the

mother’s ECG. Transducer artifact.

E.g. movement artifact Electronic noise.

thermal noise, shot noise.

22

Noise

23

Environmental Noise Artifact of ERP Signals-Eye Blinking

24

Environmental Noise Fetal ECG is corrupted by the mother’s

ECG

25

Transducer Artifact Movement Artifact

26

60 Hz Interference ECG with 60 Hz interference

27

Noise White noise contains energy at all

frequencies (or at least all the frequencies of interest)

28

Signal-to-Noise Ratio The relative amount of signal and noise

present in a waveform is usually quantified by the signal-to-noise ratio, SNR.

SNR is the ratio of signal to noise and both are measured in root-mean-squared (RMS) amplitude:

Matlab: 20*log10(s/n)

Matlab: 10^(db/20)

db

29

Noise 20db=10 times 6db~2 times +3db=1.414 0db=1 -3db=1/1.414=0.707

30

Why using dB? Very small and very large magnitudes can be displayed clearly on a single plot.Linear scale 但圖上看不出大小

410)60( H

dB scale可清楚看出 dB85)60(

dBH

Notch filter: 消除某些頻率 component, 60Hz in this case.

31

Noise30 Hz sine wave with varying amount of added noise

32

Analog Filters The analog filters are design to

Remove noise Condition the signal for analog-to digital

conversion (ADC) Sampling theory: a sinusoid can be

uniquely reconstructed providing it has been sampled by a least two equally spaced points over a cycle.

Any signal that contains frequency components greater than twice the sampling frequency cannot be reconstructed.

33

Analog Filters Property of filters

Filter type: lowpass, high pass, band pass, etc.

Bandwidth Attenuation characteristics

34

Analog Filters Filter types

Lowpass filters: allow low frequencies to pass with minimum attenuation while high frequency are attenuated.

Highpass filters: pass high frequencies but attenuate low frequencies.

Bandpass filters: reject frequencies above and below a passband region.

Bandstop filters: pass frequencies on either side of a range of attenuated frequencies.

35

Bode PlotsA Bode plot shows the magnitude of a network function in decibels versus frequency using a logarithmic scale for frequency.

36

Logarithmic Frequency Scales

•On a logarithmic scale, the variable is multiplied by a given factor for equalincrements of length along the axis.

•The advantage of a logarithmic frequency scale compared with linear scale is that the variations of a transfer function for a low range of frequency and the variations in a high range can be shown on a single plot.

×10 ×2

37

Filter types

-3dB

38

Analog Filters Filter bandwith

The frequency range of passband: attenuation for 3 dB

E.g. Lowpass fiter: 0~cutoff frequency.

Filter order: number of energy storage element in the filter circuit. 20db/decade by adding one order

39

Boundary of Passband

For Bff

707.021 BfH

2/12 BfH

Bff 稱為 half-power frequency

5.02

in

2

out2 V

VBfH

40

Filter Design vs. Attenuation

41

Filter order vs slope of attenuation

42

Analog to Digital Conversion

Analog-to-digital converter (ADC) Electronic component converts an

analog voltage to an equivalent digital number.

Slicing the signal in two ways: slicing in time and slicing in amplitude.

Slicing in time: sampling (samples/sec)

Slicing in amplitude: quantization (Bits)

43

Analog to Digital Conversion

44

Analog to Digital Conversion

•ADC allows multiple input channels to be converted.•Sampling rate for each channel = system conversion rate/# of channels

45

Analog to Digital Conversion

Quantization Error Resolution: output

range/quantization level. What is the resolution of a 5-volt

and 12-bit ADC system?

Volt 0012.04096/52/5 12

46

Analog to Digital Conversion

Quantization Error

47

Analog to Digital Conversion

Shannon Sampling Theorem A sinusoidal waveform can be

uniquely reconstructed provided it is sampled at least twice in one period.

A continuous waveform can be reconstructed without loss of information provided the sampling frequency is greater than twice the highest frequency in the analog waveform.

max2 ff s

48

Aliasing

250Hz

500Hz

750Hz

In this example, A-D conversion is 1000 Hz and the Nyquist frequency is 500 Hz. Signals of 250 and 500 Hz can be adequately portrayed in digital form. However, a frequency of 750 Hz will appear as a frequency of 250 Hz. Frequency above the Nyquist frequency are thus aliased into the recording.

49

Aliasing It means if there is a 250 Hz

components in a digitized data with 1000 Hz sampling rate, the component may come from A real 250 Hz component An aliasing of a 750 Hz component

So we need analog lowpass filter to anti-aliasing before sampling.

50

Aliasing

51

Aliasing

52

Aliasing

53

Aliasing%%fs=100 HzN = 100;

fs = 100;t = (1:N)/fs;

% case1:f=5Hzf5=5; n5=2*pi*f5*t;x5 = sin(n5);

figure(1)plot(t,x5)xlabel('Time (sec)');ylabel('sin(2*pi*f*t)');title('fs=100Hz, f=5Hz')

%case2:f=10 Hzf10=10; n10=2*pi*f10*t;x10 = sin(n10);

figure(2)plot(t,x10)xlabel('Time (sec)');ylabel('sin(2*pi*f*t)');title('fs=100Hz, f=10Hz')

%case3:f=75 Hzf75=75;n75=2*pi*f75*t;x75 = sin(n75);

figure(3)plot(t,x75)xlabel('Time (sec)');ylabel('sin(2*pi*f*t)');title('fs=100Hz, f=75Hz')

%case4:f=25 Hzf25=25;n25=2*pi*f25*t;x25 = sin(n25);

figure(4)plot(t,x25)xlabel('Time (sec)');ylabel('sin(2*pi*f*t)');title('fs=100Hz, f=25Hz')

%%fs600=600%case5:f=75Hz, fs=600HzN600 = 600;fs600 = 600;t600 = (1:N600)/fs600;f75=75;t600 = (1:N600)/fs600;n75_600=2*pi*f75*t600;% Generate datax75_600 = sin(n75_600);

figure(5)plot(t600,x75_600)xlabel('Time (sec)');ylabel('sin(2*pi*f*t)');title('fs=600Hz, f=75Hz')

54

Analog to Digital Conversion

Nyquist frequency One half the sampling rate.

Aliasing The (highest) frequency of the

recorded signal exceeds the Nyquist frequency will cause aliasing (error).

Anti-Aliasing Increasing the sampling rate of ADC, or Filtering the analog signal before ADC.

2sf

55

Data Banks Physio Net Data Bank (MTI)

http://www.physionet.org ICALAB Data Bank (Japan)

Http://www.bsp.brain.riken.go.jp/ICALAB

BCI Competition http://ida.first.fhg.de/projects/bci/

competition_iii/

56

Chapter 2 of Biosignal and Biomedical Image Processing, John L. Semmlow, Marcel Dekker, ISBN: 0-8247-4803-4 3.

Chapter 3 of Biomedical Signal Analysis, Rangaraj M. Rangayyan, Wiley, ISBN: 0-471-20811-62.

Study