26
Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center [email protected] .in M.Tech. (CS), Semester III, Course B50

Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center [email protected] M.Tech

Embed Size (px)

Citation preview

Page 1: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Functional Brain Signal Processing: EEG & fMRI

Lesson 3

Kaushik Majumdar

Indian Statistical Institute Bangalore Center

[email protected]

M.Tech. (CS), Semester III, Course B50

Page 2: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Impulse Response Filtering

Original signal Impulse response

ConvolutionFiltered signal

This is in time domain, but filters are frequency specific and therefore should be specified in the frequency domain.

(1)

Page 3: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Fourier Transform

( ( )) ( ) exp( 2 )F x t x t j nt dt

n takes integer values.

Let x(t) be a periodic signal and square integral of x(t) over the whole real line converges. Then x(t) can be expressed as

( ) cos(2 ) sin(2 )n nn

x t a nt b nt

where

( ) cos(2 ) , ( )sin(2 )n na x t nt dt b x t nt dt

Page 4: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Signal Decomposition into Simpler Orthonormal Components

exp(j2πt)

exp(j4πt)

exp(j6πt)

Real EEG signal

Signal will have to be stationary and square integrable.

Component drawings are not authentic

Page 5: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Generalization to Laplace Transform

( ( )) ( ) exp( )L x t x t st dt

Where s is a complex number

Discrete Laplace transform = Z transform

( ( )) ( ) exp( ) ( ) md

m m

L x m x m sm x m z

where1exp( )s z

Page 6: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Convolution under Z Transform

(1) under z transform will become (just like Fourier transform):

Y, S, Z are z transform for y, s, z respectively. Designing a filter is all about finding a suitable h(i) and therefore finding a suitable H(z). Latter is mathematically more convenient.

Page 7: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Inverse Z Transform

h(i) can be recovered from H(z) by inverse z transform

C is a closed curve lying within the convergence of H(z)

Page 8: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

H() in a Low Pass Filter

Put z = F in H(z), where F is normalized frequency.

Parks and McClelland, 1972

Page 9: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Frequency and Magnitude Response

Majumdar, 2013

Page 10: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Finite Impulse Response (FIR) Filter

h(k) is filter coefficient or tap, N is filter order.

Amplitude response |H(w)| of a 17 tap FIR filter (thick line) has been plotted against the circular frequency w.

Rao and Gejji, 2010

Page 11: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Filter with Real Coefficients

For N odd H(0) will have to be real and

For N even H(0) will have to be real and

(2)

(3)

Page 12: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Filter Coefficients (cont.)

If condition (2) holds then (4) becomes(4)

If condition (3) holds then (4) becomes

Page 13: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

An Implementation

Design a 17 tap linear phase low pass filter with a cutoff frequency .

Rao and Gejji, 2010

Page 14: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Implementation (cont.)

Pass band

Stop band

Page 15: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Implementation (cont.)

Phase response of the 17 tap FIR filter with respect to circular frequency.

Page 16: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Implementation (cont.)

Page 17: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Implementation (cont.)

Getting back the h(n)s by applying iDFT on H(k)s

Page 18: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Implementation (cont.)

Page 19: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Infinite Impulse Response (IIR) Filters for EEG Processing

Page 20: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Butterworth Filter

Page 21: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Butterworth Filter: Amplitude Response

Page 22: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Butterworth Filter (cont.)

Page 23: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Butterworth Filter (cont.)

Page 24: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

References

Proakis and Manolakis, Digital signal processing: principles, algorithms and applications, 4e, Dorling Kindersley India Pvt. Ltd., 2007. Section 5.4.2 and Chapter 10.

Majumdar, A brief survey of quantitative EEG analysis (under preparation), Chapter 2, 2013.

Rao and Gejji, Digital signal processing: theory and lab practice, 2e, Pearson, New Delhi 2010.

Page 25: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

Exercise

Design low-pass, high-pass and band-pass filters by using Filter Design toolbox in MATLAB.

Learn how to correct phase distortion by the filtfilt command in MATLAB.

Page 26: Functional Brain Signal Processing: EEG & fMRI Lesson 3 Kaushik Majumdar Indian Statistical Institute Bangalore Center kmajumdar@isibang.ac.in M.Tech

THANK YOU

This lecture is available at http://www.isibang.ac.in/~kaushik