Lecturer: Dr Igor Khovanov Office: D207 [email protected] Syllabus: Biomedical Signal...

29
Lecturer: Dr Igor Khovanov Office: D207 [email protected] Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace Transform. Transfer Function. Frequency Response. Fourier Transform. Discrete Signal Analysis. Digital (discrete-time) systems. Z-transform. Filtering. Digital Filters design and application. Case Study. ES97H Biomedical Signal Processing 1

Transcript of Lecturer: Dr Igor Khovanov Office: D207 [email protected] Syllabus: Biomedical Signal...

Page 1: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

Lecturer: Dr Igor Khovanov

Office: D207

[email protected] Syllabus:

Biomedical Signal Processing. Examples of signals.  Linear System Analysis. Laplace Transform. Transfer Function.  

Frequency Response. Fourier Transform. Discrete Signal Analysis. Digital (discrete-time) systems. Z-transform.

Filtering. Digital Filters design and application.

Case Study.

ES97H Biomedical Signal Processing

1

Page 2: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

2

BIOMEDICAL SIGNAL ANALYSIS

Page 3: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

3

Systems Analysis. Block Diagrams. Transfer function

Input Signal

( )x tOutput Signal

( )y tsystem

Simple

( )X s ( )Y sH(s)

1

( ) ( ) ( )

( ) ( ) ( )

Y s H s X s

y t H s X s

L

Page 4: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

4

Systems Analysis. Block Diagrams. Transfer function

Series

1( )X s2 ( )X sH1(s)

3 1

2 1 13 2 1 1

3 2 2

( ) ( ) ( )

( ) ( ) ( )( ) ( ) ( ) ( )

( ) ( ) ( )

X s H s X s

X s H s X sX s H s H s X s

X s H s X s

( )Y sH2(s)

Sub-system 1 Sub-system 2

System consists of two sub-systems

Block diagram ( )X s1H ( )Y s

2H

( )X s ( )Y s1 2H H

Page 5: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

5

Systems Analysis. Block Diagrams. Transfer function

Cascade Connection

( )X s H1(s)

1 2( ) ( ( ) ( )) ( )Y s H s H s X s

Sub-system 1

System consists of two sub-systems

H2(s)

Sub-system 2

1( )X s

2 ( )X s

( )Y s

+

-

Block diagram

( )X s ( )Y s1 2H H

Page 6: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

6

Transfer function. Poles and Zeros

A transfer function H(s) can always be written as a rational function of s, that is as a ratio of two polynomials

( ) polynomial of degree ( )

( ) polynomial of degree

P s mH s

Q s n

Polynomials can be factorized as follows

0 1 1

0 1 1

( )( ) ( )( )

( ) ( )( ) ( )m

n

s z s z s zP sK

Q s s p s p s p

The are called the zeros of H(s)

The are called the poles of H(s)

0 1 1, , ,i mz z z z

0 1 1, , ,i np p p p

Poles define the stability of the system; if Re(pi)0 LTI is stable

Page 7: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

7

Transfer function. Impulse response

Consider a test signal as the delta-function, (t). Since ( ) 1t L

Consequently, if x(t)=(t) then X(s)=1 and H(s)=Y(s)The output signal y(t)=h(t) corresponds to the impulse response

Dream: the transfer function H(s) of a system can be obtained by applying an impulse, x(t)=(t), (whilst the system is in its quiescent state) to the system and measuring its response, y(t). H(s) is then given by the Laplace transform of y(t).

Input Signal( )t

Output Signal( ) ( )h t y tsystem

( ) ( ) { ( )}H s Y s y t L

1 1( ) { ( )} { ( )}h t H s Y s L L

Page 8: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

8

Transfer function. Frequency Response

Select the test signal in the form of harmonic functions:sin

cos

A t

A t

Such signals can be realized experimentally

Substitute sj for the transfer function, then the frequency response is

1

( ) ( ) ( )

( ) ( ) ( )

Y s H s X s

y t H s X s

L 1

( ) ( ) ( )

( ) ( ) ( )

Y j H j X j

y t H j X j

L( ) ( ) ( )Y H X

That is, if we know H(s) we can obtain H() by replacing s by j

Note: it is assumed that the system is in a stable steady state.

Page 9: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

9

Transfer function. Frequency Response

The frequency response H(j) is complex function of Therefore the polar form is used

( )( ) ( ) j HH H e

( )

( ) ( )

H

H

is the modulus (gain), the ratio of the amplitudes of the output and the input;

is the phase shift between the output and the input.

Thus, the frequency response is fully specified by the gain and phase over the entire range of frequencies

Both gain and phase are experimentally accessible!

[0, )

Page 10: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

10

Systems Response to a harmonic signal. A cosine input

If a signal Acos(0t) is applied to a system with transfer function, H(s), the response is still a cosine but with an amplitude and phase

0( )A H

00 ( )t H

( )x t ( )y t( )H s

Note. We don’t need to use inverse Laplace Transform to estimate the response in time domain.

0 0 0( ) ( ) cos ( )y t A H j t H j the system response to 0( ) cosx t A t

Page 11: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

11

