Presentation is loading. Please wait.

Presentation is loading. Please wait.

Last week…. Fourier Analysis Re-writing a signal as a sum of sines and cosines.

Similar presentations


Presentation on theme: "Last week…. Fourier Analysis Re-writing a signal as a sum of sines and cosines."— Presentation transcript:

1 Last week…. Fourier Analysis Re-writing a signal as a sum of sines and cosines.

2 Linear Time-invariant Systems This week…. Convolution Cross-correlation

3 Our mantra: shift …. and … compare

4 functions xf y InputfunctionOutput Write: y = f(x) systems x(t)y(t) InputSystemOutput Write: y(t) = T[x(t)] T

5 Linear Time-invariant Systems An LTI system must be …… LINEAR Scaling: T[ax (t)]=aT[x (t)] Superposition: T[x 1 (t)+x 2 (t)]=T[x 1 (t)]+T[x 2 (t)] TIME INVARIANT If y(t)=T[x(t)], then y(t-s) =T[x(t-s)] x(t)x(t) T y(t)y(t) InputLTI system Output y(t) = T[x(t)]

6 (Approximate) LTI systems in Neuroscience x(t)x(t) T y(t)y(t) InputLTI systemOutput Visual stimulus contrastOuter retinaRetinal ganglion cell firing rate Pre-synaptic action potentialsSynapsePost-synaptic conductance Visual stimulusEyeRetinal image Injected CurrentPassive neural membraneMembrane potential

7 If I know the response of the system to the impulse (delta) function, then I can predict the response of the system to any input. The Impulse function: The Impulse response: T t  (t) t h(t) What makes them so useful?

8 How do we get from the impulse response to the response to an arbitrary input? By convolving any input with the impulse response, we can predict the output of the system. Shorthand: The overlap of 2 functions after 1 is reversed & shifted. What’s convolution? outputinputimpulse response

9 The overlap of 2 functions after 1 is reversed & shifted.  h(  )  x(  ) t y(t) sum of the product

10  h(-  )  x(  ) t y(t) The overlap of 2 functions after 1 is reversed & shifted. sum of the product

11  h(t-  ), t=0  x(  ) t y(t) The overlap of 2 functions after 1 is reversed & shifted. sum of the product

12  h(t-  ), t=1  x(  ) t y(t) The overlap of 2 functions after 1 is reversed & shifted. sum of the product

13  h(t-  ),t=2  x(  ) t y(t) The overlap of 2 functions after 1 is reversed & shifted. sum of the product

14  h(t-  ),t=5  x(  ) t y(t) The overlap of 2 functions after 1 is reversed & shifted. sum of the product  : calculate overlap t: time-shift x and h

15 Example convolutions http://mathworld.wolfram.com/Convolution.html The sum of the product of 2 functions after 1 is reversed & shifted. Convolution of two rectangles

16 Example convolutions http://mathworld.wolfram.com/Convolution.html The sum of the product of 2 functions after 1 is reversed & shifted. Convolution of two gaussians

17 And why did we care about convolution again? It brings you closer to nirvana??? It strengthens you mind and body??? It helps guys pick up girls ??

18 And why did we care about convolution again? It describes the behavior of an LTI system. The output is the convolution of the input with the impulse response. x(t)x(t) T y(t)y(t) InputLTI systemOutput Why is an LTI system’s output the convolution of the input and the impulse response?

19 Convolving with  (t) IDENTITY What if the peak were shifted by a few samples?  (t-  )=1 if  = t  (t-  )=0 if  ≠ t Impulse function :  (t)

20 Why is an LTI system’s output the convolution of the input and the impulse response? T T T T Time invariance Scaling Superposition

21 Example LTI operations and their Impulse Responses MULTIPLICATION h(t) h(t -  )=1.5 if  =t h(t -  )=0 if  ≠t

22 Example LTI operations and their Impulse Responses DIFFERENTIATION h(t-  )=1 when  =t h(t-  ) =-1 when  =t-1 h(t-  ) =0 for all other  h(t)

23 Example LTI operations and their Impulse Responses SUMMATION (INTEGRATION) h(t-  )=1 when  <t h(t-  )=0 when  >t h(t)

24 What we’ve learned so far x(t)x(t) T y(t)y(t) InputLTI system Output An LTI system convolves an input with its impulse response to arrive at an output. Through convolution we can predict the response of an LTI system to any input. Common operations like differentiation and integration are LTI.

