- Predictor
Corrector Methods
-
Overview
-
Heun, Taylor,
Runge-Kutta, and Euler are single-step methods: they only use
to
compute
-
Multi-step
methods use more than one previous value of

- Adams-Bashfourth-Moulton
method
-
Uses a
Lagrange polynomial to obtain
and
then integrate over the interval

-
←
Adams-Bashfourth predictor -
The corrector
is also developed by constructing a second order Lagrange
polynomial and then integrating
-

- Systems of
Differential Equations
-
Multiple
Variables
-
eg. Assume we
have these equations:
-

-

-

- The
solutions are functions x(t) and y(t) that when derivated they
transform into
and
-
Example VIII.1
-
Initial
Conditions:
-

-

-

-

- Exact
Solution:
-

-

- Euler Method
for Systems of Differential Equations
-
Extend Euler's
method for systems of differential equations
-
Substitute
if
we make
small
enough -

-
As a result,
we have

-
Simplifying,
we get

-
Same for y:
-

-

-

-

- In general,
-

-

-

-
Example VIII.2
(Continuation of Example VIII.3)
-
Initial
Conditions
- Substitute
our equations (given) and end up with these equations:
- Use these
to walk the curve and obtain the following table:
- As we
continue, the error grows.
-
Comparison
with exact solution:
- Conclusion:
-
is
too large -
Maybe
choosing
will
give a better result but it will be slower
- Runge-Kutta
for Systems of Differential Equations
-
Uses more than
one evaluation of g and f so it gives better precision
-

-

-
← Equations 1, 2 -
←
Equations 3, 4 -
←
Equations 5, 6 -
←
Equations 7, 8
- Higher Order
Differential Equations
-
Involve higher
derivatives
-
eg.
,
,
etc.
- For
example:
-

- We can
reduce this equation to a system of two differential equations of
first order
-
Let

-
Then

- Then this
second differential equation becomes
-

-

- Example
IX.1
-
with
-

-
Let

-
So we have the
system of differential equations:
- We can
solve this system using the Runge Kutta methods.
- Fourier
Series
-
Used to
represent sequences in time
-
We can express a
function
as
a summation of sin and cos functions with different frequencies and
amplitudes
-
Assume
is
a function that is periodic with period
and
it is continuous over
-

-
To obtain a_J
and b_J we integrate f(x)
-

-

-

-

-

-
To obtain
we multiply by
where
is the constant we want to determine -

-

-
We’re
left with
-
←
When
-
Orthogonal
Properties
-

-

-


-
←
Fourier Transform -
We can use the
same procedure to obtain

-

- DFT
(Discrete Fourier Transform)
-
Input: a
discrete signal (a signal that is sampled periodically over time)
-
Example
-
Our signal is
sampled to create the sequence 3,5,6,5,3,3
-
The number of
bits to represent this sample is limited in the computer
-
The analog
values are rounded or truncated
-
The rounding
error is called the quantization error or quantization noise
-
When we use
more bits to represent our sample we reduce the quantization
noise (eg. 16 bits →
)
- High
Fidelity Signals
-
eg. CD music,
etc.
-
44,000
samples/sec
-
2 bytes/sample
-
2 channels
(stereo)
-
3 minutes per
song (180 seconds)
-

- Analog
Transform
-
Imaginary form
-
←
Equation 1 (“i” is the
imaginary number) -
This imaginary
form is more compact that the sin cos version
-
Euler’s
Identity
-
←
Equation 2
- Substituting
equation 2 in 1
-

-

-
is
the real part of
and
is
the imaginary part of
- Discrete
Fourier Transform
-
We approximate
the integral using a sum of rectangles
-

-
is
a complex number -
It is easier
to use the magnitude and angle of
instead
of real and imaginary components -

-

