CCNY. BME I5100: Biomedical Signal Processing. Stochastic Processes. Lucas C. Parra Biomedical Engineering Department City College of New York

Similar documents
BME 50500: Image and Signal Processing in Biomedicine. Lecture 5: Correlation and Power-Spectrum CCNY

Parametric Signal Modeling and Linear Prediction Theory 1. Discrete-time Stochastic Processes (cont d)

Time Series: Theory and Methods

Parametric Signal Modeling and Linear Prediction Theory 1. Discrete-time Stochastic Processes

Lesson 1. Optimal signalbehandling LTH. September Statistical Digital Signal Processing and Modeling, Hayes, M:

Statistical and Adaptive Signal Processing

Linear Stochastic Models. Special Types of Random Processes: AR, MA, and ARMA. Digital Signal Processing

Nonparametric and Parametric Defined This text distinguishes between systems and the sequences (processes) that result when a WN input is applied

1. Determine if each of the following are valid autocorrelation matrices of WSS processes. (Correlation Matrix),R c =

Course content (will be adapted to the background knowledge of the class):

CONTENTS NOTATIONAL CONVENTIONS GLOSSARY OF KEY SYMBOLS 1 INTRODUCTION 1

Advanced Digital Signal Processing -Introduction

ECE 636: Systems identification

Probability Space. J. McNames Portland State University ECE 538/638 Stochastic Signals Ver

Lecture 4 - Spectral Estimation

EEG- Signal Processing

ADSP ADSP ADSP ADSP. Advanced Digital Signal Processing (18-792) Spring Fall Semester, Department of Electrical and Computer Engineering

Practical Spectral Estimation

P 1.5 X 4.5 / X 2 and (iii) The smallest value of n for

Chapter 6: Random Processes 1

National Sun Yat-Sen University CSE Course: Information Theory. Maximum Entropy and Spectral Estimation

CCNY. BME I5100: Biomedical Signal Processing. Linear systems, Fourier and z-transform

Name of the Student: Problems on Discrete & Continuous R.Vs

ECE534, Spring 2018: Solutions for Problem Set #5

13. Power Spectrum. For a deterministic signal x(t), the spectrum is well defined: If represents its Fourier transform, i.e., if.

Name of the Student: Problems on Discrete & Continuous R.Vs

ELEG 3143 Probability & Stochastic Process Ch. 6 Stochastic Process

Stochastic Processes

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

Laboratory Project 2: Spectral Analysis and Optimal Filtering

Time Series Analysis. James D. Hamilton PRINCETON UNIVERSITY PRESS PRINCETON, NEW JERSEY

BME I5000: Biomedical Imaging

Linear Prediction 1 / 41

IV. Covariance Analysis

3. ESTIMATION OF SIGNALS USING A LEAST SQUARES TECHNIQUE

CHAPTER 2 RANDOM PROCESSES IN DISCRETE TIME

Complement on Digital Spectral Analysis and Optimal Filtering: Theory and Exercises

Parametric Signal Modeling and Linear Prediction Theory 1. Discrete-time Stochastic Processes

Time Series Examples Sheet

Chapter 6. Random Processes

covariance function, 174 probability structure of; Yule-Walker equations, 174 Moving average process, fluctuations, 5-6, 175 probability structure of

Probability and Statistics

Introduction to Signal Processing

Contents. Digital Signal Processing, Part II: Power Spectrum Estimation

Problems on Discrete & Continuous R.Vs

BME 50500: Image and Signal Processing in Biomedicine. Lecture 2: Discrete Fourier Transform CCNY

ENSC327 Communications Systems 19: Random Processes. Jie Liang School of Engineering Science Simon Fraser University

Some Time-Series Models

Lessons in Estimation Theory for Signal Processing, Communications, and Control

EE482: Digital Signal Processing Applications

for valid PSD. PART B (Answer all five units, 5 X 10 = 50 Marks) UNIT I

(a)

Part III Spectrum Estimation

Chapter 9. Linear Predictive Analysis of Speech Signals 语音信号的线性预测分析

Time Series 2. Robert Almgren. Sept. 21, 2009

Complement on Digital Spectral Analysis and Optimal Filtering: Theory and Exercises

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science : Discrete-Time Signal Processing