25 What does all this have to do with Fourier analysis? LTI systems alter the frequency content of an input (“filter”). The complex exponentials are eigenfunctions of LTI systems (put a complex exponential in, get a complex exponential out) e i  t T InputLTI system Output

26 If y(t)=x(t)*h(t) (time domain), then Y(  )=X(  )H(  ) (frequency domain) i.e., convolution in the time domain = multiplication in the frequency domain The Convolution Theorem Transfer function Impulse response, Filter, Kernel

27 LTI systems as filters Impulse response Amplitude Frequency response High Pass Filter Low Pass Filter (Transfer Function) Magnitude (dB) time frequency

28

29 What we’ve learned so far x(t)x(t) T y(t)y(t) InputLTI system Output An LTI system convolves an input with its impulse response to arrive at an output. In the frequency domain, this is the same as multiplication of the input with its transfer function. Time for applications ….

30 Using convolution to reconstruct spike trains based on calcium Yaksi E. Friedrich RW. Nature Methods. 3(5):377- 383, 2006 May.

31 Using convolution to reconstruct spike trains based on calcium Impulse response = kernel Calcium response to an “ impulse ” of injected current

32 Using convolution to reconstruct spike trains based on calcium

33 Predicted + Measured Firing rate

34 Linear/Nonlinear (LN) Models

35 Many neural responses are not actually LTI. Therefore, people often use LN models to predict the response of a neuron to a stimulus. –First, convolve input with a filter that describes the “linear” part of the neuron’s response (e.g., the receptive field). –Then, run output through a non-linear function.

36 Linear/Nonlinear (LN) Models y(t) = g( s(t)*h(t) ) Spiking threshold Maximal firing rate Stimulus Response (firing rate) Receptive Field

37 Cross-correlation The amount of overlap between f and g, as f is shifted over g. Convolution Cross-correlation

38 Convolution vs Cross-correlation Mathematically, very similar operations: –Convolution: One of the functions is time reversed. –Cross-correlation: No time reversal. They have very different applications: – Convolution: Predicting the response of a system to an input. – Cross-correlation: Measuring the similarity of 2 functions for different time delays.

39 The Cross-correlation Theorem

40 If y(t)=f(t)  g(t) (time domain), then Y(  )=F(  )G(  ) (frequency domain) The Cross-correlation Theorem i.e., cross-correlation in the time domain = multiplication (by the complex conjugate) in the frequency domain

41 Cross-correlation of spike trains Neuron 2 spike train: 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 Neuron 1 spike train: 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 time x 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 ∑ = 2

42 Cross-correlation of spike trains 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 t=0, 2 t=1, 1 t=2, 0 t=3, 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 t=-1, 5 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 t =-2, 1 Time delay Xcorr -2 -1 0 1 2 3 Time delay Xcorr

43 From Donoghue lab tutorials Cross-correlograms of spike trains: Inferring Connectivity What would the cross-correlogram look like for these connectivities?

44 Cross-correlograms of spike trains: Inferring Connectivity From Donoghue lab tutorials

45 Reverse Correlation, aka Spike-Triggered Averaging Cross-correlation of spike train and stimulus. Automated characterization of a neuron’s receptive field using white noise stimuli.

46 Reverse Correlation, aka Spike-Triggered Averaging Mathematically, equivalent to calculating the average stimulus waveform preceding a spike. On average, what stimulus causes this cell to fire?

47 What is the Autocorrelation? Increasing size of auto part Decreasing size of man part

48 What about Autocorrelation? It’s the cross-correlation of a function with itself. How well does a function match a time- shifted version of itself?

49 What about Autocorrelation? Used to identify repeating patterns in a signal. For example, the presence of a periodic signal corrupted with noise. Fourier transform of the autocorrelation is the power spectrum! Why? Correlation theorem.

50 Autocorrelation & Power spectra: characterizing thalamocortical oscillations Jacobsen, R.J., Ulrich, D. and Huguenard, J.R. (2001). J. Neurophys. 86:1365-1375.J. Neurophys. 86:1365-1375 Power spectrum Time course Auto- correlation

51 Where we’ve been Linear, time-invariant systems allow you to predict the response to any input using convolution. Cross-correlation tells you how similar two functions are at different relative shifts. Next week: Probability and statistics!!

52

53 Selecting Spatial Frequencies high spatial frequencies low spatial frequencies

54 f*gf*g


Download ppt "Last week…. Fourier Analysis Re-writing a signal as a sum of sines and cosines."

Similar presentations


Ads by Google