Title: Advanced Filtering
1Advanced Filtering
- Bala Muralikrishnan
- Dept. of MEES
- UNCC
2(No Transcript)
3Filtering output -not simply a smoothing process
but view as a way to suppress high frequency
4- In order to filter a profile, we assume that a
profile is the superposition of a number of sine
waves - Filtering suppresses some of these surface
wavelengths, while retaining others - We are taking a more frequency domain approach
to filtering here
5- In order to do this, we need to know first what
wavelengths are present in a surface - How do we commonly resolve a signal into its
different sinusoidal components Fourier
Transform - In this presentation we will
- Review fourier transform
- Resolve a signal into its constituent sinusoids
- Perform filtering in frequency domain
- Compare this with last presentation where we
did filtering in time or spatial domain
6Fourier Transform
7Basic Theory
- Read any Undergraduate Math book!
- Idea is that any signal can be represented as a
sum of different sinusoids of varying amplitude
and wavelength - Sinwave is defined by Asin(lambaXphi)
- Where A is the amplitude and lamda is the phase.
Phi is an additional phase term
8Fourier Series Illustration
(1/1)sin(2pi1x)
9(1/1)sin(2pi1x) (1/3)sin(2pi3x)
10(1/1)sin(2pi1x) (1/3)sin(2pi3x) (1/5)sin(2p
i5x)
11(1/1)sin(2pi1x) (1/3)sin(2pi3x) (1/5)sin(2p
i5x) (1/7)sin(2pi7x)
12(1/1)sin(2pi1x) (1/3)sin(2pi3x) (1/5)sin(2p
i5x) (1/7)sin(2pi7x) (1/9)sin(2pi9x)
13Fourier Series
F(x) (1/1)sin(2pi1x) (1/3)sin(2pi3x)
(1/5)sin(2pi5x) (1/7)sin(2pi7x)
(1/9)sin(2pi9x)
We have generated a square wave by adding
different sin waves. These sine waves have
different amplitudes and wavelengths. The
reverse is the Fourier series - Any signal can be
decomposed into many sine waves Each sine wave
is characterized by its amplitude and
wavelength(or frequency) The input signal is
time-dependant or is said to be in time domain
14Fourier Transform
- Fourier Transform is the process of transforming
a signal from time-domain to frequency domain. - In this example,
Amplitude and Wavelength of Different sine waves
That make up the signal
Fourier Transform
F(x) Square wave
15Fourier Transform
Fourier Transform
F(x)
Time domain
Frequency domain
16FFT
- Fast-Fourier-Transform (FFT) is an algorithm to
perform Fourier transform in a fast and efficient
manner - Check Matlabs fft function
- Download myfft function
17So, going back to surface metrology, given any
profile, we can take its fourier transform and
see what frequencies are present in a surface.
Once we know this info, then we can talk
about filtering
18Do it yourself
- gtgt spacing 1/1000 in mm
- gtgt length 8 in mm
- gtgt X (0spacinglength-spacing)
- gtgt Y1 sin(2pi.X/2)
- gtgt plot(X,Y1)
- gtgt title('A sine wave data')
- gtgt xlabel('mm')
- gtgt ylabel('um')
-
- gtgt Y2 sin(2pi.X)
- gtgt myFFT(X,Y2)
-
- gtgt Y3 Y1 Y2
- gtgt myFFT(X,Y3)
-
- gtgt Y4 Y1 0.5Y2
- gtgt myFFT(X,Y4)
- Using this function myFFT (download it from the
website), generate different signals and look at
the FFT plots. - Are the FFT plots giving you the same info as
that is contained in the original signal? - In other words, if the input is a sine wave of
amplitude 1 and wavelength 1, when u do the FFT,
do u see a peak at wavelength 1, whose amplitude
is 1?
19Filtering
20A simple Filter
- A very simple filter is like a sieve it
prevents some particles from falling through
while letting other slip through. - The size of mesh in the sieve decides what
particles can go through - Each particle is characterized by its size
- The sieve is a filter it is characterized by
the size of the mesh cutoff
21So, how does the filter work?
- If the size of the data(sand particle) is
smaller than the cutoff of the filter(sieve) - the filter transmits the data(particle), in other
words, the particle can fall through the sieve - Else, the filters blocks the data
223mm dia
20mm dia
sieve
10mm
- Diameter of the mesh hole 10mm. Thus the cutoff
is 10mm - This filter can transmit particles whose dia is
less than 10mm
23Filters in Metrology
- Filters we need in Metrology follow the same
basic idea. - What are going to filter?
- Surface profiles
- Roundness data
- Cylindricity data
- Why do we need to filter data
- To suppress noise
- Extract the trends in data
24What exactly are we going to filter
- Any signal can be represented as sum of different
sine waves fourier theorem - Square wave F(x) (1/1)sin(2pi1x)
(1/3)sin(2pi3x) (1/5)sin(2pi5x)
(1/7)sin(2pi7x) (1/9)sin(2pi9x) - Just as the sand particle is characterized by it
size, a continuous time signal is characterized
by the wavelengths of the different sinusoids
that make up this signal - So, the goal our filter is to allow some of the
sinusoids to pass through, while blocking the
others
25Output signal has only some of those
wavelengths Ouput(x) (A1,lamda1)
Input containing sinusoids of many Wavelengths F
(x) (A1,lamda1) (A2,lamda2)
Filter
The filter has suppressed the other sinusoids
(A2,lamda2)
26How do you filter a signal?
- There are two general approach to filters
- The intuitive way to this would be in the
frequency domain - Time domain convolution is another way to filter
signals
27Time domain filtering
- Smoothing process using convolution
- Take the profile and the filter, convolve the
two, extract the waviness profile
28Filtering in Frequency domain
Input signal In time domain
Look at the FFT and suppress all wavelengths
you do not want
FFT
Take the inverse FFT
Filtered output
29An example generating a data set that has known
wavelengths
- Generate a signal that has two sine waves
superimposed on them
30y 1sin(2pix/2) 0.5sin(2pix/0.5)
31Suppress the FFT
32Suppress the FFT
33Inverse FFT
34To summarize
- We started with
- this signal
- Took the FFT of
- the signal
- Suppress fft
- did inverse fft
35Filter window
- When we suppressed the FFT, we multiplied the FFT
array by a bunch of 0s and 1s. This array of
0s and 1s is the filter window, commonly called
as the filter. - The width of the filter (the number of 1s) is
the cutoff of the filter
361mm
1
0
4mm
37Transmission characteristics of a filter
1mm
1
0.5
0
Wavelength of sine wave (mm)
1mm
38A real filter
39Input Y1 1sin(2pix/1) Y2
1sin(2pix/2) Y3 1sin(2pix/3)
Ouput Z1 0.8sin(2pix/1) Z2
0.2sin(2pix/2) Z3 0
Filter transmits 80 at the cutoff
40- Our input is any continuous time signal that we
sample to produce a discrete time signal - This signal is made up of many sinusoids (Fourier
theorem) - Each sinusoid is characterized by its amplitude
and wavelength (this is obtained from the FFT) - The filter decides which of these wavelengths it
will allow and which it will reject (based on its
cutoff/transmission characteristics) - The filter may also modify the amplitudes of
those sine wave it allows through
41How do we get the window function?
- Look at the signal in the frequency domain
- Figure out what frequencies you need decide the
cutoff - Come up the bunch of 1s and 0s to get the filter
array - Remember we are in the frequency domain so
dont compare this with the Gaussian function
equation which is in the time or spatial domain
42Summary
- We have looked at filtering as not simply a
smoothing process, but from wavelength content
perspective. - This is important because filtering is a
wavelength/frequency domain operation - In order to simplify our implementation, we use
convolution in time domain - Underlying theory of filters is in frequency
domain
43Next Task
- We will review all of this information again
briefly - Then compare Time/spatial domain filtering
using convolution against frequency domain
filtering using FFT - Then thats about all for filtering we will
move on to Parameters the last piece in the
puzzle