Spreadsheets in Education Edu cation (eJSiE) Volume V olume 5 | Issue 2
5-20-2012
Fourier Analysis: Graphical Animation and Analysis of Experimental Ex perimental Data Data with Excel Margarida Oliveira Prof.
[email protected] Escola E.B. Piscinas-Lisb Piscinas-Lisboa oa ,
[email protected]
Suzana Nápoles Prof. Departamento Departamento de Matemát Matemática ica da Universi Universidade dade de Lisboa Lisboa ,
[email protected]
Sérgio Oliveira Eng. Laboratório Laboratório Naciona Nacionall de Engenharia Engenharia Civil Civil ,
[email protected]
Follow this and additional works at: hp://epublications.bond.edu.au/ejsie Recommended Citation Oliveira, Margarida Prof.; Nápoles, Suzana Prof.; and Oliveira, Sérgio Eng. (2012) "Fourier Analysis: Graphical Animation and Analysis of Experimental Data with Excel," Spreadsheets in Education (eJSiE): Vol. 5: Iss. 2, Article 2. Available at: hp://epublications.bond.edu.au/ejsie/vol5/iss2/2
Tis Regular Article is brought to you by the Faculty of Business at ePublications@bond ePublications@bond.. It has been accepted for inclusion in Spreadsheets in Education (eJSiE) by an authorized administrator of ePublications@bond. For more information, please contactBond contact Bond University's Repository Coordinator.. Coordinator
Article 2
Fourier Analysis: Graphical Animation and Analysis of Experimental E xperimental Data with Excel Abstract
According to Fourier Fourier formulation, any function that can be represented represented in a graph may may be approximated by the “sum” of innite sinusoidal functions (Fourier series), termed as “waves”.Te adopted approach is accessible to students of the rst years of university studies, in which the emphasis is put on the understanding of mathematical concepts through illustrative graphic representations, the students being encouraged to prepare animated Excel-based computational modules (VBA-Visual Basic for Applications).Reference Applications).Reference is made to the part played by both trigonometric and complex representations of Fourier series in the concept of discrete Fourier transform. Its connection with the continuous Fourier transform is demonstrated and a brief mention is made of the generalization leading to Laplace Laplace transform.As application, the example presented refers to the analysis of v ibrations measured on engineering structures: horizontal accelerations accelerations of a onestorey building deriving from environment noise. Tis example ex ample is integrated in the curriculum of the discipline “Matemática Aplicada à Engenharia Civil” (Mathematics Applied to Civil Engineering), lectured at ISEL (Instituto Superior de Engenharia de Lisboa. In this discipline, the students have the possibilit y of performing measurements using an accelerometer and a data acquisition system, which, when connected to a PC, make it possible to record the accelerations measured in a le format recognizable by Excel. Keywords
Fourier Analysis; movie clips in spreadsheets; spectral analysis; experimental data.
Tis regular article ar ticle is available in Spreadsheets in Education (eJSiE): (eJSiE): hp://epublications.bond.edu.au/ejsie/vol5/iss2/2
Oliveira et al.: Fourier Analysis with Excel
� ������������ I� �� ��� �� ������ � ������������ ����� ����������� ���� �� ������� ��� ����������, ��� F������ A������� ����� �� ��� �� ��� ����� �������. D�� �� ��� ������� ������������, ���� �������, ����� �� �������� �� ���� ��������� �� ��� ����� ����� �� ����������� ��� ����������� �������, �� � ���������� ����� �� ���������� � ������������ �������� ����������� ����� �� ��� ����������� �� ����������� ������������ ���� ������������ ��� ��������� ����� �� ������������ ���������. U���� ������ ��������������� �� ��� ���� ������������ ������� ��������, �� ������� � �������� ������������� �� ��� ���������� ��������, ����� �� ��������� �� � ���� ������������� �� ��� �������. T�� ��� �� ���� ������� ������������ �8�, �9� ������� ���� ���������� ���� �������� ���� ��� ���� ��� �� ���� �����. F�� � ���� ����, �� ���� ���� ���� ����� ����� ��������� ���� ������ �� �� ���������� ������ ������. T�� ����������� �� ������������ ��� �� ��� �������� �� ��������� �������� ���������� �������� ������, ������� ��������� �� � ������������� ����������� ��������, ��� ���� �������� � �������� �������� ����, ��� ���� ���� ��� ����'� ����� �� ����. T�� �������� ��������� ���� ���� �� ����������� ���� ���� ������� ��� �� ������� �� � ���������� ��� �������� ������ �� ��������������� ��������' �������� ������������ ���������. F�� ��� �������, �� ��� ������ ��������������� �� ��� ���� ������������ ������� �������� �� ��������� ��������' �������� ��������. T�� �������������� �� ������������ ����� ��� ���� ��� �� ��� ��������������' �������� ���� ��� �����. R��������� �� ��� ���� �� ��������������, ������� ���������, ��������� �� �������, �� ��� ���� �� ��� ������� ��������� ���� ������������ �������� ������� ������ ���� ��������� ����� �� ��������������� ��� ���� �1�. B���� �� ��� ������ ���� ��� ������������ �� ��������� ��������������� �� ��� �������� ���������� �� �� ���������, ���� ������� �������� ��� ����������� ���/�� ��� �� E���������� ������������� ������������ �7�, �6� ���� ����������, �� ����� �� ��������� ���� �� ��� ������������ �������� ��������. F�� ��������, ����� ��� ����������� waves.xls �� �� �������� �� ����� ������������� ��������� �� ��� ���� f(t)=a cos(ω t)+b sin(ω t) ��� �� ������� ��� ������� �� ��� ������ �� ����� ��������� ���� ��� ������ �� �, � ��� ω ��� ��������. U���� ��� ����������� Fourier_movie.xls , �� �� �������� �� ��������� � ����� ������� ��� ������������� �� � �������� �� � F������ ������ �� � ����� ��������. T�� ��� �� � ����������� ������� �������� �� ������� �������� ������������� ������� �� ����� ���, ����� �� ��������� ���� �������� ���� ��� ��� �� ���������� ����� �������. T��� ���� ����� �� �������� �� ������ ���������� ������� �� ����� �� ������� ���������� (�� � ���� ����������� �����) ���� ���� ���� ����� ����������� ������� �� V����� B���� (VBA � V����� B���� ��� A�����������). L�����, �� ������� �� �������, �����, ������� ��� ����������, ������� ��� �������� �� ���������� ��� ��������� �� �������� F������ A�������.
Produced by The Berkeley Electronic Press, 2012
1
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
� ������������� �� ��������� ���� ���������� ������ ������� ������ I� ���� ������� ��� ����������� �����, ���� �� ��� ���������� ������� ������� ��� �������� �� ������������� ����������. T���� ���������� ��� ��������� �� ���� ��������� � = �(�), ����� ������� ���� � ������ ��������� ���, �����, ������ �� ����������� �� ������������ �����������. E������� �� ���� ��� ��� �������� �� ���� �� � ������ v = v(t), �� ��� ������������ �� ��� �� � �������� ������ �� ���������� u = u(t) [2].
B����, �� ���� ���� ���� �� ����� ���������, ����� ��� �� ��������� �� ��������� ������� �������� ���� ����, �� ��� ��� � �������� �� ��� ���������, ���������� �� F������ (1768�1830): ���� �������� ���� ��� �� ����������� �� � ����� ��� �� ���������� ���� ��� ��� �� �������� ���������� ������. u(t) = a cos(ω t) + b sin(ω t)
u(t)
A
u(t) = A cos( ω (t - τ))
A=
b
a 0
T/4
a2 + b2
b
T/2
T= 2π
3T/4
ω
atan ( b )
b
t
A a
-A
u(t) = A cos( ω t - φ))
a
φ
φ= a
a>0 , b>0
atan ( b ) + 2π a>0 , b<0 a atan ( b ) + π a
a<0
τ = φ / ω A - Wave amplitude T - Wave period ω - Wave frequency (rad/s)
ω = 2π /T
f - Wave frequency in Hz or cycle/s f = 1 / T τ - Horizontal position of the maximum (between 0 and T) φ - Phase angle (between 0 and 2 π)
F����� 1: S��������� ���� ���������. G�������� �������������� �� ���������� �������� ��� ������������� ���� ��� ������������� ������ ���������.
T�� ����������� waves.xls ����� �� �������� �� ���������� �� ��� ����� �� ��� ���������� �� ��� ������ �� ��� ���� ��������� ��� ��������� ��� �� ������� ��� ���������� ������� �� ��� �����. T� ���� ������� ������, �� ���� ��������� �� ������ �� ��������� ω � ���������� �������� �� ��� ���� u(t)=a cos(ω t)+b sin(ω t)
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
(1)
2
Oliveira et al.: Fourier Analysis with Excel
�� ����� ��� ������� �������������� �� ��������� �� ������ 1, �� ����������� ��� ��������� ������� �� ���������� �, � ��� ω. F����� 2 ����� ��� ������� �������������� �� � �������� �(�) ������� �� ��� �������� [0,T ] , ��� ��� ������������� ���� ������� (�� ���������� ���������), ����� ����������� �� ��� ������������ ������� �� ����� F������ A������� �� �����.
11∆ω
Wave 11 Wave 10
10 ∆ω
9 ∆ω
Wave 9
8∆ω
Wave 8
7 ∆ω
a n= a(ωn )
Wave 7
6 ∆ω
Wave 6
5 ∆ω
an , bn
Wave 5
4 ∆ω
bn= b(ωn) 3 ∆ω
Wave 2
∆ω
T
T
Wave 3
2 ∆ω
f (t)
∆ω = 2 π
Wave 4
Wave n = an cos(ωn.t) + bn sin( ωn .t)
Wave 1 Wave 0
0
ωn = n. 2 π = n.∆ω
te
=c
Mean value of fT(t) in the range [0, T]
0
T
T
t
∋
Fourier serie approximation of the function: fT(t) , t [0, T] te
fT(t) = c
vm
+ Wave 1 + Wave 2 + Wave 3 + Wave 4 + ... a1 cos(ω1.t) + b1 sin( ω1.t)
ω1 = 1. ∆ω
... a 2 cos(ω2.t) + b2 sin( ω2.t)
ω2 = 2. ∆ω a 3 cos(ω3.t) + b3 sin (ω3.t)
ω3 = 3. ∆ω
The Discrete Fourier Transform of fT(t) is defined as the complex function:
ωn) = F( T
a n - i bn 2
T
,
- 8 <
ωn <
+
8
where a n = a(ωn) and bn = b(ωn) are real functions representing the waves coefficients. F����� 2: D������������ ���� ���������� ����� �� � �������� �(�), ������� �� �� �������� �0, T� �4�.
A���������, �� ���� ���� ���� ��� ������������ a n ��� bn �� ���� ������ � ��� �� ���������� ������� ���������� ������������ �������� (������������ ����� ��� ������� �� ���� ����� �� � �������� �� � ����� ��������) ��� ���� ��� ������� �� F������ T�������� ��� �� ����������, �� ������ �����, �� ��� ������ �� ��� ���������� �� ������ a n ��� b n ���� � ������ (�������!) ������ �� ��� ���� (a n -i b n )T / 2 . A�������, a n
= a(ωn )
��� bn
Produced by The Berkeley Electronic Press, 2012
= b(ωn )
��� ���� ��������� �� � �������� �������� ���
3
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
F������ T�������� F(ωn ) = (a n − i bn )T / 2 �� � ������� �������� �� � �������� �������� (D������� F������ T�������� � DFT). U������, ���� ������������ ������� �� ��������� �� ��� ����� ����� �� ���� ������� ��� ����������� �������, ��� �� �� ��������� �� ��� �������� �� � �������, ���� ����� � ������������� ������������� �� ����� ��� �� ������� �� ���������. T��� �������� �� ������������ ������� �� ���� ��� ����� � ���� ������� ���� ���� �� ��������� ������� �� ���� �3�. I� �� ��������� ��� ��� �������� �� ���� ��� ������� ���� ��� �� F������'� ��������� ��� �� �� ���� �� ������� �� ����������� �� � �����������, �� ����� �� ���� �� �������� �� ��������� � �������� ��� ��� ������������� �� ����� �� � ������� ���, ��� �� ���������� �� ���� �� ����� ����� ��������� �� � �������� ����. T��� �������� �� ��������� �� ��� ������� ����. F������, �� ��� ������� ����� ���� ����������� �� ������, ��� ���������� ���� �� ����� ����������� ����� �������� � �� � ������ ������ �������� T �� � ������ � F������ ������ � ������������� �� ��� ��� �� � �������� ��� �� � ��� �� �������� ���������� ������� ���� ������� ����� �� T ��� �� ��� ������������ T, T/2, T/3, T/4, ... H����, ����� ��� ����� ���� ���������� ����������� ����� ��
1 , T
2 , T
3 , T
10 , T
...
...
(�� H�)
(2)
�� 2π T
C���������� ∆ω =
,
2.
2π T
,
3.
2π T
,
...
10.
2π T
, ...
(�� ���/�)
(3)
2π , ��� ����������� �� ��� ��������� ������� ��� ������� �� T
�������
ω1= ∆ω, ω2= 2∆ω, ω3= 3∆ω, ω4 = 4∆ω, ... ωn = n∆ω
(4)
T��������, ��� ���������� ������������� �� ��� �������������, �� � F������ ������, �� � ����� �������� �, �� � ������� �������� �� ������ T, ��� �� ������� �� ������� ����� �� �������
fT (t) = c + wave 1 + wave 2 + wave 3 + 123
ω1 =∆ω
123
ω2 = 2 ∆ω
123
ω3 = 3 ∆ω
...
+ wave n + ...
(5)
1 4 2 4 3
ωn = n ∆ω
I� ���� ����������, ���� ���������� ���� (����� ��) ��� �� ������� �� ��� ������ ����������� �� ������������� ��������� (������ ��� ����), �.�.,
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
4
Oliveira et al.: Fourier Analysis with Excel
wave n = a n cos ( ωn t ) + b nsin ( ωnt )
(6)
���
f T (t) = c +
+
wave 1 1 2 3
a1 cos ( ω1t ) + b1sin ( ω1t )
+
wave 2 123
a 2 cos ( ω2 t ) + b2sin ( ω2t )
+ ...
wave 3
(7)
123
a 3 cos ( ω3 t ) +b3sin ( ω3t )
T�� ��������� ����� �� �� ���� ��� �� ��������� �������� � ��� ��� ������������ � � ��� �� �� ��� ������� �����, ����� ���� �� �������� �� ����������� � ����� �������� � �� � ������� �������� [0,T ] . ��� ������������� �� ��� �������� �
I� ��� �������� ����������, �� �� �������� �� ��������� �������� � ����� ��� ������� �� ���� ����� �� � �������� �� �� �������� (������ 3). T�� ���� ����� �� � �������� �� �� �������� �� ������ T ����������� �� ��� ������ �� � ��������� �� ���� T, �� ����� ��� ���� �� ����� �� ��� ���� ����� ��� �������� �� ��� ��������� ��������
vm
= f (t) T =
vm . T =
f
1
T
∫ f (t)dt
(8)
T0
A =
vm = 1
T
A
f = f(t)
A
vm
0
T
t
F����� 3: U�� �� ��� ������� �� �������� �� ��������� ��� ���� ����� �� � �������� �� �� �������� [ 0,T ] .
I��������, F������ �������� ���� ��� �� ��� ������� �� ��� ������� ����� ����� ������������ �� T, ��� ���� ����� �� ���� ����� �� �� �������� T ��� ���������� ����, �.�., wave n T = 0 ���� � = 1,2,3 � T���, f T (t)
T
Produced by The Berkeley Electronic Press, 2012
= c T + wave 1 T + wave 2 T + wave 3 T + ... 1 4 24 3
1 4 24 3
1 4 24 3
0
0
0
(9)
5
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
T��������, ��� ����� �� �������� (�) ���� �� ������� ����� �� ��� ���� ����� �� �������� �(�) �� �������� T, �.�., T
c = f (t)
T
1 = f (t)dt T0
∫
(10)
��� ������������� �� ��� ������������ �� ��� ��� ��� ���� ���� �
T� ��������� ��� ������������ �� ����� 1�, �� �� ������ �� ���� ���� ���� ��� ���� ����� �� [0,T ] �� ���� ���� ���������� �� cos(ω1t) �� ������ ����, ������ ��� ��� ���� �� ��� ���� ����� 1�. T���,
f T (t).cos ( ω1.t )
T
= c.cos ( ω1.t ) T + wave1.cos ( ω1.t ) T + wave2.cos ( ω1.t )
T
14 4 244 3
144 4 2444 3
0
0
+ ...
(11)
�������� f (t).cos ( ω1.t )
T
= wave1.cos ( ω1.t )
(12)
T
�.�., f (t).cos ( ω1.t )
T
= a1.cos ( ω1.t ) + b1sin ( ω1.t ) .cos ( ω1.t )
T
(13)
����� ����� �� �������� �� ������ f (t).cos ( ω1.t )
= a1.cos2 ( ω1.t ) T + b1.sin ( ω1.t) .cos( ω1 .t) T
= T
144 244 3
1444 4 24444 3
a1 /2
0
a1 2
(14)
����������� ���� ��� ���� ����� �� �������� ���2(�) �� �������� [0,2 π] �� ��������� 1/2 (��� ������ 4).
Mean value: 0.5
Figure 4: Graphic representation of function cos (t) and of the corresponding mean value in the interval �0,2π� 2
( vm = 1/ 2 ). T���, �� �� �������� �� ������ ����������� �1 �� ��� ������ �� ��� ���� ����� �� �0,T� �� �������� �(�) ���������� �� cos(ω1t) , �.�., T
a1 = 2. f (t).cos ( ω1.t )
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
T
=
2 f (t) cos(ω1 t) dt T0
∫
(15)
6
Oliveira et al.: Fourier Analysis with Excel
L�������, ��� ���� ����� �� �0,T� �� ���� ���� ���������� �� sen(ω1t) �� ���� ���������� ����, ������ ��� ��� ���� �� ���� 1, ����� ����� ��� ����������� �� ����������� �1 , �� � ������� ������ �� ��� ��� ���� ��� ����������� �1. T��������, �� ��� �������� ���� �� ������ �� T
b1
2 f (t) sin( ω1t) dt T0
∫
= 2. f (t).sin ( ω1.t ) T =
(16)
B� �������� ���� ��������� �� ��� ���������� �����, �� ��� ������ �������� ���� ��� ������������ �� ��� �� ��� �� ���������� ������� ����������� ������� �� ��� ������ ����. F������ ��������� ���� ���� ��� ������������� �� ��� ������������ �� ��� ������� ����� �� ��� ������ �� ������ ���� � ������ �� ����������� ��� ���� ������!
I� �����, �� ��� �������� ���� ��� ������������� �� � F������ ������ �� � �������� �, �� � ����� �������� �� ������ T, ��� �� ����������� (�� ��� ������������� ����) �� ��� ��������� ������ (��������� �� �������� �����) f T (t) = c +
∞
∞
∑ wave n = c + ∑ (a n =1
n =1
n cos ( ωn t ) + b n sin ( ωn t ) )
,
ωn = n ∆ω , ∆ω =
2π T
�� ����� ��� ������������ ��� �������� ������� ��� ��������� ��������
c = f (t)
T
=
an
= 2. f (t).cos ( ωn .t ) T =
bn
= 2. f (t).sin ( ωn .t ) T =
1
T
∫ f (t)dt
T0 2
T
∫ f (t) cos(ω t)dt n
T0 2
, n = 1, 2, 3, ...
T
∫ f (t) sin(ω t)dt
T0
n
, n = 1, 2, 3, ...
��� ������� ���� �� �������� � ������ ��������� ��������� ����� �����������
L�� �� �������� �������� �(�) ������� �� �������� T = [ 0 , 5] , �� ������ � = 5
t , 0 ≤ t < 2.5 f (t) = 1 , 2.5 ≤ t ≤ 5
(17)
T� ������ ��� ������������� �� ���� �������� ������� � F������ ������, � ������������� ����������� ��� �� ���������, ����� ���� ���� �� ��������, ��� ���� ���� �, �� ��������� ������������� ��� ������ �� ωn , � � � � � . F����� 5 ����� ��� ����������� ��������� �� E����. A ����� �� ������� ���� ��� ������ �� (�, �(�)) ��� ���� ��� ������� �� ��������� f (t) cos(ωn t) ��� f (t) sin( ωn t) . O� ���� �� ��� ���� ���� ��������� � ���� �� �������� �� T ��� ������� ��� �� ∆ω : ∆ ω = 2π / T . F�� ���� ���� � (�� ����� ��� ����� �� ���������� �� ���� D5), ��� ����� �� ωn : ωn = n ∆ω �� ����������. S���� a n = 2 f (t) cos(ωn t) ��� bn = 2 f (t) sin(ωn t) , �� ���� ���� �� ���
Produced by The Berkeley Electronic Press, 2012
7
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
�������� ��������� �� E����, ����� ����� �� �������� �� ��������� ��� ���� ����� �� � ��� �� ������.
Figure 5: Application developed in Excel: Fourier_movie.xls.
F����� 6 ����� ��� ������� �������� ����� ����� ��� ����������� ����� ��� ����� 1, 2, 3 ��� 10. Mean value vm
vm ∼ 1.1251
vm 0
Wave n = 1
a 1∼ -0.5066
( Period T )
b1 ∼ 0.1590
T=5
0
T
Wave n = 2
a 2 ∼ 0.0025
( Period T ) 2
b2 ∼ -0.3975 0
T
Wave n = 3
a 3∼ -0.0567
( Period T ) 3
b3 ∼ 0.0530 0
T
Wave n = 10
a 10∼ 0.0025
( Period T ) 10
b10 ∼ -0.0795 0
T
t
t
t
t
t
Sum of waves 1 to 10 0
T
t
Figure 6: Results obtained by using the application Fourier_movie.xls.
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
8
Oliveira et al.: Fourier Analysis with Excel
T� �������� ��� �����������, �� ���� �� ������ �� ��� � ������� ������, �����, ����� ��������, ���� ���� ��� ����������� �� ����������� (�� � �����) ��� ������������� �� ��� �������� �� ��� �� �����. F����� 7 ����� � ����� ����� ������� ����� �������� ��� ������ " ������� ������������". I� ��� ���� ������ (������ �), � ������� �� �� �� ���������� ��� ����������� ��� ��� �� ��� ������ �� ��� �������� �������. F�� ��� �������, ��� �������� S�� �� E���� �� ����. B� ������ ��� ���� ������ �� ���� �� ��� �����, ��� �������� ������������� ���� �� ��������, ����� ���� ���� �� �������� �� ������ �� ����������� ���������.
=I$3*COS(I$2*$G6)+I$4*SIN(I$2*$G6) Figure 7: Approximation of functions using Fourier series ( Fourier_movie.xls).
F����� 8 ������� ��� ������������� �� ��� �������� �(�) �� ������� F������ ���� �� 5, 10, 20 ��� 50 �����.
Produced by The Berkeley Electronic Press, 2012
9
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
3.0
3.0
2.5
2.5
5 waves
2.0
2.0
1.5
1.5
1.0
1.0
0.5
0.5
0.0
10 waves
0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
0.0
3.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
3.0
2.5
2.5
20 waves
2.0
2.0
1.5
1.5
1.0
1.0
0.5
0.5
0.0
50 waves
0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
Figure 8: Approximation of the function f(t) by partial Fourier sums ( Fourier_movie.xls).
� ������� ������ �� ������� ����� �������� ������� ��������� ��� ���� ������� ������ �� ������� ���������
T�� ���������� ���������� ������� ��� ��������� �� ��� ����������� �� � �������� �� � F������ ������ (�������� ������� �� �� �������� �� ������ T) f T (t) = vmed + wave1 + wave 2 + wave3 + ... = v med +
+∞
∑ (a n =1
n
cos ( ωn t ) + b nsin ( ωn t ) )
(18)
����������� �� ��� ��������� ������������� ���� �� F������ ������. A� ���� �����, �� ���� ������� ���� ���� ���������� ��� �� ������� �� � ���� ������� ���, ����� ��� ������� �������������� �� ������ ��� ���� ���������, ���� ��������� ��� ��������� �������������� �� F������ ������ �� ��� ������� ����. I�����, ����� E���� ������� eix = cos x + i sinx , �� ��� �����
cos(ωn t) =
eiωn t
+ e − iω t n
sin(ωn t) =
and
2
−ieiω t + ie −i ω t n
n
2
(19)
���������, ����� �� ����� �����������, �� ��� ������ ��� �������� ���������� ������������� �� ��� ������� ���� �� F������ ������. I� ����,
eiω t + e− iω t −ieiω t + ie− iω t f T (t) = v m + ∑ a n + bn 2 2 n =1 +∞
f T (t) = v m +
n
+∞
∑ n =1
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
n
an − i bn 2
n
e i ωn t +
n
an + i bn 2
e − i ωn t
(20)
(21)
10
Oliveira et al.: Fourier Analysis with Excel
f T (t) =
a0 − i b0 2
e i ω0 t +
+∞
∑
an − i bn 2
n =1
e i ωn t +
−1
∑a
n =−∞
n
−i bn 2
ei ωn t
(22)
�����, �������� ��� ���� � = � ,�3, �2, �1, 0 ,1, 2, 3, � , �� ��� �� ���������� �� �������:
− i bn
∞
∑a
f T (t) =
n
2
n =−∞
e iωn t ,
− ∞ < ωn = n.∆ω < +∞
(23)
����� ���������� �� ������� ���� �� ������� ������. C���������� ��� �������� ����������� ��� �� ��� �� , �� ��� ������� ���� a n − i bn 2
T
1 = fT (t)e −i ωntdt T0
∫
(24)
I�����, ����������� ��� ���������� �� �� ��� �� , �� ���� a n − i bn 2
T
T
1 1 = f (t).cos(ωn t)dt − i f (t).sin(ωn t)dt T0 T0
∫
a n − i bn 2
∫
(25)
T
1 = f (t).( cos(ωn t) − i.sin(ωn t)) dt T 0 144424443 −i ω t
∫
e
(26)
n
�.�., a n − i bn 2
T
1 = f (t) e−i ωn t dt T0
∫
(27)
�� ������� ��������� �� D������� F������ T�������� �� ��� �������� �(�), �� ��� ������ �������� �� ������ T, ��� ������� �������� FT (ωn ) (�������� �� � �������� ���� ��������,
ωn ) ����� �� T
∫
FT (ωn ) = f T (t)e− iω n t dt ,
− ∞ < ωn = n.∆ω < +∞
(28)
0
or FT (ωn ) =
an
− i bn 2
− ∞ < ωn = n.∆ω < +∞
.T ,
(29)
S�, FT (ωn ) �� � ������� �������� ���� ���� ���� a(ωn ).T / 2 , ��� ���������
���� −b(ωn ).T / 2 . H����, ��� ������� �������������� �� ��� D������� F������ T�������� FT (ωn ), �� � ����� ���� �������� f T (t) , ���� ������ �� ����� �� ��� ������, ��� ��������������� ������� ��� ��� ����� �� ��� ���� ���� ����� Re ( F(ωn ) ) = a(ωn )T / 2
(����
��������);
��� ��� ��� ����� Im ( F(ωn ) ) = −b( ωn )T / 2 (��� ��������).
Produced by The Berkeley Electronic Press, 2012
��
���
���������
����
�����
11
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
��� ��� �� ������������� ������� �� ������� �������� ������� ���������� �� ��������� ������� ���� ��������� �� ������ ������ �
���� ��� ��� �� �� ��������� � ����� �������� ������� �� � ���� �������� �� ������ T ���� ���������� ����� (��� �������� �� ��������� ������� �� � �����, ����������� � ������� �������������� �� ��� ���� ��������), ��� ����� ��������� �� �� ��� ��� �� ��� ������� �������� ��������� �� ��� ������ (���� �������� �� ����������� ��������), ���� ������������� ������� (����� �� �� ��������� ���� ����� ������������� ����������, ���������� �� F��� F������ T�������� FFT) �� ��������� D������� F������ T���������. T��� ���� ������ �� �� ����� ��� ���� ��������� ��������� (��� ���� ��������� �� ������������� �����), ��������� �� ��� �������� ���������, ����� �� ����� �� ��� ������ ����������� �� ��� �������� �������� �� ��� �������� ���������� �� ������������ �� ��� �� �� F������ ������. A� ������������ �� 3.1, ��� DFT �� � �������� ������������ ��� ������ �� ������������ �� ��� �� �� ���� ������������� ����������� ���� ���� � ������ (�������) ������ �� ��� ���� FT (ωn ) = ( a n − i bn ) .T / 2 . T��������, ����� �� ��� ��������� �� ��� ������ �� ��� D������� F������ T�������� FT (ωn ) �� � ����� �������� �, �� ��� ������ ������ ��� ������������ �� ���� �� ��� ������� ���������� ����� ����������� ��� �������� (����� �� ��������� ωn = n.( 2π / T ) , � = 1, 2, 3 �), ������� ��� ��������� ���������
an
=
2Re ( FT (ωn ) ) T
and
bn
= −
2Im ( FT (ωn ) ) T
(30)
I� ���� �� ��� ��������� ������������� ������� ��������� �� ��� ������ �� ��������� DFT, ��� ���� ���� ��� �� �������� ��� ������ �� ������ ���� �� ��� ��������������, NP (���������, ��� �������� ������� ��� NP �� �� ������� � ����� �� 2: ��� ��������, 128, 256, 512, 1024 �) ��� ���� ��� ���� �� ������� ���������� ����� ��� ��� ������� �������������� �� ������, �.�., ��� ������� ��������� ������� ∆� = 1. T��� ����� ����, �� ��� ���, ��� ���� ���� ������� ��� NP ������ �������� ��������� ��� FT (ωn ) = ( a n − i b n ).T / 2 , �� ����������� ���� �� ��� ����� ����� �� ∆� (N���: �� ���� �������, ��� ����� ���� �� ��� ������� NP ������ ���������� ��� FT (ωn ) ����������� �� �������� ω� (0, ∆ ω , 2∆ ω , 3∆ ω , � , (NP / 2)∆ω ) ��� ��� ������ ���� �� ������ �� ω� ��������� �� ��� ������ ���� (� (NP / 2)∆ω , � , �3∆ ω , �2∆ ω , �∆ ω ). H����, ��� ������� ����������� ����� ��� ����������� ����� �� ��� �������� �� �������� ���������� �� ��� ����� ���� �� ��� ������� ������ ���������� ��� FT (ωn ) . F����� 9 �����, �� �� �������, ��� ��� � ����������� ��� �� ��������� �� ��������� ��� D������� F������ T�������� ���, ����, �� ����� ��� F������ ������������ ������������� �� ��� ������� ���������� ����� ����������� �� � �������� �(�) ������� �� � �����.
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
12
Oliveira et al.: Fourier Analysis with Excel
Figure 9: Approximation of functions. Discrete Fourier Transform.
3.3 ���� ������� ������ �� ������� ��������� ���������� ������� ��������� ���
������� ���������
A� � ������ �� ��� �������� ���������� �� D������� F������ T�������� FT (ωn ) , ��� ������������� �� � �������� f T (t) , ������� �� �� �������� �� ������ ������ T, ��� �� ����������� �� � F������ ������ �� ��� ������� ���� fT (t) =
1 ∞ FT (ωn ) e iωn t , T n =−∞
∑
ωn = n.∆ω , ∆ω =
2π T
(31)
U���� ���� ��������, ��� ����������� ���� 1/ T = ∆ω / 2π , �� ��� ����� ��� ������������� �� fT (t) �� � ������� F������ ������ �� ������� f T (t) =
Produced by The Berkeley Electronic Press, 2012
1 2π
∞
∑ F (ω )e T
n
i ωn t
∆ω
(32)
n = −∞
13
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
���� T→ ∞ (�� ��� �� ��� � ������ �������� �� ��� ���� ��T/2, T 2�, ����� ����� �� ��∞ , +∞� ) ��� ������ � �(�) �� ������� �� R , ��� ∆ ω ����� �� � (∆ ω→�ω). T�� �������� �������� ω� ����� �� � ���������� �������� ω (ω� →ω), ��� ��� ��������� ������ ������ ���� ��� �������� �� ��� �������� ������ ( ∑ → ∫ : ���� �� �������� ������������� ������� �) ������� ���� f(t) =
1
+
2π −
+∞
F(ω).e
iωt
dω ,
with
F(ω) =
∫ f (t) e
− iω t
dt
(33)
−∞
��� ��������� C��������� F������ T�������� �� ��� �������� �(�) ���� �� �� R. L�����, �� �� ����������� � ������ ���� ��� L������ ��������� ��������� ���� �� ����� ������������ ��������� � � �� ���� �� � �������������� �� F������ T�� �����, �� ����� ��� ���� ��������� �ω �� �������� �� ��� ������� � = σ + �ω. O� ��� ����� �� ���� ����������, ���� � �������� ����� �� ������� �� M�������� � ��������� ��� ����������� ��� ������� �� L������ ����������, �������� ���� ��� � ������ �� ������ ���������� ��.
� ��� �� ������� ������ ��� ��� �������������� �� ����������� � �������� ������������� �� ������������ ���� ���������� ����� K��� ��� ������� ��� ������� � ��������, ������� �������� ��� ����������� �� �������� ������������ ����� �� ����� ������������ ���������, �� ���� � ������ ����������� �� ��� ����� �� �� ������������ �������, �� ����� �����. L�� �� ������, ��� ����� ��, ��� ������������ �������� �� ��� ����� � ��������� �� � ����� ����� �� � ���������� �������� ���� � 5 �� ���� ��� 8600 N/� ��������� (� ������������� ������� ����� ���� ��� ����������� ������ �������� �� �5�). ���� � ����� ��������� ��� ��� � ������ ����������� ������, �� ��� ���� � ������ �� ��� ���������� ������������� (��� ������ 10). T�� ������������� ���� ������� ��� 15 � ����� � ������ ��������� �� 51.2 ������ ��� ������ (512 �� 10 �), �� � ����� �� � ���������� �������� (���������� ������������� �������� �� ����� �� ��, ��������� �� ��� ����� ��������� ���� ����), ����� ���� ������� �� ��� ������ �� �� ��������� ����� ����� �� ����������� � �������� (������, ��������, ���.).
Figure 10: Scale model of a 1 1-storey building and a record of horizontal accelerations due to environmental excitation.
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
14
Oliveira et al.: Fourier Analysis with Excel
O� ��� ����� �� ��� ������������ ����� �� ��� ������ �����, �� �� ��� �������� �� ������ ����������� ����� ��� ������� ��������������� �� ��� ���������; �� ��� ���� ����� ���� ������ ��� ����������� ���� (15 �), ��� ��������� (����� �����) ��������� ���������� �������������, ���� ������� ������ �� ����� 0.03 ���2. F�� ��������, �� ����� �� ������ �� ������ ����������� ����� ��� ������� ���������
ωN �� ��� ���������. I� �� �������� �� ������ ������� ����������� �� ��� ������ �� �������� ���� ����������� ����� ��� ������� ��������������� �� ��� ���������? C������, ��� �������� ������������� ��� ����������� ���������� �� ��� ���������� ��������������� �� ��� ��������; �� ������� ��������, ����� ��� ���� ���������� ����������, ��� ���� ��������� ���� ��������������� ���/�� ���������, �� ����� ���� ��������� ������ � ��������� ������������ ������! T��� ����� �� �� �������, ���� ���� ���������� ������ �� ������ �� ������� ���� ������� ����������� ����� ��� ���������. T�� ������ �� ���� �� ����� �� �������� �� ���� ������ �� ���� ����������� �� ��� ������������ �� ���������� ���� �����, ����� F������'� �������. F����, �� �������� �� ��� ����������� ��� ������ �� ��� ��������� ��������, �� ����� ������ (�� ���� ����, ��� �������� ����������� �� ��� ������������� �������� ���������� 15 �): �� � ����� ������ �� ������� ��� ������ �� � ��� �� � ������ ������ ��� ������ �� ��� �������� �������������, ����� �����������, �� ���� ����, �� 768 ����� �� �������� ������ ����� 51.2 ������������ ������ ��� ������ ���� ��������, ��� � 15������� ������. U���� ��� ����������� ��������� �� ������� 2.3, ������������ �� ��� �� , �� ���� �� ��� ���� �����, ��� ������������� �������� (F����� 11). R�������� ���� ��������� ��� ��� ���������� ����� (� V����� B���� ������� ��� �� ����) ����� �� �������� �� ��� ��� ������ �� �� ��� �� ��� ��� �����. T�� ������ ���������� A� ��� ���� �������� �� ����� �� ��� ��� A�������� S������� (������ 12), ���� �� � �������� �� ������ ����������� (�� ������/� �� H�; 1 H� = 2π ���/�). T�� �������� �� ��� ��������� ��������, ���� ����, ���� ����� ��� ������� �����, ���� ����� ��� �������� ������������ ��� �� ����������, ��� ��������� ���� �� ������������� 6.733 H� ������� ������ ��� ��� �� ��� ��������� � ��� ��������� �������� �������� � ���� ���� ������� ���� �� ��� ��������� 6.733 H�. I�����, ���� ������ �� ��� �������� ���� ������������ ����� ��� ���������, ����� ����� ��� �� �������� ������� ��� ������ �������� �� ��� �������� ������������ (���� �����): ��� �������� ���� �� ��� S������� �� ���������� ����� ���� ��� F������ ��������� ����� ��� ����������� �� ����������� ��������� ���� ������ �� ���������� ����� ����� ��� ����������� �� ����������� �������������� ��� ������� ��������� �� ��� ����� �� ��� ���������� �������� ������: �� ���� ����, ��� ������� ��������� ���������� �� ωN = 6,733 Hz . T��� ��������� �� ������������� �� ��������� ���� ���������� ����� �� ��������� � ������������ ���� �� ����������� ��������� ��������, �����, �� ��������, ��� � ������ ����������� �� ����� ����������� ��� �� ���� ����� �����, ���� �� ��������, ���������, ���������, ������������������, ����� ����������, ���.
Produced by The Berkeley Electronic Press, 2012
15
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
Figure 11: Decomposition of an accelerogram into waves. Organization of a spreadsheet to compute Fourier coefficients using the average function, with a sub routine in VisualBasic to calculate the amplitude spectrum (Spectrum.xls).
Figure 12: Measured accelerogram and corresponding amplitude spectrum: the wave amplitudes forming the measured accelerogram are represented as a function of the corresponding frequency (cycles/s or Hz).
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
16
Oliveira et al.: Fourier Analysis with Excel
O��� ��� ��������� ��� ���� ������ �� ��� �������� ����� ��� ����������, �� ��� ��������� ������������ ��� ����� �� ��� ������� ���������, ����� ���� ��������� �� ��������� ��� ����� �� ���������� k / m ��� �=8600 N/� ��� �=5 K�, ����� ����������� �� ��� ����� �� ��� ������� ���������. T�� ����� �������� �� 6.60 H�, ����� �� ������������� ����� �� ��� ��� �������� ��������������.
5 ����������
T�� ��������� ���������� �������� �� ��� F������ �������� ������ �� �� ���� ��� ��� ������������� ��������� ��� �� ���� �� ���������� � ���� ����� �� � ������������ ����� ���� �� ��������� �������� �� ��� ����������� �������� �� ��� ����������� ��� ������� �������. I� �� � ����� ����� ������� �������� �� ��� ����������� ����������� ������� ����������, �������, ����������� ��� ���� �� ��� ���� ������ ������� ����� ���� ������: ������������� ��� ����������� ���������, ���������, E������ ������� ��� ������� �������, ������, F������ ��� L������ ����������, ��������� �������, ���. I� �� �������� � ����������� ����� ���� �������� ��� �������� ������ ������ ���������� �� ��� ����������� �� ����������� ������������� ������������ ���� ������� �������, ������ ����, ���������� �������� ��� ����������. A� ���������� ��������� �������������� �� ��������� �� ���������� ��� F������ ������ ��� ���� �� ����������� ��������� ������� ���� � ������ �������� (�������������� ������� � ��� �� �������� ����� ���� ���������� ������������). T�� ������������ ��������� �� ��������� ����������. I� �� ����� ���� ���� �� ��� � ������ ������������� �� ��� ������� �� ��� ���� �� ��� ��� ������ ��� ���������� �� ��� ����������� ����: ����� ���, ��� ������������ �� ��� F������ ������ ��� �� �������� �� ������ ������� ������, ������ ��� �� ��� ��������� �������� E���� ��������! T����� ��! I� �� ����� �� ������ ��� �� E���� ����������� ��� �� ��������� �� ������� (������ VBA �����������) ��� ��� ����� ������������ �� ��� F������ ������ ���� ������������ ��� �������� (���� ��������� ��������������) ������� ���� � ���� ������ ��������. T������ �� ��������� �������� �� ��� ��������� ������������� ����������� �����, ��� ��� ����� ��������, ����� ��� ��� �������� ��� �� ������������ ����������� ��� ������� ��� �� ��� ����� ��� ����� �� ��� ������������� F������ ������. L����� �� �� ����� ��� F������ �������� ��� �� ���� ���� � ��� �� ������������ ����. T�� ���������� �� � ����� ����� �� � 1������ �������� ���� �������. T�� �������� ������������ ������ (��������� ����� �� ������������� ��� � ���� ����������� ������) ��� �������� ���� ��� E���� ����������� �� ������ ��� ������������� ��������� ��������. A ���� ��� ������� ���������� �� � ��������� ���� ����������� �� ��� �� ��� ���� ���������� ���������� ���� �� ����� ��������� �� ������ � ������� ��������� ��������: ��� ������� ��������� �� ��� ����� ��������� ���� �� ��� ��������.
Produced by The Berkeley Electronic Press, 2012
17
Spreadsheets in Education (eJSiE), Vol. 5, Iss. 2 [2012], Art. 2
���������� �1� A����������, D. (2005). E�������� M����������� G�������� D������� �� E���� ������� A��������. ������������ �� ��������� (�����)� V��. 2: I��. 1, A������ 8. A�������� ������ �� ����:/�������������.����.���.��/�����/���.2/���1/8/. �2� D�P����, R. (2000). E��������� D����������� E�������� ��� B������� V���� P�������. ���� ����� & ����� ���� �3� S��������, A.I., C�����, N., R�����, T., S������T����, M., F����������, A. ��� M�������., H., T�����, M., M�����, L., P���������, E. (2010). T�� I�������� ��� S������ �� D������ T����������� �� ��� L������� � ��� L������� T����������� � �� M����������� C�������, �� ����������� ��������� ��� ���������� � ���������� ��� �������� ��� ���� ���� ������ 179�226, S������� 2010 � C���� H����� ��� J���� B������� L������� (���). �4� O�������, S. (2007). M���������� ������� �� C���� E���������� (�� P���������). ����://�����.������.���/����/��������2/������. �5� O�������, M., N������, S. (2010). U���� � S���������� �� ����� ��� ����������� �������� �� � ����������� ������. ������������ �� ��������� (�����) , V��. 3: I��. 3, A������ 2. A�������� ������ �� ����:/�������������.����.���.��/�����/���3/ ���3/2/. �6� R�������, G., J��������, �. (2011). T�� ��� �� M�������� E���� �� I��������� ���� M����� ��� F��������� D���������� �� F���� ���� P������ C������. ������������ �� ��������� (�����)� V��. 4: I��. 3, A������ 5. A�������� ������ �� ����:/�������������.����.���.��/�����/���4/���3/5/. �7� S�����, S. (2011). T�� ����������� ������� �������. ������������ �� ��������� (�����)� V��. 5: I��. 1, A������ 2. A�������� ������ �� ����:/�������������.����. ���.��/�����/���5/���1/2/. �8� ����������, J. (2004). E���� 2003 P���� P���������� ���� VBA. ����� ���������� ���� ���� ���� ����� & ����� �9� ������������, �.A.L. (2008). M��������� A�������� ���� E����'� S����� S��� I�������� E���������� �� L�������� F������. ���������� ������� �� ������������ �� ���������� A�������� ������, ����:/�������������.����.���.��/�����/���3/���1/4/.
http://epublications.bond.edu.au/ejsie/vol5/iss2/2
18