HST.582J / 6.555J / J Biomedical Signal and Image Processing Spring 2007

INTRODUCTION Noise is present in many situations of daily life for ex: Microphones will record noise and speech. Goal: Reconstruct original signal Wie

EE482: Digital Signal Processing Applications

Timbral, Scale, Pitch modifications

Elements of Multivariate Time Series Analysis

Continuous Fourier transform of a Gaussian Function

Review of Probability

Chapter 2 Wiener Filtering

The goal of the Wiener filter is to filter out noise that has corrupted a signal. It is based on a statistical approach.

EEM 409. Random Signals. Problem Set-2: (Power Spectral Density, LTI Systems with Random Inputs) Problem 1: Problem 2:

Probability and Statistics for Final Year Engineering Students

Least Square Es?ma?on, Filtering, and Predic?on: ECE 5/639 Sta?s?cal Signal Processing II: Linear Es?ma?on

Lecture - 30 Stationary Processes

Stochastic Processes. M. Sami Fadali Professor of Electrical Engineering University of Nevada, Reno

Marcel Dettling. Applied Time Series Analysis SS 2013 Week 05. ETH Zürich, March 18, Institute for Data Analysis and Process Design

26. Filtering. ECE 830, Spring 2014

Random signals II. ÚPGM FIT VUT Brno,

Feature extraction 2

BLIND DECONVOLUTION ALGORITHMS FOR MIMO-FIR SYSTEMS DRIVEN BY FOURTH-ORDER COLORED SIGNALS

Discrete time processes

Adaptive Filter Theory

Communication Theory II

New Introduction to Multiple Time Series Analysis

STOCHASTIC PROBABILITY THEORY PROCESSES. Universities Press. Y Mallikarjuna Reddy EDITION

Biomedical Signal Processing and Signal Modeling

EE 602 TERM PAPER PRESENTATION Richa Tripathi Mounika Boppudi FOURIER SERIES BASED MODEL FOR STATISTICAL SIGNAL PROCESSING - CHONG YUNG CHI

2. (a) What is gaussian random variable? Develop an equation for guassian distribution

Parametric Signal Modeling and Linear Prediction Theory 4. The Levinson-Durbin Recursion

Statistical signal processing

Parametric Method Based PSD Estimation using Gaussian Window

Stochastic Processes. A stochastic process is a function of two variables:

TAKEHOME FINAL EXAM e iω e 2iω e iω e 2iω

5: MULTIVARATE STATIONARY PROCESSES

Moving Average (MA) representations

ADAPTIVE FILTER THEORY

UCSD ECE250 Handout #27 Prof. Young-Han Kim Friday, June 8, Practice Final Examination (Winter 2017)

6.3 Forecasting ARMA processes

Lecture 1: Fundamental concepts in Time Series Analysis (part 2)

6. Methods for Rational Spectra It is assumed that signals have rational spectra m k= m

Linear Convolution Using FFT

Frequency Based Fatigue

Lecture 3: Autoregressive Moving Average (ARMA) Models and their Practical Applications

Question Paper Code : AEC11T03

Transcription:

BME I5100: Biomedical Signal Processing Stochastic Processes Lucas C. Parra Biomedical Engineering Department CCNY 1

Schedule Week 1: Introduction Linear, stationary, normal - the stuff biology is not made of. Week 1-5: Linear systems Impulse response Moving Average and Auto Regressive filters Convolution Discrete Fourier transform and z-transform Sampling Week 6-7: Analog signal processing Operational amplifier Analog filtering Week 8-11: Random variables and stochastic processes Random variables Moments and Cumulants Multivariate distributions, Principal Components Stochastic processes, linear prediction, AR modeling Week 12-14: Examples of biomedical signal processing Harmonic analysis - estimation circadian rhythm and speech Linear discrimination - detection of evoked responses in EEG/MEG Hidden Markov Models and Kalman Filter- identification and filtering 2

Stochastic Processes A stochastic process is a random quantity that changes over time. More specifically it is a set of random variables sorted in time X[t]. Sampling a random process repeatedly gives and ensemble: x1[t] S e2 e3 e1 x2[t] x3[t] Examples: Spike train, position of a particle moving randomly, number of bacteria in a culture, thermal noise in an amplifier, etc. 3