Systems Response to a harmonic signal. A cosine input

Example. ( )x t ( )y t( )H sInput signal

Transfer functionOutput signal y(t) - ?

( ) 10cos(2 )x t t1

( )1 10

H ss

Rewrite the transfer function as the frequency response in the polar form

( ) ( )

2

2 2 2 2

1 1

1( ) ( ) ( ) ( )

1 10

1 1 10 1 10 1( )

1 10 1 10 (1 10 ) 1 10

10( ) tan tan 10

1

j H s j H jH s H s e H j H j ej

jH j

j

H j

Calculate the gain and phase for 2

Gain

Phase

2

1

1( 2 ) 0.0159

1 400

( 2 ) tan 20 0.5

H j

H j

0 0 0( ) ( ) cos ( )y t A H j t H j

0( ) 0.159cos 0.5y t t

Page 12: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

12

Fourier Analysis. Spectrum

Most signals encountered in engineering can be represented in both the time and the frequency domains. These representations are uniquely related. So, alternating the signal in one domain will alter its representation in the other domain as well.Time domain. The plot of a

signal, x(t), as a function of time, t.

1 1 1( ) sin(2 )x t A f t

Frequency domain. Spectrum. Amplitude, A1, and phase, , of harmonic signal(s) of a given frequency, f 1or .

( )x t

, (sec)t

1 1 1( ) sin( )x t A t

11

1

1

2f

T

00 f, (Hz) f, (Hz)

A radian)

A1

2

1f1f

Page 13: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

13

Fourier Analysis. Amplitude response and phase response

3( ) 2sin 1 1 sin 3 0.5sin 52 2x t t t t Example.

Time domain. ( )x t

t

Frequency domain.

angular frequency, , (rad./s), (rad./s)

ampl

itude

, A

phas

e,

The signal is a sum of a number of harmonic functions.

Amplitude spectrum Phase spectrum

Page 14: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

14

Fourier Analysis. Oscillations

Example. Carcadian rhythm

Many species, from bacteria to humans, maintain a daily rhythm of life by way of a circadian clock.

Body temperature ,Tb, and oxygen consumption, V02

, from

a chronically instrumented pigeon over a 48-hour period .

Page 15: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

15

Fourier series

If the signal is periodic then Fourier series are used.A periodic signal has the property x(t) x(t+T),

T is the fundamental period,

f01/T or 02/T is the fundamental frequency.

0 0 01 1

1( ) cos sin

2 n nn n

x t a a n t b n t

Trigonometric form of signal

a0, an, bn are the Fourier coefficients

0

0

0

0

0

0

2( )cos , 0,1,2

2( )sin , 1,2,3

t T

n

t

t T

n

t

a x t n t dt nT

b x t n t dt nT

T is the fundamental period

0 is the fundamental frequency

For spectrum we need to calculate the coefficients

Page 16: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

16

Fourier series of periodic signals

0 01

1( ) cos

2 n nn

x t a A n t

Alternative representation of Fourier series

a0, An, n are the Fourier coefficients

2 2

1tan

n n n

nn

n

A a b

b

a

2 2

1tan

n n n

nn

n

A a b

b

a

a0 is the DC component, mean value of the signalFrequency components occurs at frequencies of n0 andthey are characterized by amplitudes An and phases n.The n=1 term is called the fundamental frequency component and the n=2,3,... components are called 2nd, 3rd,... harmonics respectively. It is an odd harmonic if n is odd and an even harmonic if n is even. Plots An versus and n versus are amplitude and phase spectra of x(t) respectively.

Page 17: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

17

Fourier Series. Parseval’s Theorem

The “power”, P, of a periodic signal, x(t), can be written via Fourier coefficients an and bn,

Time domain

Frequency domain

0

21( )

T

t

P x t dtT

2

2 20

1

1

4 2 n nn

aP a b

The power (energy) in the time domain and the frequency domain are equal.

Note, T is the duration of the signal here.

Page 18: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

18

Fourier Series

Example. Spectrum of periodic pulse train (the square wave).

t

x(t) +A

-AT

0 0

40,1,2 2 1

(2 1)

0 1,2 2

0,1,2 2 12

0 1,2 2

n

n

n

n

a

AA k n k

k

A k n k

k n k

k n k

00

4( ) sin (2 1)

(2 1)k

Ax t k t

k

Fourier series contains infinite number of terms. So the spectrum contains infinite number of peaks.

Page 19: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

19

Fourier Series

Example. Spectrum of periodic pulse train (the square wave).

Gibbs Phenomenon. 00

4( ) sin (2 1)

(2 1)k

Ax t k t

k

Approximation of square wave by 125 harmonics

Page 20: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

20

Fourier Series. Complex representations

0

0

0

0

( )

1( )

jn tn

n

t Tjn t

n

t

x t c e

c x t e dtT

Complex form. cn are complex coefficients connected with the previously used coefficients as

0 0

1

2 ( )

Im{ }2 tan

Re{ }

n n n n n n

nn n n n

n

a c a c c b j c c

cA c c

c

Example. The spectrum of the square wave.

2, , 1,1

0, , 2,0,2

