24
A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National Physical Laboratory ([email protected]) Signal Processing Seminar 21 June 2006

A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

  • Upload
    others

  • View
    55

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

A Beginner’s Guide to Convolution and Deconvolution

David A HumphreysNational Physical Laboratory

([email protected])Signal Processing Seminar 21 June 2006

Page 2: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Overview

• Introduction• Pre-requisites• Convolution and correlation• Fourier transform deconvolution• Direct deconvolution• Summary

Page 3: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Convolution

• Finite impulse response for a system• Convolution implies history/memory of the stimulus• Convolution implies Bandwidth

Time →Time →

Dirac Impulse function δ(t)

Resultant Waveform System response

h(t)

Linear System

Page 4: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

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

Page 5: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

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)

Page 6: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Convolution

System response

-2

-1

0

1

2

1 3 5 7 9 11 13 15 17 19

Time

Sign

al

System response

Stimulus

-1

0

1

2

1 3 5 7 9 11 13 15 17 19

Time

Sign

al

Stimulus

-1

-0.5

0

0.5

1

1.5

2

2.5

3

1 3 5 7 9 11 13 15 17 19

Time

Sign

al

t9t8t7t6t5t4t3t2t1t0

-1

-0.5

0

0.5

1

1.5

2

2.5

1 3 5 7 9 11 13 15 17 19

Time

Sign

al

t0t1t2t3t4t5t6t7t8t9

Page 7: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Convolution

Result

-1

0

1

2

3

1 3 5 7 9 11 13 15 17 19

Time

Sign

al

Result

Stimulus

-1

0

1

2

1 3 5 7 9 11 13 15 17 19

Time

Sign

al

Stimulus

Page 8: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Measured waveform

• Convolution of stimulus and system response

Signal x(t)

Resultant waveform

y(t)

System response

h(t)

Frequency domain Time domain

τττ dthxtyt

∫+

∞−−= )()()(

∑=

−=i

jjiji hxy

0

)()()( sXsHsY =

Page 9: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Convolution and Correlation

• Correlation – the direction of signal is reversed

Frequency domain Time domainConvolution

τττ dthxtyt

∫+

∞−−= )()()()()()( sXsHsY =

Correlation

τττ dthxtyt

∫+

∞−+= )()()()()()( sXsHsY =

Page 10: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Application areas

• Optics and Image capture• Waveform capture/processing• Electronic Engineering• Communications• Acoustics

Page 11: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

De-convolution

Page 12: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

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

Page 13: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

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)

Page 14: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Deconvolution of measured waveform

• Convolution of stimulus and system response• Deconvolution – correction for the system response

Signal x(t)

Resultant waveform

y(t)

System response

h(t)

DeconvolveSystem

responseh-1(t)

Estimate forSignal

x’(t)

h-1(t) is the inverse of the system response h(t)

Page 15: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Deconvolution of measured waveform

• Convolution of stimulus and system response• Deconvolution – correction for the system response

Signal x(t)

Resultant waveform

y(t)

System response

h(t)

Estimate forSignal

x’(t)

DeconvolveSystem

responseh-1(t)

Filterr(t)

h-1(t) is the inverse of the system response h(t)

Page 16: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Deconvolution

• Inverse problem• Ill-posed• Noise• System response errors Deconvolved

Noise

Deconvolved result

Frequency

Volta

ge

)()()(ω

ωωjH

noisejYjX +=

Page 17: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Deconvolution with filter

• Inverse problem• Ill-posed• Noise• System response errors• Filter added to limit noise/errors

Deconvolved Noise

Filter R(jω)System response

Deconvolved result

Frequency

Volta

ge

)()(

)()( ωω

ωω jRjH

noisejYjX +=

Page 18: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Realisation of Deconvolution process

• System impulse response• Direct time-domain convolution (Digital filtering - FIR)• Transform approach (e.g. Fourier transform)

22

2

)()(

)(CjH

jHjR

αωω

ω+

=

0 20 40 60 80 100 120 140 160 180 20020

10

0

10

20

30

40

50

Combined, unprocessed dataDeconvolved result: Brick wall filterDeconvolved result:Nahman filter

Time, ps

Nor

mal

ised

resp

onse

1. α is a user controlled parameter

2. C may be constant or frequency dependent e.g. ω2 maximises the smoothness of the result

x(t)A/D

converterMemory

FIRfilter

Displayedresult

Page 19: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Limitations

• Fourier Transform assumes a cyclic repeating signal• Fourier Transform deconvolution cannot be applied to step

waveforms directly

5 0 5 10 150.5

0

0.5

1

1.5

Time

Orig

inal

sign

al

Page 20: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Solution 1

• Differentiate the signal xi →xi-xi-1

• Deconvolve the signal• Integrate the signal xi →xi+xi-1

6 4 2 0 2 4 60.5

0

0.5

1

1.5

Time

Orig

inal

sign

al

6 4 2 0 2 4 60.01

0

0.01

0.02

Time

Der

ivat

ive

sign

al

Page 21: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Solution 2

• Append a ‘joining function’ e.g. A cos(πt/T)+B to the signal• Deconvolve the signal• Discard the joining function

5 0 5 10 150.5

0

0.5

1

1.5Original signalJoining function

Time

Orig

inal

sign

al

Page 22: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Direct deconvolution

• Convolution described as a summation • Deconvolution as a least-squares solution for x?• Filtering required to smooth result

∑=

−=i

jjiji hxy

0

Convolution sum

0'2

0

=⎟⎟⎠

⎞⎜⎜⎝

⎛−∑

=− i

i

jjij yhx

Least-squares representation – minimise errors

( ) 0''2' 2111 =+− ++− jjj xxxγ

Additional least-squares equations – maximise smoothness of the result

Page 23: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Direct deconvolution

• Large system of equations (>1000 unknowns)• Direct deconvolution of step response is possible

Page 24: A Beginner’s Guide to Convolution and Deconvolutionresource.npl.co.uk/docs/science_technology/... · A Beginner’s Guide to Convolution and Deconvolution David A Humphreys National

Summary

• Introduction• Pre-requisites• Convolution and correlation• Time and Frequency domains• Inverse problems• Fourier transform deconvolution• Direct deconvolution• Summary