Stochastic Process - Poisson Process Poisson process arises when we count the number of occurrences N(t) of independent random events where the likelihood of occurrence of an event is proportional to the time interval Δt. Pr (N (t +Δ t ) N (t )=1)=νΔ t One can proof by induction that the count follows a Poisson distribution with =νt k νt (νt ) e Pr (N (t )=k )= k! Interesting is the first induction step. For k=0 using definition and limes Δt 0 it is easy to see that ν t Pr (N (t )=0)=e Which means that the ISI is exponentially distributed. 4

Stochastic Process - Shot Noise Shot noise we call Poisson process with events at times ti convolved with a IR. N N i=1 i=1 X (t)= h(t)δ(t t i )= h (t t i) The expected value of X(t) is E[ X (t)]=ν(t) h(u)du Event or spike rate ν can be estimated by convolving a spike train with a sufficiently long IR. This in effect is what neurons do, where the IR is given by the post-synaptic potential (PSP). Sometimes (titi1)1 is considered "instantaneous" spike rate ν (t). 5

Stochastic Process - Gaussian Process A stochastic process x(t) is said to be a Gaussian process if x=[x(t1),x(t2),...,x(tn)]t are jointly Gaussian distributed 1 [ 1 T 1 p(x)= exp (x ) (x ) n 2 (2 π) ] In general the covariance matrix and mean depend on the time instances t1, t2,..., tn. Classic example is Brownian motion with r ij =B min(t i,t j) 6

Stochastic Process - Wide Sense Stationary If p(x(t1),x(t2),...,x(tn)) does not depend on times t1, t2,..., tn the process is called stationary. Any stochastic process for which the mean and covariance are independent of time is called Wide Sense Stationary (WSS). A WSS process is called ergodic if the sample average converges to the ensemble average. With samples x[k] = x(tk) this reads: N 1 E[ f (x (t))]= lim f (x [k ]) N N k=1 7

Stochastic Process -Auto-correlation If we have equal distant samples, x[k] = x(kt), the second moments correspond to the auto-correlation r x [k, l]=e[ x[k] x [l]] For WSS stochastic processes: The mean is independent of time mx =E [ x[k]] The Auto-correlation r x [k ]=E [x [n+k ] x [n ]] depends only on time differences it is symmetric, the zero lag is the power upper bounded by the power r x [k, l]=r x [k l] x r x [k]=r [ k] 2 r x [0 ]=E [ x [k ] ] r x [0] r x [k] 8

Stochastic Process - Auto-correlation Assuming ergodic WSS a direct estimate of the autocorrelation is the (unbiased) sample auto-correlation N k 1 r x [k ]= x [l+k ] x [l] N k l=1 N k x* x Note that correlation is convolution with opposite sign. It can be computed fast with the FFT. Use xcorr() 9

Stochastic Process - Auto-correlation Examples 10

Stochastic Process -Auto-correlation For WSS the auto-correlation matrix becomes Hermitian Toeplitz R [ r x (0) r x (1) r x ( p 1) r x ( p 2) r x (0) r x (2) r x (1) r x (0) r x (1) r x (0) xx = r x (2) r x (1) r x ( p) r x ( p+1) r x ( p+2) r x (p) ] Important WSS process is (Gaussian) uncorrelated noise 2 Rxx=σ I m x=0 >> randn() 11

Stochastic Process - Power spectrum Oscillations of the correlation are best analyzed in the frequency domain, which leads to the Power Spectrum Px (e )= r x [k]e jk k= One can show that Px(e) is real, even and positive. The auto-correlation can be recovered with the inverse Fourier transform π 1 j jk r x [k]= d P x (e )e 2π π 12

Stochastic Process - Power spectrum In particular, the total power is given by π 2 x x π the power spectrum is sometimes called spectral density because it is positive and the signal power can always be normalized to r(0) =(2π)-1. 1 r [0]=E [ x[k] ]= d P (e ) 2π Example: Uncorrelated noise has a constant power spectrum 2 r[k ]=E[ x [n+k ] x [n]]=σ δ (k ) Px (e )= σ δ (k)e 2 jk =σ 2 k= Hence it is also called white noise. 13

