Linear Systems Theory Fourier Analysis Linear Systems Analysis
Total Page:16
File Type:pdf, Size:1020Kb
Linear Systems Theory Fourier Analysis • Introduction – Receptive fields and Signals as sums of sine waves mechanisms • 1-d: time series • Fourier Analysis – Signals as sums of sine – fMRI signal from a voxel or ROI waves – mean firing rate of a neuron over time • Linear, shift-invariant systems – auditory stimuli – Definition • 2-d: static visual image, neural image – Applied to impulses, sums of impulses • 3-d: visual motion analysis – Applied to sine waves, sums of sine waves • Applications • 4-d: raw fMRI data Linear Systems Analysis Spatial Vision Systems with signals as input and output • Image representation or coding – At each stage, what information is kept and • 1-d: low- and high-pass filters in electronic what is lost? equipment, fMRI data analysis, or in sound • Image analysis production (articulators) or audition (the ear as a filter) • Nonlinear: pattern recognition • 2-d: optical blur, spatial receptive field • 3-d: spatio-temporal receptive field Receptive Field Receptive Field A spatial receptive field is an image • In any modality: that region of the sensory apparatus that, when stimulated, can directly affect the firing rate of a given neuron • Spatial vision: spatial receptive field can be mapped in visual space or on the retina • Examples: LGN V1 with its own Fourier transform. Neural Image Neural Image of a Sine Wave For a linear, shift-invariant system such as a linear model of A spatial receptive field may also be treated as a linear a receptive field, an input sine wave results in an identical system, by assuming a dense collection of neurons with the output sine wave, except for a possible lateral shift and same receptive field translated to different locations in the scaling of contrast. visual field: Frequency Response Frequency Response This scaling of contrast by a linear receptive field in the This scaling of contrast by a linear receptive field in the neural image is a function of spatial frequency determined neural image is a function of spatial frequency determined by the shape of the receptive field. by the shape of the receptive field. Contrast Gain Contrast Gain Spatial Frequency Spatial Frequency Orientation Tuning Application Preview: SF Adaptation (Blakemore & Campbell, 1969) If a receptive field is not circularly symmetric, the scaling of contrast is also a function of orientation (for a given spatial frequency) determined by the shape of the receptive field. Contrast Gain Orientation Application Preview: SF Adaptation Summary: Linear Systems Theory (Blakemore & Campbell, 1969) • Signals can be represented as sums of sine waves • Linear, shift-invariant systems operate “independently” on each sine wave, and merely scale and shift them. • A simplified model of neurons in the visual system, the linear receptive field, results in a neural image that is linear and shift-invariant. • Psychophysical models of the visual system might be built of such mechanisms. • It is therefore important to understand visual stimuli in terms of their spatial frequency content. • The same tools can be applied to other modalities (e.g., audition) and other signals (EEG, MRI, MEG, etc.). Auditory example: Pure tones Frequency and amplitude weak 100 Hz strong 100 Hz weak 1000 Hz strong 1000 Hz Time 1/100 s Sound pressure level Pure tones can be described by 3 numbers: Frequency = rate of air pressure modulation (related to pitch) Amplitude = sound pressure level (related to loudness) Phase = sin vs. cosine vs. another horizontal shift Fourier components of a square wave Fourier components of a square wave Ampl. Freq. 1 100 Square wave -1.3 1/3 300 ‘f’ + ‘3f’/3 0 +.4 +0 1/5 500 ‘f’ + ‘3f’/3+’5f’/5 +0 -.2 1/7 700 ‘f’ + ‘3f’/3+’5f’/5+’7f’/7 =0 Prev Next = -1.1 Fourier Synthesis – Building Stimuli from Sine Waves Fourier spectrum representation of sound SPL Amplitude 0 10 20 30 0 100 200 300 Time (ms) Frequency (Hz) Fourier spectra of some sounds Fundamental frequency and harmonics Pure tone White noise Amplitude Violin note 100 1000 10,000 Frequency (Hz) Standing waves in Flute (open pipe) harmonics a vibrating string Flute (open pipe) harmonics Other notes (shorten the pipe) Reinforcing a harmonic (forcing a “node”) Complex numbers and complex exponentials Discrete Fourier Transform z = a + bi = Aei! = A"cos! + i sin!$ where i [or j] = !1 # % real imaginary amplitude phase N%1 imaginary %i(2& /N)kn part part X "!k $# = ( x "!n$#e 0 ' k ' N % 1 n=0 where: b a = Acos! b = Asin! A N%1 ! = x !n# cos((2& / N)kn) + i sin((2& / N)kn) 2 2 1 ( " $( ) A a b tan" (b / a) a = + ! = real n=0 Why bother? k is frequency in cycles/image (or cycles/signal) and is computed i!1 i!2 i(!1+!2 ) effectively only for frequencies zero (DC), 1, 2, ..., N/2. The A1e A2e = A1A2e ( )( ) vector you get back from MATLAB (fft or fft2, inverses are ifft and ifft2), however, continues redundantly (for real signals, that is): amplitudes phases multiply add 0, 1, ..., N/2-1, N/2=0, N/2-1, ..., 1. DFT of a Sine Wave $ 2!kn ' 2!kn 2!kn cycles/scan Acos " # = Acos# cos + Asin# sin & N ) N N time points % ( The Fourier coefficient for this frequency of k cycles/signal is: 2!k / N a + bi = (Acos!) + (Asin!)i ( ! / 4 in this case) In other words, the amplitude is A and the phase is ! . frequency (cycles per scan) frequency (cycles per scan) ? frequency frequency Similarity Theorem If f (x) ! F(") 1 # " & then f (ax) ! F a $% a '( 0 8 16 24 32 -16 -8 0 8 16 If you stretch the x-axis, you shrink the frequency axis 0 8 16 24 32 -16 -8 0 8 16 time Circular shift f, 90 deg shift If x[n] X[k], then: 2f, 180 deg shift Properties of the DFT x[(n-m)N] exp(-j2! km/N) X[k] i.e., only phase (not magnitude) is affected = N-2 0 1 2 3 4 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 N-1 i.e., all cosine terms To generate a signal or image from a transform: i.e., all sine terms Other Properties of the Fourier Transform Linearity f g F G + ! + d cos2!"x d sin2!"x Derivative = #2!" sin2!"x, = 2!" cos2!"x x x df Hence: $ #i2!"F DTFT and DFS dx iF Integral f dx " ! 2#$ Discrete-Time Fourier Transform (DTFT) Two-dimensional Fourier transform Edge effects: vs. Homogeneity (scalar rule) Linear, Shift-Invariant Systems Neural activity fMRI response • Linearity: scalar rule and additivity • Applied to impulse, sums of impulses • Applied to sine waves, sums of sine waves Additivity Shift invariance Linear systems Shift invariance A system (or transform) converts (or maps) an input signal into an output signal: y(t) = T[x(t)] For a system to be shift-invariant (or time-invariant) means that a time-shifted version of the input yields a time-shifted version of the A linear system satisfies the following properties: output: y(t) = T[x(t)] 1) Homogeneity (scalar rule): T(a x(t)] = a y(t) y(t - s) = T[x(t - s)] 2) Additivity: The response y(t - s) is identical to the response y(t), except that it T(x1(t) + x2(t)] = y1(t) + y2(t) is shifted in time. Often, these two properties are written together and called superposition: T(a x1(t) + b x2(t)] = a y1(t) + b y2(t) Neural Image - Reprise Linear, Shift-Invariant Systems A spatial receptive field may also be treated as a linear • Linearity: Scalar rule and additivity system, by assuming a dense collection of neurons with the same receptive field translated to different locations in the • Applied to impulse, sums of impulses visual field. In this view, it is a linear, shift-invariant system. • Applied to sine waves, sums of sine waves Convolution as sum of impulse responses Convolution as sum of impulse responses Input: Input S(t): 1 2 3 4 5 6 7 8 9 1011121314 Impulse response I(t): $1I(t t 1): Impulse response: $2I(t t 2): $3I(t t 3): Output: $8I(t t 8): $9I(t t 9): $14I(t t 14): 14 3$i I(t ti): + i1 Convolution Convolution derivation Homogeneity: Discrete-time signal: x[n] = [x1, x2, x3, ...] T{a x[n]} = a T{x[n]} A system or transform maps an input signal into an output signal: Additivity: y[n] = T{x[n]} T{x [n] + x [n]} = T{x [n]} + T{x [n]} 1 2 1 2 A shift-invariant, linear system can always be expressed as a Superposition: convolution: T{a x [n] + b x [n]} = a T{x [n]} + b T{x [n]} 1 2 1 2 y[n] = 3 x[m] h[n-m] Shift-invariance: where h[n] is the impulse response. y[n] = T{x[n]} => y[n-m] = T{x[n-m]} Convolution derivation (contd.) Convolution derivation (cont) x[n]: input Impulse sequence: y[n] = T{x[n]}: output d[n] = 1 for n = 0, d[n] = 0 otherwise h[n] = T{d[n]}: impulse response Any sequence can be expressed as a sum of impulses: 1) Represent input as sum of impulses: x[n] = 3 x[m] d[n-m] y[n] = T{x[n]} y[n] = T{ x[m] d[n-m] } where 3 d[n-m] is impulse shifted to sample m 2) Use superposition: x[m] is the height of that impulse y[n] =3 x[m] T{d[n-m]} Example: 3) Use shift-invariance: = + + y[n] =3 x[m] h[n-m] Convolution as sum of impulse responses Convolution as correlation with the “receptive field” (time-reversed impulse Input S(t): 1 2 3 4 5 6 7 8 9 1011121314 response): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Input S(t): Impulse response I(t): RF 1(t): $1I(t t 1): RF 1(t)S(t): $2I(t t 2): RF 2(t): $3I(t t 3): RF 2(t)S(t): $8I(t t 8): RF 8(t): RF (t)S(t): $9I(t t 9): 8 RF 9(t): $14I(t t 14): RF (t)S(t): 14 9 3$i I(t ti): i1 F (t): Convolution as matrix multiplication Convolution as sequence of weighted sums Linear system <=> matrix multiplication Shift-invariant linear system <=> Toeplitz matrix past present future 0 0 0 1 0 0 0 0 0 input (impulse) 1 1/8 1/4 1/2 weights 2 5 1 2 3 0 0 0 0 0 0 0 1/2 1/4 1/8 0 0 0 output (impulse response) 2 = 0 1 2 3 0 0 0 -3 0 0 1 2 3 0 -1 0 0 0 1 2 3 2 4 0 0 0 1 1 1 1 1 1 input (step) 1/8 1/4 1/2 weights 0 0 0 1/2 3/4 7/8 7/8 7/8 7/8 output (step response) Columns contain shifted copies of the impulse response.