-
Relationship
between Analog and Discrete Fourier Transform
-
Example
-
We obtain
the amplitudes of the harmonics
-
Nyquist
Theorem (Nyquist Limit)
-
We can’t
go beyond the N/2 harmonic
-
Or….
-
If you have
a signal with a maximum frequency F you have to sample it at
2F samples-per-second or the signal will degrade
- Applications
-
MP3 Sound
Compression
-
Instead of
storing samples over time, MP3 divides the samples into groups
(eg. 576 samples)
-
Obtain DFT
to get the
coefficients -
Masked
points are discarded or encoded with fewer points
-
By storing
fewer
coefficients
MP3 is able to obtain up to 10:1 compression (1/10th
of the original size) -
MP3 players
take the A_k coefficients and rebuild the signal over time
using an inverse discrete fourier transform
-
The
reconstituted signal will be different than the original but it
will sound similar
- Speech
Recognition
-
Pattern
Recognition
-
The Problem
-
Given a
series of points
obtain
the most likely lines that pass through those points -
We have
multiple lines!
-
Least
Squares? It won't give you both lines
-
Use the
Hough Transform!
- Hough
Transform
-
Explanation
-
A point in
(x,y) can belong to a family of lines
-
In the real
world, there are an infinite number of families; in the
computer there is a definite number of families
-
Recall
formula for a line: y=mx+b
-
For a
specific point (x,y) we can define a family of lines
-

-
This is a
line with slope

-
Assuming the
m-b plane, the line crosses
at
-

-

-
All the
points (m,b) in the line on the m-b plane represent all the
possible lines that pass through (x,y) on the x-y plane
- If many
points on the x-y plane are on the same line they will
intersect at the same point on the m-b plane
-
We can use
the m-b plane as an accumulator to count the intersections at
each point (this is called an accumulator plane)
-
The points
with the highest number of intersections on the m-b (b-m) plane
will be the lines you would like to represent on the x-y plane
- Mathematics
-
Inputs are
points
that
form multiple lines -
Outputs are
lines
that
are the most likely lines that the points represent -
Step 1
-
Create a 2-D
accumulator matrix to represent the b-m space
- Step 2
-
A point
(x,y) is contained by the line
→
A point (x,y) gives a line in the plane (b,m) -

-
Plot the
line
over
x in the b-m accumulator plane -
For every
(b,m) that the line passes through increment that accumulator
- Step 3
-
Iterate over
the b-m matrix and find the top k counters
-

-
These are
the most likely lines
- This can
be extended to support many different shapes
-
The problem is
that this method can’t see vertical lines →
can’t
represent vertical lines -
In the Hough
transform we use the polar line representation
- In this
way, we rewrite the Hough algorithm to use the
plane
instead of the b-m plane
-
Step 1
-
Define a 2-D
matrix:

- Step 2
- Step 3
-
For all
points (x,y) in

-
For
to
-

-

-

- Step 4
-
For all
values in accum find the top k
-
These are
the most likely lines
- Example
available at
http://www.dis.uniroma1.it/~iocchi/slides/icra2001/java/hough.html
- Hough Transform for circles
-
Explanation
-
We can build a hough transform for circles by using a similar
approach
-
Input: a sequence of points (x_0 , y_0), … , (x_{n-1} ,
y_{n-1}) and a radius r
-
Output: a sequence of centers (p_0 , q_0), … , (p_{k-1},
q_{k-1}) of circles of radius R that are the most likely circles
that pass through (x_0, y_0), … , (x_{n-1}, y_{n-1})
-
We have the x-y plane (circles) and the p-q plane (centers of
circles)
-

-

-
These equations give a circle centered at (x,y) in the (p,q)
plane
- Algorithm
-
Create an accumulator accum[m,n]
-
For each point
-
-

-
p=x_k + Rcos(t)
-
q=y_k + Rsin(t)
-
accum[p,q]++
- Example available at
http://d0server1.fnal.gov/users/ngraf/Talks/UTeV/Java/Circles.html