Let f:[−π,π]:→R be a real function. As f itself can be complicated, we want to decompose it into a linear combination of simpler functions.
Example. A typical family of simple functions are polynomials:
{1,t,t2,t3,...}.
Under proper condition, e.g., if f is infinitely differentiable, it can be indeed decomposed into a linear combination of polynomials, such as:
f=f(0)+f′(0)t+2!f′′(t)t2+...
Problem
Here we study the problem of approximating f with trigonometric functions:
T={1,sint,cost,sin2t,cos2t,....}.
Although f:[−π,π]:→R is a function with output on R, we view it as a function [−π,π]:→C to take advantage of complex exponential. Now, we approximate f with a set of sinusoids:
Define the span S(Γ) as the set of all possible linear combinations of functions in Γ:
S(Γ)≐{k∈Z∑ckexp(ikt):∀k∈Z,ck∈C}.
The goal is to find the closest function to f in S(Γ).
The key issues with the approximation are
How do we measure the closeness between two functions?
Under what condition, can f be rewrite as a linear combination of functions in Γ?
What is the approximation error, between f and the linear combination?
Norm
Despite the goal stated above, the closeness between f and a function in S(Γ) has not yet been defined. This raises the question of measuring the distance between two functions in [−π,π]→C.
In Rn, the Euclidean distance between two vectors u,v is defined as
∣∣u−v∣∣=i=1∑n(ui−vi)2.
If we define w=u−v, then the problem of measuring the distance between two vectors reduces to the one of measuring the length of a vector
∣∣u−v∣∣=∣∣w∣∣=i=1∑nwi2.
In a similar manner, if we view a function h:[−π,π]→C as an (uncountable) infinite dimension vector, it is natural to defined its length
∣∣h∣∣≐∫[−π,π]∣∣h(t)∣∣2=∫[−π,π]h(t)⋅h(t).
Remark:
∣∣h∣∣2 needs to be integrable.
Verify that ∣∣⋅∣∣ is a norm.
As f−g is also a function in [−π,π]→C, the distance between two functions f and g is given by
We have just introduced the notation of Hermitian product to simplify the expression. Its "geometric" interpretation is related to the idea of "projection". We start by reviewing the ideas of "Projection, Dot Product and Orthogonality" in R2.
Projection in R2. Given u,v∈R2, the projection of u to v is the vector in the subspace
S(v)≐{c⋅v:c∈R}
that is closest to u.
Dot Product in R2. Given u,v∈R2, their dot product is defined as
⟨u,v⟩=u1v1+u2v2.
The projection of u to v (closest vector to u in S(v)) is given by
∣∣v∣∣21⟨u,v⟩⋅v=∣∣v∣∣⟨u,v⟩⋅∣∣v∣∣v.
The first term of the final product ∣∣v∣∣⟨u,v⟩=∣∣v∣∣∣∣u∣∣⋅∣∣v∣∣⋅cos∠(u,v)=∣∣u∣∣⋅cos∠(u,v) gives the length of u's projection to v, and the second term ∣∣v∣∣v is a unit vector that shares the same direction as v.
Orthogonality in R2. Given u,v∈R2, they are orthogonal if the projection of u to v is 0. In this case,
⟨u,v⟩=0.
We can extend these ideas to [−π,π]→C.
Projection
Given f,g:[−π,π]→C, the projection of f to g is the function in the linear span of g
S(g)≐{c⋅g:c∈C}
that minimize ∣∣f−c⋅g∣∣,∀c∈C.
Hermitian Product
Hermitian product is related to projection and arises naturally when we try to solve
c∈Cmin∣∣f−c⋅g∣∣,
or equivalently,
c∈Cmin∣∣f−c⋅g∣∣2.
Expanding ∣∣f−c⋅g∣∣2 and let c=x+iy, ⟨g,f⟩H=a+ib, we get
Remark:The derivation above requires the integration operation to be linear.
Taking the derivate of RHS with respect to x, setting it to zero and assuming that ∣∣g∣∣=0, we see
2x⋅∣∣g∣∣2−2a=0⇒x=∣∣g∣∣2a.
Similarly,
2y⋅∣∣g∣∣2−2b=0⇒y=∣∣g∣∣2b.
Combined, c is given by
c=x+iy=∣∣g∣∣2⟨g,f⟩H=⟨∣∣g∣∣g,f⟩H⋅∣∣g∣∣1.
This implies that
c⋅g=∣∣g∣∣2⟨g,f⟩H⋅g=⟨∣∣g∣∣g,f⟩H⋅∣∣g∣∣g.
Now it is clear that the Hermitian product computes the coefficient for the projection of f to g, scaled by a factor of 1/∣∣g∣∣2. When ∣∣g∣∣ has unit length,
c⋅g=⟨g,f⟩H⋅g.
The Hermitian product ∈C is the just the coefficient for the projection.
Orthogonality
Given f,g:[−π,π]→C, f is orthogonal to g if the projection of f to g is the zero function, i.e., the closest function (measured by ∣∣⋅∣∣) to f in the linear span S(g) is the constant function zero. It holds that, either ∣∣g∣∣2=0 or
argc∈Cmin∣∣f−c⋅g∣∣2=∣∣g∣∣2⟨g,f⟩H=0.
In both cases,
⟨g,f⟩H=⟨f,g⟩H=0.
Properties of Γ
We are now ready to discuss the properties of Γ={1,exp(it),exp(−it),exp(i2t),exp(−i2t),...}.
For k∈Z,
∣∣exp(ikt)∣∣=∫[−π,π]exp(ikt)exp(ikt)=2π.
For k,l∈Z, k=l, exp(ikt) and exp(ilt) are orthogonal.
Suppose that we are using some kind of integration and let I2([−π,π]) be the set of square integrable functions. Further, assume that g1,g2,g3,... are also elements in I2([−π,π]). We are interested in
Whether a Cauchy series in I2([−π,π]) converges to a function in I2([−π,π])?
Define
g=k→∞limgk=i=0∑∞ai⋅ei.
It is important that g∈I2([−π,π]), as we need the length of ∣∣g∣∣ to be well-defined. Further, f−g should also be in I2([−π,π]).
However, if we are using Riemann integration, the answer is no. Let r1,r2,.... be the rational number in the interval of [0,1] and define
hi(x)={1,0,if x∈∪t=1i{rt}otherwise
Then hi∈I2([−π,π]) but limi→∞hi is not Riemann integrable, hence not in I2([−π,π]).
If we are using Lebesgue integration, the answer is yes.
Fact. If we are using Lebesgue integration, then I2([−π,π]) is complete, i.e., if g1,g2,...,∈I2([−π,π]) is Cauchy, then limkgk∈I2([−π,π]).
Approximating Error
It is left to study the error of approximating f with g.
Lemma. Cauchy-Schwartz Inequality. Let h1,h2∈I2([−π,π]), then
∣⟨h1,h2⟩H∣≤∣∣h1∣∣⋅∣∣h2∣∣
Proof. If ∣∣h2∣∣=0, then h2=0 almost everywhere and the case is trivial. Otherwise, ∀c∈C, we have
Remark: the above proof involves the operation of exchanging the order of two limiting operations, namely lim and ∫. Exchanging order like this is dangerous for Riemann integration, but we can do it safely under Lebesgue integration, under proper condition. Here we use Fatou's lemma.
By the above lemma, the function g has an important property, such that ∀i∈N,
⟨ei,f−g⟩H=0.
Lemma. Let h∈I2([−π,π]). If ∀i∈N,
⟨ei,h⟩H=0,
then h=0 almost everywhere.
Proof. First, we assume that h is a continuous function on [−π,π]. If h≡0, then ∣h(x)∣ achieves maximum value at some point x∗∈[−π,π]. Without lose of generality, we assume that
h(x∗)=M>0.
By continuity of h, ∃δ∈(0,π), such that h(x)>M/2 in the interval
I≐(x∗−δ,x∗+δ)∩[−π,π].
We will capture the maximum value of f, by taking Hermitian product of f with a signal function that
is a linear combination of functions in F;
is ≥1 in I;
is <1 in [−π,π]∖I.
The signal function is given by
s(x)=1+cos(21⋅(x−x∗))−cos2δ.
Observe that s
achieves maximum value s(x∗)=2−cos2δ;
is ≥1 for x∈I;
has period 4π.
Hence, it increases on the interval [x∗−2π,x∗] and decreases on [x∗,x∗+2π]. So
s(x)<1 for x∈[−π,π]∖I.
For n≥1, sn(x) is also a linear combination of functions in F. It always holds that ⟨sn(x),f⟩H∈R and by assumption on f, it holds that
⟨sn(x),f⟩H=0.
But this is impossible. By monotonicity of integration,
∫[−π,π]∖If(x)sn(x)dx≥∫[−π,π]∖I(−M)⋅1dx=−2⋅π⋅M.
Define
I′≐(x∗−δ/2,x∗+δ/2)∩[−π,π].
Then ∣I′∣≥δ/2 and m≐minx∈I′s(x)>1.
∫If(x)sn(x)dx≥∫I′2M⋅mndx≥4M⋅mn⋅δ.
This implies as n→∞,
⟨sn(x),f⟩H≥−2⋅π⋅M+4M⋅mn⋅δ→∞,
which is a contradiction.
Next, we consider the general case of h∈I2([−π,π]). Define
w(x)=∫−πxh(t)dt.
The function is absolutely continuous on [−π,π]. Moreover,
w(0)=0 and by assumption, w(π)=⟨e0,h⟩H=0. For k∈N, integrating by part gives