A Beginner’s Guide to Convolution and Deconvolution
David A Humphreys National Physical Laboratory ([email protected]) Signal Processing Seminar 21 June 2006 Overview
• Introduction • Pre-requisites • Convolution and correlation • Fourier transform deconvolution • Direct deconvolution • Summary Convolution
• Finite impulse response for a system • Convolution implies history/memory of the stimulus • Convolution implies Bandwidth
Time → Time →
Resultant Waveform Dirac Impulse Linear System response function δ(t) System h(t) Prerequisites
• System must be linear • f(a)+f(b)=f(a+b) • Superposition must apply
•Vout = Gain x Vin Linear system
•Vout = A x V1in x V2in Nonlinear system •Linearise
• Keep V2in constant Prerequisites
• System can be described as a waveform – impulse response • Waveform must be time invariant
• Shape of f(t) unchanged through translation f(t-t1) Convolution
Stimulus System response
2 2
Stimulus System response 1 1 l a n
gnal 0 g i S Si 135791113151719 0 1 3 5 7 9 1113151719 -1
-1 -2 Time Time
3 2.5
2.5 2 t9 t0 t1 2 t8 1.5 t7 t2 1.5 t3 t6 1 t5 t4
1 gnal gnal i t5
t4 S Si 0.5 0.5 t3 t6 t7 t2 0 0 t1 t8 135791113151719 t9 1 3 5 7 9 1113151719 t0 -0.5 -0.5
-1 -1 Time Time Convolution
Stimulus Result
2 3
Stimulus Result 2 1
1 gnal gnal Si Si 0 1 3 5 7 9 11 13 15 17 19 0 1 3 5 7 9 1113151719
-1 -1 Time Time Measured waveform
• Convolution of stimulus and system response
System Resultant Signal response waveform x(t) h(t) y(t)
Frequency domain Time domain +t y(t) = x(τ )h(t −τ )dτ Y (s) = H (s) X (s) ∫−∞ i yi = ∑ x jhi− j j=0 Convolution and Correlation
• Correlation – the direction of signal is reversed
Frequency domain Time domain Convolution
+t Y (s) = H (s) X (s) y(t) = x(τ )h(t −τ )dτ ∫−∞
Correlation
+t y(t) = x(τ )h(t +τ )dτ Y (s) = H (s) X (s) ∫−∞ Application areas
• Optics and Image capture • Waveform capture/processing • Electronic Engineering • Communications • Acoustics De-convolution Deconvolution
• Estimating the underlying signal from the smoothed result • Convolution with an inverse filter
• Convolution rules apply (Linearity, Superposition, Time invariance)
• ILL-POSED PROBLEM – may not have a perfect solution Applications
• Image analysis and correction • Instrument response correction • Waveform analysis • Oscilloscope risetime calibration • Transducer response calibration • Geological surveying • Echo cancelling/line frequency response correction (Modem/Broadband ADSL) Deconvolution of measured waveform
• Convolution of stimulus and system response • Deconvolution – correction for the system response
System Resultant Signal response waveform x(t) h(t) y(t)
Estimate for Deconvolve System Signal response x’(t) h-1(t)
h-1(t) is the inverse of the system response h(t) Deconvolution of measured waveform
• Convolution of stimulus and system response • Deconvolution – correction for the system response
System Resultant Signal response waveform x(t) h(t) y(t)
Estimate for Deconvolve Filter System Signal r(t) response x’(t) h-1(t)
h-1(t) is the inverse of the system response h(t) Deconvolution
Y ( jω) + noise X ( jω) = H ( jω)
• Inverse problem Deconvolved Voltage result • Ill-posed •Noise • System response errors Frequency Deconvolved Noise Deconvolution with filter
Y ( jω) + noise X ( jω) = R( jω) H ( jω) System response Filter R(jω) • Inverse problem • Ill-posed Deconvolved •Noise Voltage result • System response errors • Filter added to limit noise/errors Frequency Deconvolved Noise Realisation of Deconvolution process
A/D FIR Displayed x(t) Memory • System impulse response converter filter result • Direct time-domain convolution (Digital filtering - FIR) • Transform approach (e.g. Fourier transform)
50
40 H ( jω) 2
R( jω) = 30 H ( jω) 2 +α C 2
20
1. α is a user controlled parameter 10 Normalised response
2. C may be constant or frequency 0 dependent e.g. ω2 maximises the
smoothness of the result 10
20 0 20 40 60 80 100 120 140 160 180 200 Time, ps Combined, unprocessed data Deconvolved result: Brick wall filter Deconvolved result:Nahman filter Limitations
• Fourier Transform assumes a cyclic repeating signal • Fourier Transform deconvolution cannot be applied to step waveforms directly
1.5
1
0.5
Original signal 0
0.5 5051015 Time Solution 1
• Differentiate the signal xi →xi-xi-1 • Deconvolve the signal
• Integrate the signal xi →xi+xi-1
1.5 0.02
1
0.01
0.5
0
Original signal 0 Derivative signal
0.5 6 4 20246 0.01 6 4 20246 Time Time Solution 2
• Append a ‘joining function’ e.g. A cos(πt/T)+B to the signal • Deconvolve the signal • Discard the joining function
1.5 Original signal Joining function 1
0.5
Original signal 0
0.5 50 51015 Time Direct deconvolution
• Convolution described as a summation • Deconvolution as a least-squares solution for x? • Filtering required to smooth result
Convolution sum Least-squares representation – minimise errors 2 i ⎛ i ⎞ ⎜ x' h − y ⎟ = 0 yi = ∑ x jhi− j ⎜∑ j i− j i ⎟ j=0 ⎝ j=0 ⎠
Additional least-squares equations – maximise smoothness of the result 2 γ (x' j−1 −2x' j+1+x' j+1 ) = 0 Direct deconvolution
• Large system of equations (>1000 unknowns) • Direct deconvolution of step response is possible Summary
• Introduction • Pre-requisites • Convolution and correlation • Time and Frequency domains • Inverse problems • Fourier transform deconvolution • Direct deconvolution • Summary