Data smoothing Raymond Cuijpers Index The moving average

  • Slides: 15
Download presentation
Data smoothing Raymond Cuijpers

Data smoothing Raymond Cuijpers

Index • • • The moving average Convolution The difference operator Fourier transforms Gaussian

Index • • • The moving average Convolution The difference operator Fourier transforms Gaussian smoothing Butterworth filters

The moving average • Let (Si) be a data set • Si, smooth= 1/3

The moving average • Let (Si) be a data set • Si, smooth= 1/3 (Si-1 + Si+1) = = =

Convolution Definition: The moving average is the same as convoluting the signal with a

Convolution Definition: The moving average is the same as convoluting the signal with a block function !

Convolution f*g=g*f f * (g + h) = f * g + f *

Convolution f*g=g*f f * (g + h) = f * g + f * h (f * g) * h = f * (g * h) f*0=0 But 1*g≠g

The difference operator The velocity is the derivative of the displacement, for discrete signals

The difference operator The velocity is the derivative of the displacement, for discrete signals this becomes the difference operator. • Discrete differentiation = convolution with difference operator • Velocity estimated at i+1/2

The difference operator • The difference operator amplifies noise * = • Smoothing helps

The difference operator • The difference operator amplifies noise * = • Smoothing helps but at the cost of accuracy • It becomes worse for higher order derivatives

Differentiation and convolution Noisy Exact = = BAD GOOD • Differentiation by convolution with

Differentiation and convolution Noisy Exact = = BAD GOOD • Differentiation by convolution with derivative

Fourier Transforms Definition: In the Fourier domain: • convolution becomes multiplication • differentiation becomes

Fourier Transforms Definition: In the Fourier domain: • convolution becomes multiplication • differentiation becomes multiplication with iw

Fourier Transforms • Calculating convolutions using Fourier transforms is much faster for large data

Fourier Transforms • Calculating convolutions using Fourier transforms is much faster for large data sets than direct computation: • There are many other transforms/expansions – – – Sine and Cosine transforms Laplace transform Legendre polynomials Hermite polynomials (=Gaussian) Bessel Functions …

Gaussian smoothing Let S(t) be a signal then the blurred signal is Where is

Gaussian smoothing Let S(t) be a signal then the blurred signal is Where is the Gaussian kernel The derivative of a noisy S(t) is ill-posed, but

Gaussian smoothing The n-th order proper derivative of scale s is So in the

Gaussian smoothing The n-th order proper derivative of scale s is So in the discrete case we get

Gaussian Smoothing • Gaussian filters are the only 'natural' filters * Together they form

Gaussian Smoothing • Gaussian filters are the only 'natural' filters * Together they form a linear Scale selective space of operators =

Butterworth Filters • Noise is usually high frequent and not the signal • Butterworth

Butterworth Filters • Noise is usually high frequent and not the signal • Butterworth filters work by throwing away high frequencies in the Fourier transform A good choice of cut-off frequency is paramount

Butterworth filters Advantage: • Easy to implement in electronic circuit Disadvantage: • Introduces a

Butterworth filters Advantage: • Easy to implement in electronic circuit Disadvantage: • Introduces a phase shift. Solution is to apply it twice in opposite directions • 'Ringing': jumps in the signal produces oscillations • Depends strongly on the nature of the noise and the choice of cut-off frequency