/ 2, , 1,1

0, , 2,0,2

n

n

jAodd n

c neven n

odd n

even n

Parseval’s theorem:2n

n

P c

Page 21: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

21

Example. Pulse train. 1

1

1,( )

0,

( ) ( )

t Tx t

t T

x t T x t

T is the period of pulses T1 is the pulse duration

0 10 1 0 0

1

2 2( ) sin( )cos( )

4 n

Tx t n T n t

n T

Fourier series representation

0 11 10 1

0 1

sin( )2 2sinc( )n

n TT Tc n T

T n T T

Complex Fourier coefficients

The sinc function

Page 22: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

22

Example. Pulse train. 1

1

1,( )

0,

( ) ( )

t Tx t

t T

x t T x t

T is the period of pulses T1 is the pulse duration

1 10 1 1

2 2 2sinc( ) sinc( )n

T Tc n T n T

T T T

Complex Fourier coefficients

The amplitude spectrum

|cn|

|cn|

As the period T tends to infinity number of frequency component that occur in the frequency interval [0,0] tends to infinity too.

So, if we consider one pulse (impulse) only, the Fourier series are useless .

0 10 1 0

1

2( ) sin( )cos( )

4 n

Tx t n T n t

n

Page 23: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

23

Fourier transform of aperiodic signals.

( ) ( ) j tX x t e dt

Fourier transform of x(t) is denoted X(). It is a continuous function of the frequency.

Parseval’s theorem:

The inverse Fourier transform is1

( ) ( )2

j tx t X e d

( ) ( )x t X Fourier pairs ( )X is the magnitude or amplitude spectrum

1 Im{ ( )}( ) tan

Re{ ( )}

XX

X

is the phase spectrum

Fourier transform: 1 1

{ ( )} ( ) { ( )}

{ ( )} ( ) { ( )}

s j

s j

x t X x t

X x t X s

F L

F L

Energy of an aperiodic signal

22 1( ) ( )

2E x t dt X d

2( )X Energy (Power) spectrum

Frequency responseLaplace transform

Page 24: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

24

Fourier transform

Example. Single rectangular pulse

1

1

1,( )

0,

t Tx t

t T

1 1 1

2{ ( )} ( ) sin( ) 2 sinc( )x t X T T T

F

1 1( ) 2 sinc( )

( ) ( )

X T T

X

The amplitude spectrumThe phase spectrum

| ( ) |X | ( ) |X

( ( ))X ( ( ))X

Page 25: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

25

Fourier transformExample. Single exponential pulse , 0

( )0, 0

te tx t

t

1

{ ( )} ( )x t Xj

F

2 2

1

1( )

( ) ( ) tan

X

X

The amplitude spectrum

The phase spectrum

Page 26: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

26

Fourier transform

Example. The unit impulse function (delta function) (t)

{ ( )} ( ) 1x t X F

( ) 1

( ) ( ) 0

X

X

The amplitude spectrumThe phase spectrum

Example. Harmonic functions 0( ) cosx t A t

0 0 0{ cos( )} ( ) ( )A t A F 0 0

0 0

0

( )

( ) ( )

0 | |

( ) ( ) 0

A

X A

X

White spectrum

00

( )X AA

Page 27: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

27

Fourier transform

Example. Harmonic functions 0( ) sin( )x t A t

0 0 0{ sin( )} ( ) ( )A t jA F0 0

0 0

0

0

0

0

( )

( ) ( )

0 | |

/ 2

( ) ( ) / 2

0 | |

A

X A

X

00

( )X AA

00

( )

/ 2

/ 2

Page 28: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

28

Fourier transform of periodic and aperiodic signals

0( ) 2 ( )kk

X A k

Aperiodic signals

Periodic signals

Spectrum is a continuous function of the frequency

Spectrum of the periodic signal

0

2T

( ) ( )x t x t T

The period of the signal

Spectrum is discrete, specified in (in)finite number of points only.

A general signal can have both aperiodic and periodic components, consequently the spectrum will have both continuous and discrete components:

( ) ( ) ( ) ( )p ap p apx t x t X X

Page 29: Lecturer: Dr Igor Khovanov Office: D207 i.khovanov@warwick.ac.uk Syllabus: Biomedical Signal Processing. Examples of signals. Linear System Analysis. Laplace.

29

Fourier transform. Effects of a finite-duration of signal. Edge effect

Consider a harmonic signal, y(t), of a finite duration, T.( ) sin( )x t t { ( )} { ( )} { ( )}y t x t v t F F F

1, / 2( )

0, / 2

t Tv t

t T

( ) ( ) ( )y t x t v t

1{ ( )} ( ) ( )

2y t X V d

F

The product (multiplication) in the time domain corresponds to the convolution in the frequency domain and vice versa.

( ) sin( )x t a t

( )v t

( ) ( ) ( )y t x t v t

( )X ( )V sin ( ) / 2 sin ( ) / 2

( )2 ( ) / 2 ( ) / 2

T TjTY

T T

( ) sinc ( ) / 2 sinc ( ) / 22

jTY T T

The discrete spectrum is transformed to a continuous one