Notebook 11 – Math 2121, Fall 2020
In practice, (abstract) vector spaces that are not readily identified with subspaces of
xxxxxxxxxx
using PlutoUI
xxxxxxxxxx
using Plots
xxxxxxxxxx
using LinearAlgebra
Recall from a few weeks ago how we can visualize vector operations in
First, create some vectors.
2×1 Array{Int64,2}:
7
2
xxxxxxxxxx
u = rand(-10:10, 2, 1)
2×1 Array{Int64,2}:
-1
7
xxxxxxxxxx
v = rand(-10:10, 2, 1)
Now choose some scalars.
a
= b
=
Visualizing the vector space operations for
is not so different.
plot_functions (generic function with 1 method)
xxxxxxxxxx
function plot_functions(f, g)
plot(f, label="f", title="functions f and g")
plot!(g, label="g")
end
plot_combinations (generic function with 1 method)
xxxxxxxxxx
function plot_combinations(f, g, c1, c2)
# plot scalar multiples of two functions on the left,
# plot their linear combination on the right
p3 = plot(
x -> c1 * f(x),
ylims = (-5, 5),
label="$(c1)•f",
title="functions $(c1)•f and $(c2)•g")
plot!(
x -> c2 * g(x),
label="$(c2)•g")
p4 = plot(
x -> c1 * f(x) + c2 * g(x),
ylims = (-5, 5),
legend=false,
title="$(c1)•f + $(c2)•g",
color=:black)
plot(p3, p4, layout=2)
end
Create some functions
f (generic function with 1 method)
xxxxxxxxxx
f(x) = cos(x)
g (generic function with 1 method)
xxxxxxxxxx
g(x) = sinc(x)
The sinc function is defined by
You may remember from calculus that
The sinc function is therefore defined at all
xxxxxxxxxx
plot_functions(f, g)
Choose some scalars in
a
= b
=
xxxxxxxxxx
plot_combinations(f, g, aa, bb)
The function space
The space
The space
of integrable functions.The space
of square-integrable functions.The space
of bounded functions.
Let's think about linear transformations between these spaces.
xxxxxxxxxx
using QuadGK # package to do numerical integration
A linear transformation
for all
Perhaps the most famous linear transformation
One definition of this (technically, the Fourier cosine transform) is
This transformation is linear because of the rules for integration from calculus, which allow us to expand sums and scalar multiples of functions under the integral sign.
Let's see how we can implement
FT (generic function with 2 methods)
xxxxxxxxxx
function FT(f, tol=1e-3; a=-100, b=100)
# we can't integrate over the whole number line, but can get a decent
# approximation by integrating over a large interval [a,b] = {x : a <= x <= b}
return x -> quadgk(y -> f(y) * cos(2 * pi * x * y), a, b, rtol=tol)[1]
end
plot_fourier_transform (generic function with 2 methods)
xxxxxxxxxx
function plot_fourier_transform(fn, tol=1e-3; a=-100, b=100)
plt1 = plot(
x -> fn(x),
legend=false,
title="function")
plt2 = plot(
x -> FT(fn, tol; a=a, b=b)(x),
legend=false,
title="Fourier transform")
plot(plt1, plt2, layout=2)
end
Our definition of the Fourer transform does not make sense for
But we can apply
where
xxxxxxxxxx
plot_fourier_transform(x -> abs(x) < 2 * pi ? cos(x) : 0.0)
The result is the sum of two 'pulses' at
What about the Fourier transform of
xxxxxxxxxx
plot_fourier_transform(x -> abs(x) < 4 * pi^2 ? cos(x^2) : 0.0)
Ignoring error, the Fourier transform of the above function is exactly
xxxxxxxxxx
begin
plot(x -> sqrt(pi) * cos(pi^2 * x^2 - pi/4))
plot!(FT(x -> abs(x) < 4 * pi^2 ? cos(x^2) : 0.0))
end
An interesting example comes
xxxxxxxxxx
plot_fourier_transform(x -> sinc(x))
The Fourier transform of
xxxxxxxxxx
# plot_fourier_transform(x -> 1 / exp((2 * x)^100))
plot_fourier_transform(x -> (abs(x) < 0.5 ? 1.0 : 0))
We can use these examples to construct eigenvectors of
If
In this case
Now, if
so
so
We can apply this to
xxxxxxxxxx
plot_fourier_transform(x -> sinc(x) + (abs(x) < 0.5 ? 1.0 : 0))
xxxxxxxxxx
plot_fourier_transform(x -> sinc(x) - (abs(x) < 0.5 ? 1.0 : 0))
This shows that
Here are some other interesting eigenvectors of
xxxxxxxxxx
plot_fourier_transform(x -> exp(-pi * x^2))
xxxxxxxxxx
plot_fourier_transform(x -> exp(-pi * x^2) * (8 * pi * x^2 - 2))
Are there are any other eigenvalues
xxxxxxxxxx
plot_fourier_transform(x -> sin(x) / exp(x^2))
The numbers
A function
If
If
Every
Also
This means
So the only way we can have
the function
is odd and , orthe function
is even and , since then .
Because the Fourier transform is a linear transformation
As such, although we can figure out the eigenvalues of
Solving this probem is something covered in a more advanced course on Fourier/harmonic analysis.
xxxxxxxxxx
plot_fourier_transform(x -> cos(2 * pi * x) * sinc(x), 1e-4)
xxxxxxxxxx
plot_fourier_transform(x -> sinc(x)^2)
Very briefly, why is the Fourier transform is an important/useful linear function:
The Fourier transform converts waves to bits. More precisely,
converts (decaying) sinusoidal signals to discrete signals. For this reason, is the foundation of signal processing.Not so much emphasized in our discussion, but
is also useful in algebra because it transforms differential equations to polynomial equations, which are easier to solve.Finally, and signficantly: there are efficient algorithms to compute
.