Stochastic Process - Power spectrum The power spectrum captures the spectral content of the random sequence. It can be estimate directly from the Fourier transform of the data: Px (e j )= 1 X (e j ) 2 N N 1 X (e )= x [k ] e j k k=0 This estimate improves in the mean with increasing N. Px (e )= lim E[ P x (e )] N Remember that when estimating auto-correlation and power spectrum we implicitly assume WSS processes! 14

Stochastic Process - Power spectrum Unfortunately, the direct estimate is inconsistent, i.e. its variance does not converge to 0 for increasing N. A classic heuristic, called the periodogram, is to smooth neighboring frequencies: Compute Fourier transform for window of size N/K and average over K windows. 15

Stochastic Process - Periodogram Examples: >> psd(x); Note 1/f spectrum, noise for small N. 16

Stochastic Process - Filtering The effect of filtering on the statistics of a stochastic process: y[n]= h[k] x[n k] k= x[n] y[n] h[k] Filtering corresponds to convolution of the autocorrelation r y [k ]= l= m= h [l]r x [m l+k ]h (m) =r x [k ]h[k ]h [ k ] rx[n] h[k] ryx[k] h [-k] * ry[n] 17

Stochastic Process - Filtering With the convolution theorem of the Fourier transform we find for the power spectrum P y (e )=P x (e )H (e ) H (e Px(e) H(e ) Px(e) Pyx(e ) H(e) 2 2 )=P x (e ) H (e ) Py(e) H*(e) H(e) 2Px(e) Or in the z-domain P y (z)=p x ( z) H (z) H (1 /z ) 18

Stochastic Process - Filtering Filtering shapes the power spectrum abs(fft(h,n)).^2 19

Stochastic Process - Spectral Content "The power spectrum gives the spectral content of the data." To see that consider the power of a signal after filtering with a narrow bandpass filter around 0. π 1 2 E[ y[n] ]= d H (e ) P x (e ) 2 π π 2 0+ Δ / 2 H(e) Δ 1 = d P x (e ) 2 π Δ / 2 Δ Px (e ) 2π 0 0 0 π 20

Stochastic Process - Regular process Colored noise process x[n] is filtered white noise v[n] v[n] x[n] h[n] Pv(e) =σv2 Px(e)=σv2 H(e) 2 H(e) 2 If h[n] is causal and invertible, x[n] is called a regular process and v[n] the corresponding innovation process with power σv2. Its power spectrum is continuous and given by 2 v 2 Px (e )=σ H (e ) The inverse filter 1/H(z) is called the whitening filter of x[n]. x[n] 1/H(z) v[n] 21

Stochastic Process - Predictive process A process x[n] is called predictive or singular if it can be predicted exactly from a linear combination of its past: x[n]= a[k] x[n k] k=1 Examples are sinusoids or sums thereof: x [n]= A k e i n k +ϕk k=1 The spectrum of a predictive process has only discrete lines: Px (e )= α k δ( k ) k=1 22

Stochastic Process - Wold decomposition The Wold decomposition theorem tells us that any WSS process x[n] can be decomposed into a sum of a regular process xr[n] and predictive process xp[n]: x[n]=x p [n]+ xr [n] where the processes are orthogonal: r E[ x p [n] x [m]]=0 Hence the spectrum of any WSS is composed of a continuous component with invertible H(z) plus discrete lines: Px (e )= H (e ) + α k δ( k ) 2 k=1 23

Stochastic Process - Wold decomposition Note that for orthogonal processes the power spectrum is additive. If z[n]=x [n]+ y [n] with E[ x [n] y [m]]=0 Then Pz (e )=Px (e )+P y (e ) 24

Stochastic Process -Spectrogram Spectrogram: Power spectrum with strong spectral component can be estimate on short sequences, and hence, followed as it develops over time. Example: Speech >> specgram(x); Note harmonic components Assumption: WSS within each small window 25

Stochastic Process - ARMA process An important regular process is the ARMA process: white noise v[n] filtered with a rational transfer function B(z ) H (z )= A (z) v[n] b[k] h[k] x[n] a[k] Example: 2 1+0.9025 z H (z )= 1 2 1 0.5562 z +0.81 z 26

Stochastic Process - ARMA modeling ARMA modeling means to find a[k], and b[k] that approximate an observed Px(e) for a given x[n] 2 B(e ) Px (e )= 2 A (e ) v[n] b[k] h[k] x[n] a[k] P Q l=1 l=0 x [n]= a[l]x [n l]+ b [l] v [n l] Note that now the input is not given. Instead only statistical assumptions on the input are know (white WSS process). 27

