cos mωt cos nωt dt = 0 if m ≠ n T 2 ifm=n ≠ 0

advertisement
Fourier Approximations
cos a + b = cos a cos b – sin a sin b
cos a – b = cos a cos b + sin a sin b
leads to
2cos a cos b = cos a + b + cos a – b
Set ω = 2π. This in turn leads to
T
T
cos mωt cos nωt dt =
0
0 if m ≠ n
T if m = n ≠ 0
2
Similarly,
T
sin mωt cos nωt dt = 0
0
T
sin mωt sin nωt dt =
0
June, 2003
0 if m ≠ n
T if m = n ≠ 0
2
1
Conclusion:
The functions
1, sin nωt , cos nωt , n = 1,2,…, are pairwise
orthogonal relative to the inner product
T
f, g =
f t g t dt
0
We can use linear algebra to talk about least squares
trigonometric approximations.
T
f(t), cos kωt
ak =
=2
T
cos kωt , cos kωt
f(t), sin kωt
bk =
=2
T
sin kωt , sin kωt
f t cos kωt dt
0
T
f t sin kωt dt
0
The orthogonal projection onto the subspace spanned by
the first n sines and and n+1 cosines is
n
fn t = 1 a 0 + Σ a kcos kωt + b ksin kωt
2
k=1
and the Fourier coefficients are
ak = 2
T
bk = 2
T
June, 2003
T
f t cos kωt dt
0
T
f t sin kωt dt
0
2
For most functions, fn(t) aproaches f(t) for large n.
lim f t
n→∞ n
=ft
Example
Get Fourier approximations for the wave form
1
0
1
Figure 1
2
ω = 2π = π
T
2
ak =
f t cos kπt dt
0
2
bk =
f t sin kπt dt
0
We want an analytic expression for f(t) on [0,2].
June, 2003
3
|t|
-1
–|t|
1
1
–|t
– 1|
1
2
1 – |t – 1|
f(t) = 1 - |t - 1| is the function description over [0,2].
Goal: Calculate and plot the first few Fourier approximations
for the function above.
June, 2003
4
• Set up and calculate the Fourier coefficients
2
ak =
1 – |t – 1| cos(kπt)dt
0
»t = sym(‘t’); % declare t to be symbolic
»k = 0;
»int((1 - abs(t-1))*cos(k*pi*t),0,2)
ans =
1
»k = 1;
»int((1 - abs(t-1))*cos(k*pi*t),0,2)
ans =
-4/pi^2
»k = 2;
»int((1 - abs(t-1))*cos(k*pi*t),0,2)
ans =
0
»k = 3;
»int((1 - abs(t-1))*cos(k*pi*t),0,2)
ans =
-4/9/pi^2
»k = 4;
»int((1 - abs(t-1))*cos(k*pi*t),0,2)
ans =
0
»k = 5;
»int((1 - abs(t-1))*cos(k*pi*t),0,2)
ans =
-4/25/pi^2
June, 2003
5
ak's
1.0000 <-- a0
-0.4053 <-- a1
0.0000 <-- a2
-0.0450 <-- a3
-0.0000 <-- a4
---------------------------------------------------------2
bk =
1 – |t – 1| sin(kπt)dt
0
»k = 1;
»int((1
ans =
0
»k = 2;
»int((1
ans =
0
»k = 3;
»int((1
ans =
0
»k = 4;
»int((1
ans =
0
- abs(t-1))*sin(k*pi*t),0,2)
- abs(t-1))*sin(k*pi*t),0,2)
- abs(t-1))*sin(k*pi*t),0,2)
- abs(t-1))*sin(k*pi*t),0,2)
bk's
0 <-- b1
0
0
0
June, 2003
6
The second, third, and fourth fourier approximations
f1(t) = 1 – 42 cos πt
π
f2(t) = f1(t)
f3(t) = f2(t) – 4 2 cos 3πt
9π
Plot the first few Fourier approximations…
Fourier Approximations for 1 - abs(t-1)
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
f1 in red and f3 in black
0.1
0
0
0.5
1
t
1.5
2
Figure 2
The approximations aren’t great near 0 and 2, but the figure
suggests that higher order versions come close.
June, 2003
7
Download