Stochastic Process - ARMA modeling We derive now statistical conditions for a[k] and b[k]. Multiply the difference equation by x*[n -k] and take the expectation: P Q l=0 l=0 a[l]r x [k l]= b[l]r vx [k l] with cross-correlation: Using r vx [k l]=e[v [n l] x [n k ]] x [n]=h[n]v [n] E[ v [n ]v [m]]=δ(n m) we obtain (non-linear) conditions for a[k] and b[k] P Q a[l]r x [k l]= b[l]h [l k ] l=0 l=0 28

Stochastic Process - ARMA modeling These conditions are called the Yule-Walker equations P Q k a[l]r x [k l]= b [l+k ]h l=0 [l] c [k ] l=0 In matrix form and using Hermitian symmetry of the autocorrelation we can write for lags 0...L: [ ] ] r x [0] r x [1] r x [2] r x [P] c [0] r x [1] r x [0] r x [1] r x [P 1] 1 c [1] a[1] r x [Q] r x [Q 1] r x [Q 2] r x [Q P ] a[2] = c [Q] 0 r x [Q+1] r x [Q] r x [Q 1] r x [Q P+1] a [P] 0 r x [ L] r x [L 1] r x [ L 2] r x [L P ] [ ][ Since c[k] depend on h[k] these equations are non-linear in a[k] and b[k]. They simplify for Q=0, i.e. AR model only. 29

Stochastic Process - AR modeling For Q=0 the Yule-Walker equations simplify to P a[l]r x [k l]= b[0] δ(k ) 2 l=0 In matrix form and using Hermitian symmetry of the autocorrelation we obtain the AR normal equations: [ r x [0 ] r x [1] r x [2] r x [ P] ][ ] [ ] 2 1 b[0] r x [1] r x [0] r x [1] r x [P 1] a [1] 0 r x [2] r x [1] r x [0] r x [P 2] a [2] = 0 0 r x [ P] r x [ P 1 ] r x [P 2] r x [0] a[ P] Which are a set of linear equations for the unknown a[k]. 30

Stochastic Process - AR modeling The AR normal equations can be rewritten as: [ ][ ] [ ] r x [P 1] a [1] r x [1] r x [1] r x [0] r x [P 2] a [2] = r x [2] r x [P] r x [ P 1] r x [P 2] r x [0] a[ P] r x [0] r x [1] Rxx a= r x Linear equations with Toeplitz Hermitian form can be solved efficiently with the Levinson-Durbin recursion. Computes the auto-correlations and solves this linear equation: >> a = lpc(x,p); 31

Stochastic Process - Linear prediction The goal of linear prediction is to predict sample x[n] from its past P samples: P x [n]= a[k ] x [n k ] k=1 And a[k] are called the linear prediction coefficients (LPC). The prediction error is given by e [n]=x [n] x [n] The LPC that minimize the expected error 2 a=argmin E [ e [n ] ] satisfy the same linear equations as the AR model parameters: P a[l]r x [k l]=ϵ δ(k ) 2 ϵ=e[ e [n] ] l=0 which we obtain by taking derivatives with respect to a*[k]. 32

Stochastic Process - LPC and Wold Decomp. In matlab all this is done with: >> [a,e] = lpc(x,p); >> b = sqrt(e); The error process e[n] represents the "new" or "innovative" part over the linear prediction, hence the name innovation process. One can show that the innovation in linear prediction is white and uncorrelated to the prediction, E[e [n]e [m]]=δ(n m) E[e [n] x [m]]=0 33

Stochastic Process - AR and LPC Assignment 9: Pick either speech or heart rate >> load hrs.mat; x=hrs; >> [x,fs]=audioread('speech.wav');x=x(5501:6012); Generate an AR model by solving normal equations. Plot an estimated power spectrum together with the AR model spectrum. Show the innovation process and its power spectrum. Compute the LPC coefficient using lpc(x,p) Compare your AR results with LPC. Show the linear prediction estimation error. Compute the signal to noise ratio (SNR) of your LPC model: n x [n ] SNR= 2 n e [n] 2 Show SNR in db as a function of model order P. 34