Fourier Transform - Ram Gautam

advertisement
Guided Research-Fall 2013
Fourier series and Fourier Transform
Advisors:
Dr. Jonas Meyer
Dr. Clark T. Merkel
12/14/2013
Loras College
By Ram Gautam and Jacob Hertel
1
Table of Contents:
S.N.
Content
1
Introduction
2
Fourier series
3
Odd and Even Function
4
Examples
5
Experimental verification of Fourier Series
5
Fourier Transform
6
Discrete Fourier Transform
7
Fast Fourier Transform
Examples
8
Dominant Frequency of Sound Waves
9
Dominant Frequency of Seismic Waves
10
Work Citations
Page No.
2
Introduction:
Fourier series and Fourier transform is a guided research topic worked under the
mentorship of Dr. Jonas Meyer and Dr. Clark T. Merkel. The goal of this research is the
Fourier analysis of vibrating signals. The vibrating signals can be periodic, non-periodic,
continuous, and discrete. At the end of the research the following problem statements will
be addressed:
-
Experimentally verify the Fourier series (square wave only).
Determine the dominant frequencies of a sound wave.
Determine the dominant frequencies of seismic wave.
Fourier series and Fourier Transform is completely a new topic for us. After completing
this research we will learn about Fourier series, Fourier Transform, Discrete Fourier
Transform, and Fast Fourier Transform. We will also learn why Fast Fourier Transform is
used to find the dominant frequency of both sound wave and seismic wave.
Fourier series:
The Fourier series is defined by an offset constant and an infinite series of cosine
and sine terms defined by the integer multiples of the fundamental frequency and a set of
constants.1 In simple language a Fourier series is a series of periodic functions (typically
sinusoids) that represents another periodic function. The mathematical representation of
Fourier series under period 2πœ‹ is given as:
∞
π‘Žπ‘œ
𝑓(π‘₯) =
+ ∑[π‘Žπ‘› cos(𝑛π‘₯) + 𝑏𝑛 sin(𝑛π‘₯)]. − − − − − − − − − − − − − − − − − − − − (1)
2
𝑛=1
Where π‘Ž0 , π‘Žπ‘› and 𝑏𝑛 are known as the coefficient of Fourier series. In order to find the
coefficients π’‚πŸŽ , 𝒂𝒏 and 𝒃𝒏 following integral identity was used:
0,
πœ‹
1.) ∫−πœ‹ cos π‘šπ‘₯ cos 𝑛π‘₯ 𝑑π‘₯ = {2πœ‹,
πœ‹,
π‘š≠𝑛
π‘š = 𝑛 = 0}
π‘š=𝑛≠0
πœ‹
0,
π‘š≠𝑛
2.) ∫−πœ‹ sin π‘šπ‘₯ sin 𝑛π‘₯ 𝑑π‘₯ = {
}
πœ‹, π‘š = 𝑛 ≠ 0
1
Dr. Clark T. Merkel note.
3
πœ‹
3.) ∫−πœ‹ cos π‘šπ‘₯ sin 𝑛π‘₯ 𝑑π‘₯ = 0
We can compute π‘Žπ‘œ over an interval of length 2πœ‹ by multiplying both sides of equation
by 1 and integrating over [– πœ‹, πœ‹].
∞
πœ‹
πœ‹
πœ‹
−πœ‹
−πœ‹
π‘Žπ‘œ πœ‹
∫ 𝑓(π‘₯)𝑑π‘₯ = ∫ 1 𝑑π‘₯ + ∑ [π‘Žπ‘› ∫ cos(𝑛π‘₯) 𝑑π‘₯ + 𝑏𝑛 ∫ sin(𝑛π‘₯) 𝑑π‘₯]
2 −πœ‹
−πœ‹
𝑛=1
=
π‘Žπ‘œ
2
∗ 2πœ‹ = πœ‹π‘Žπ‘œ
We can compute π‘Žπ‘š ,where π‘š ≥ 1 by multiplying both sides of equation 1 by
cos(π‘šπ‘₯) and integrating over[−πœ‹, πœ‹].
πœ‹
∫ 𝑓(π‘₯) cos(π‘šπ‘₯) 𝑑π‘₯
−πœ‹
=
π‘Žπ‘œ πœ‹
∫ cos(π‘šπ‘₯) 𝑑π‘₯
2 −πœ‹
∞
πœ‹
πœ‹
+ ∑ [π‘Žπ‘› ∫ cos(𝑛π‘₯) cos π‘šπ‘₯ 𝑑π‘₯ + 𝑏𝑛 ∫ sin(𝑛π‘₯) cos π‘šπ‘₯ 𝑑π‘₯ ]
𝑛=1
−πœ‹
−πœ‹
πœ‹
= π‘Žπ‘š ∫ cos(π‘šπ‘₯) cos(π‘šπ‘₯) 𝑑π‘₯ = πœ‹ π‘Žπ‘š
−πœ‹
Similarly we compute π‘π‘š , where π‘š ≥ 1 𝑏𝑦 multiplying both sides of equation 1 by
multiplying by sin(π‘šπ‘₯) and integrating over[−πœ‹, πœ‹].
πœ‹
∫ 𝑓(π‘₯) sin(π‘šπ‘₯) 𝑑π‘₯ = πœ‹π‘Žπ‘›
−πœ‹
Finally rearranging all computation we will get the following results:
π‘Ž0 =
1 πœ‹
∫ 𝑓(π‘₯)𝑑π‘₯. − − − − − − − − − − − − − − − − − − − − − − − − − − − − −(2)
πœ‹ −πœ‹
1 πœ‹
π‘Žπ‘› = ∫ 𝑓(π‘₯) cos( 𝑛π‘₯) 𝑑π‘₯. − − − − − − − − − − − − − − − − − − − − − − − − −(3)
πœ‹ −πœ‹
1 πœ‹
𝑏𝑛 = ∫ 𝑓(π‘₯) sin(𝑛π‘₯) 𝑑π‘₯. − − − − − − − − − − − − − − − − − − − − − − − − − − (4)
πœ‹ −πœ‹
Thus using the equations 2, 3, and 4 coefficients π‘Ž0 , π‘Žπ‘› and 𝑏𝑛 can be easily calculated.
4
𝑇 𝑇
But if the limit of integration of equation 1 is changed from[−πœ‹, πœ‹]π‘‘π‘œ [− 2 , 2] then
equation 1 will be:
∞
π‘Žπ‘œ
2π‘›πœ‹π‘‘
2π‘›πœ‹π‘‘
𝑓(𝑑) =
+ ∑[π‘Žπ‘› cos (
) + 𝑏𝑛 sin(
)]. − − − − − − − − − − − − − − − − −(5)
2
𝑇
𝑇
𝑛=1
The variable is changed to the integration variable t in order to show that the limit
of integration of Fourier series can be changed to any periodic limit.
And the coefficients of equation 5, π‘Ž0 , π‘Žπ‘› , 𝑏𝑛 can be computed as using the following
formulas:
𝑇
2 2
π‘Ž0 = ∫ 𝑓(𝑑)𝑑𝑑. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − (6)
𝑇 −𝑇
2
𝑇
2 2
2π‘›πœ‹π‘‘
π‘Žπ‘› = ∫ 𝑓(𝑑) cos (
) 𝑑𝑑 − − − − − − − − − − − − − − − − − − − − − − − −(7)
𝑇 −𝑇
𝑇
2
𝑇
2 2
2π‘›πœ‹π‘‘
𝑏𝑛 = ∫ 𝑓(𝑑) sin (
) 𝑑𝑑 − − − − − − − − − − − − − − − − − − − − − − − −(8)
𝑇 −𝑇
𝑇
2
Frequency components:
Let us suppose 𝑑 represents time then the frequency associated with the
1
fundamental sinusoid in the series is π‘“π‘œ = 𝑇 measured in cycle per second or hertz.
πœ”0 = 2πœ‹π‘“π‘œ =
Now,
2π‘›πœ‹
𝑇
2πœ‹
𝑇
(π‘Ÿπ‘Žπ‘‘/𝑠)
= 2π‘›πœ‹π‘“π‘œ = π‘›πœ”0 . Thus equation 5 will be:
∞
π‘Žπ‘œ
𝑓(𝑑) =
+ ∑[π‘Žπ‘› cos(2𝑛 πœ‹π‘“0 𝑑) + 𝑏𝑛 sin(2π‘›πœ‹π‘“0 𝑑)] − − − − − − − − − − − − − − − −(9)
2
𝑛=1
𝑓(𝑑) =
π‘Žπ‘œ
2
+ ∑∞
𝑛=1[π‘Žπ‘› cos(𝑛 𝑀0 𝑑) + 𝑏𝑛 sin(𝑛𝑀0 𝑑)] − − − − − − − − − − − − − − − −(10)
This equation gives the result of Fourier series components in terms of their
frequencies. The first term in cosine or sine is called fundamental frequency and the other
terms are the harmonics frequencies.
5
Even function:
A function 𝑓(𝑑) is said to be even if 𝑓(−𝑑) = 𝑓(𝑑) for all the values of t which is
symmetric about the vertical axis (t=0) which means that the graph of
function 𝑓(𝑑)remains unchanged after reflecting about y-axis.
πΉπ‘–π‘”π‘’π‘Ÿπ‘’ 1. 𝐸𝑣𝑒𝑛 π‘“π‘’π‘›π‘π‘‘π‘–π‘œπ‘›
From the graph it can be concluded that the symmetrical range about vertical axis
for odd function is zero. Thus we do not need to calculate 𝑏𝑛 . In general,
∞
π‘Žπ‘œ
𝑓(𝑑) =
+ ∑[π‘Žπ‘› cos(𝑛 𝑑). − − − − − − − − − − − − − − − − − − − − − − − − −(11)
2
𝑛=1
∞
π‘Žπ‘œ
𝑓(𝑑) =
+ ∑[π‘Žπ‘› cos(2𝑛 πœ‹π‘“0 𝑑). − − − − − − − − − − − − − − − − − − − − − − −(12)
2
𝑛=1
∞
π‘Žπ‘œ
𝑓(𝑑) =
+ ∑[π‘Žπ‘› cos(𝑛 𝑀0 𝑑) − − − − − − − − − − − − − − − − − − − − − − − −(13)
2
𝑛=1
The coefficients of even function are:
2 πœ‹
π‘Ž0 = ∫ 𝑓(𝑑)𝑑𝑑
πœ‹ 0
π‘Žπ‘› =
2 πœ‹
∫ 𝑓(𝑑) cos( 𝑛𝑑) 𝑑𝑑
πœ‹ 0
𝑏𝑛 = 0
6
Odd function:
A function 𝑓(𝑑) is said to be odd function if 𝑓(−𝑑) = −𝑓(𝑑) for all the values of t which is
symmetric with respect to the origin.
πΉπ‘–π‘”π‘’π‘Ÿπ‘’ 2. 𝑂𝑑𝑑 π‘“π‘’π‘›π‘π‘‘π‘–π‘œπ‘›
From the graph it can be concluded that the symmetrical range about vertical axis
for even function is zero. This means that we do not need to calculate π‘Ž0 and π‘Žπ‘› .Thus the
Fourier series for the odd function will be:
∞
𝑓(𝑑) = ∑[𝑏𝑛 s 𝑖𝑛(𝑛 𝑑) − − − − − − − − − − − − − − − − − − − − − − − − − − − (14)
𝑛=1
The coefficients of odd function are:
π‘Ž0 = 0
π‘Žπ‘› = 0
2 πœ‹
𝑏𝑛 = ∫ 𝑓(𝑑) cos( 𝑛𝑑) 𝑑𝑑
πœ‹ 0
7
Example 1:
𝑓(π‘₯) = |π‘₯| , −πœ‹ < π‘₯ < πœ‹
Calculating π’‚πŸŽ
1 πœ‹
1 πœ‹
π‘Ž0 = ∫ 𝑓(π‘₯)𝑑π‘₯ = ∫ π‘₯ 𝑑π‘₯
πœ‹ −πœ‹
πœ‹ −πœ‹
1 π‘₯2
=πœ‹
2
(from −πœ‹ < π‘₯ < πœ‹ )
=0
Calculating 𝒂𝒏
π‘Žπ‘› =
1
1 πœ‹
1 πœ‹
∫ 𝑓(π‘₯) cos( 𝑛π‘₯) 𝑑π‘₯ = ∫ π‘₯ cos( 𝑛π‘₯) 𝑑π‘₯
πœ‹ −πœ‹
πœ‹ −πœ‹
0
1
πœ‹
= πœ‹ ∫−πœ‹ π‘₯ cos( 𝑛π‘₯) 𝑑π‘₯ + πœ‹ ∫0 π‘₯ cos( 𝑛π‘₯) 𝑑π‘₯
Now using integration by parts:
π‘Žπ‘› = 2 ∗
=
1
πœ‹
1
1
( π‘₯ ∗ 𝑛 sin(𝑛π‘₯) − ∫ 𝑛 sin 𝑛π‘₯ 𝑑π‘₯) (From0 < π‘₯ < πœ‹)
2 cos π‘›πœ‹
( 2 − 1 ) π‘“π‘Ÿπ‘œπ‘š 0 π‘‘π‘œ πœ‹
πœ‹
𝑛
By series approximation we know that cos 𝑛π‘₯ = (−1)𝑛
=
2((−1)𝑛 −1)
πœ‹π‘›2
Calculating 𝒃𝒏
𝑏𝑛 =
1 πœ‹
1 πœ‹
∫ 𝑓(π‘₯) sin(𝑛π‘₯) 𝑑π‘₯ = ∫ x sin(𝑛π‘₯) 𝑑π‘₯
πœ‹ −πœ‹
πœ‹ −πœ‹
1
0
1
πœ‹
𝑏𝑛 = πœ‹ ∫−πœ‹ π‘₯ sin( 𝑛π‘₯) 𝑑π‘₯ + πœ‹ ∫0 π‘₯ sin( 𝑛π‘₯) 𝑑π‘₯ (This is an odd function.)
8
πΉπ‘–π‘”π‘’π‘Ÿπ‘’ 4. 𝑅𝐿𝐢 π‘π‘–π‘Ÿπ‘π‘’π‘–π‘‘
The summation of odd function over certain range like −πœ‹ π‘‘π‘œ πœ‹ is zero. Also the
result in a series of sine terms is expected for the approximation of an odd function. i.e.
𝑓(0) = 0 and 𝑓(π‘›πœ‹) = 0. The same result will be obtained by doing integrations by parts.
Thus 𝑏𝑛 = 0
Hence the Fourier series of the above function is:
∞
π‘Žπ‘œ
𝑓(π‘₯) =
+ ∑[π‘Žπ‘› cos(𝑛π‘₯)]
2
𝑛=1
∞
πœ‹
((−1n ) − 1)
𝑓(π‘₯) = + ∑ 2[
] cos 𝑛π‘₯
2
πœ‹π‘›2
𝑛=1
Let 𝑛 = (2π‘˜ + 1), π‘€β„Žπ‘–π‘β„Ž 𝑖𝑠 π‘‘β„Žπ‘’ π‘‘π‘’π‘“π‘–π‘›π‘Žπ‘‘π‘–π‘œπ‘› π‘œπ‘“ π‘œπ‘‘π‘‘ π‘“π‘’π‘›π‘π‘‘π‘–π‘œπ‘›
∞
πœ‹ 2
((−12π‘˜+1 ) − 1)
|π‘₯| = + ∑[
cos((2π‘˜ + 1)π‘₯)]
2 πœ‹
𝑛2
𝑛=0
Now expanding the above equation:
𝑓(π‘₯) =
πœ‹
2
4
1
1
πœ‹
9
25
− [cos(π‘₯) + cos(3π‘₯) +
cos(5π‘₯) + β‹― … …]
This is the required Fourier series of the given function.
9
Example 2:
𝑓(π‘₯) = {
0 −πœ‹ <π‘₯ < 0
}
1 0<π‘₯<πœ‹
We know that 𝑓(π‘₯) =
π‘Žπ‘œ
2
+ ∑∞
𝑛=0[π‘Žπ‘› cos(𝑛π‘₯) + 𝑏𝑛 sin(𝑛π‘₯)].
Calculating π’‚πŸŽ
1 πœ‹
1 0
1 πœ‹
π‘Ž0 = ∫ 𝑓(π‘₯)𝑑π‘₯ = ∫ 0 𝑑π‘₯ + ∫ 1 𝑑π‘₯ = 1
πœ‹ −πœ‹
πœ‹ −πœ‹
πœ‹ 0
Compute 𝒂𝒏
π‘Žπ‘› =
1 πœ‹
∫ 𝑓(π‘₯) cos( 𝑛π‘₯) 𝑑π‘₯
πœ‹ −πœ‹
1 0
1 πœ‹
∫ 0 𝑑π‘₯ + ∫ 1 cos( 𝑛π‘₯) 𝑑π‘₯
πœ‹ −πœ‹
πœ‹ 0
1
𝑛π‘₯
= πœ‹ ∗ sin
π‘“π‘Ÿπ‘œπ‘š 0 π‘‘π‘œ πœ‹
𝑛
=0
Compute 𝒃𝒏
𝑏𝑛 =
1 πœ‹
∫ 𝑓(π‘₯) sin(𝑛π‘₯) 𝑑π‘₯
πœ‹ −πœ‹
0
1
1
πœ‹
= πœ‹ ∫−πœ‹ 0 sin(𝑛π‘₯) 𝑑π‘₯ + πœ‹ ∫0 1 sin(𝑛π‘₯) 𝑑π‘₯
1
=πœ‹∗ −
cos(𝑛π‘₯)
𝑛
1
= − πœ‹ [cos
=−
=
(−1)𝑛
πœ‹π‘›
πœ‹π‘₯
+
π‘“π‘Ÿπ‘œπ‘š 0 π‘‘π‘œ πœ‹
0
− cos 𝑛]
𝑛
1
πœ‹π‘›
−(−1)𝑛 +1
πœ‹π‘›
But, 𝑓(π‘₯) =
1
π‘Žπ‘œ
2
+ ∑∞
𝑛=0[π‘Žπ‘› cos(𝑛π‘₯) + 𝑏𝑛 sin(𝑛π‘₯)]
=2 + 0 + ∑∞
𝑛=0[
−(−1)1 +1
πœ‹(2𝑛+1)
∗ sin(2𝑛 + 1) π‘₯]
10
1
2
1
1
=2 + πœ‹ [sin(π‘₯) + 3 sin(3π‘₯) + 5 sin(5π‘₯) + β‹― . ]
This is the required Fourier series of the given function.
In summary the Fourier series are used to represent arbitrary periodic functions as
a linear combination of set of complete, orthogonal functions, namely, the set of harmonic
cosines and sine. From the linear combination of sine and cosine we can easily find the
fundamental frequency and harmonic frequency as well.
Experimental verification of Fourier series:
πΉπ‘–π‘”π‘’π‘Ÿπ‘’ 4. 𝑅𝐿𝐢 π‘π‘–π‘Ÿπ‘π‘’π‘–π‘‘
A RLC electric circuit is shown above. We are now trying to show the experimental
verification of Fourier series. This is an experimental setup developed by Rutgers School of
Engineering and Electrical and Computer Engineering. We are now trying to
experimentally verify Fourier series comparing the theoretical and experimental obtained
𝑉0 𝑅𝑀𝑆 values of a square wave.
Theoretical calculation of π‘½πŸŽ 𝑹𝑴𝑺 for the first four harmonics of a square wave:
𝐹𝑖𝑔 5: π‘†π‘žπ‘’π‘Žπ‘Ÿπ‘’ π‘€π‘Žπ‘£π‘’
11
The above square wave can be represented as:
−1,
𝑇
≤𝑑<0
2
𝑇
π‘“π‘œπ‘Ÿ 0 ≤ 𝑑 ≤
2
π‘“π‘œπ‘Ÿ −
𝑓(𝑑) = {
1,
This square wave is an odd function because the function is symmetric about the
origin.
Thus, π‘Žπ‘› = 0
𝑇
2
𝑏𝑛 =
2
2πœ‹π‘›π‘‘
∫ 𝑓(𝑑) sin (
) 𝑑𝑑
𝑇
𝑇
−
𝑇
2
𝑇
2
=
2
2πœ‹π‘›π‘‘
∗ 2 ∫ sin (
) 𝑑𝑑
𝑇
𝑇
0
After mathematical calculation,
𝑏𝑛 =
2
[1 − cos(πœ‹π‘›)]
πœ‹π‘›
But, cos(π‘›πœ‹) = (−1)𝑛
𝑏𝑛 =
2
[1 − (−1)𝑛 ]
πœ‹π‘›
Thus,
6πœ‹π‘‘
10πœ‹π‘‘
sin ( 𝑇 ) sin ( 𝑇 )
4
2πœ‹π‘‘
𝑓(𝑑) = [(sin (
)) +
+
+ β‹―..]
πœ‹
𝑇
3
5
But we know that πœ” =
2πœ‹
𝑇
which is called as angular frequency. Hence the above
equation can be generalized as:
𝑓(𝑑) =
4𝐴
πœ‹
1
∑∞
π‘˜=1 π‘˜ sin(π‘˜πœ”0 𝑑) , where A is the amplitude of the square wave in Volts. The
4𝐴
amplitude was measured 12.55 mv and π‘˜∗πœ‹ gives the peak amplitude of the square wave.
The peak amplitude of the first four harmonic of the input waves are calculated below:
12
When π‘˜ = 1, 𝐴0 =
4∗12.55
When π‘˜ = 3, 𝐴0 =
4∗12.55
When π‘˜ = 5, 𝐴0 =
When π‘˜ = 7, 𝐴0 =
= 15.9 π‘šπ‘£.
πœ‹
= 5.32 π‘šπ‘£.
3∗πœ‹
4∗12.55
5∗πœ‹
4∗12.55
7∗πœ‹
= 3.195 π‘šπ‘£.
= 2.73 π‘šπ‘£.
However the RMS values of these harmonics are calculated below:
General formula: 𝑉0(𝑅𝑀𝑆) =
𝐴0
√2
When π‘˜ = 1, 𝑉0(𝑅𝑀𝑆) =
(15.9)
When π‘˜ = 3, 𝑉0(𝑅𝑀𝑆) =
(5.32)
When π‘˜ = 5, 𝑉0(𝑅𝑀𝑆) =
(3.195)
When π‘˜ = 7, 𝑉0(𝑅𝑀𝑆) =
(2.73)
√2
√2
√2
√2
− − − − − − − − − − − − − − − − − − − − − − − −(15)
= 11.24 π‘šπ‘£
= 3.76 π‘šπ‘£
= 2.25 π‘šπ‘£
= 1.93 π‘šπ‘£
Experimentally calculating π‘½πŸŽπ‘Ήπ‘΄π‘Ί of a square wave:
π‘˜
1
2
3
4
5
6
7
8
9
10
𝑓(𝐻𝑧)
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
𝑉0 𝑅𝑀𝑆 (π‘šπ‘£)
42.2
4.2
121.1
8.5
126
12
197.8
17
103
21.3
In General:
𝑉0 π‘‘β„Žπ‘’π‘œ − 𝑉0 𝑒π‘₯π‘π‘’π‘Ÿ
% π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ = |
| − − − − − − − − − − − − − − − − − − − − − − − −(16)
𝑉0 π‘‘β„Žπ‘’π‘œ
13
Now calculating the percentage error between theoretical value and experimentally
value the following result is obtained:
𝑉0 π‘‘β„Žπ‘’π‘œ −𝑉0 𝑒π‘₯π‘π‘’π‘Ÿ
When π‘˜ = 1, % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ = |
𝑉0 π‘‘β„Žπ‘’π‘œ
𝑉0 π‘‘β„Žπ‘’π‘œ −𝑉0 𝑒π‘₯π‘π‘’π‘Ÿ
When π‘˜ = 3, % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ = |
𝑉0 π‘‘β„Žπ‘’π‘œ
𝑉0 π‘‘β„Žπ‘’π‘œ −𝑉0 𝑒π‘₯π‘π‘’π‘Ÿ
When π‘˜ = 5, % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ = |
𝑉0 π‘‘β„Žπ‘’π‘œ
𝑉0 π‘‘β„Žπ‘’π‘œ −𝑉0 𝑒π‘₯π‘π‘’π‘Ÿ
When π‘˜ = 7, % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ = |
𝑉0 π‘‘β„Žπ‘’π‘œ
11.24−42.2
|=|
| = 275 % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ
11.24
3.76−121.2
|=|
2.25−126
|=|
| = 3123 % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ
3.76
2.25
| = 5550 % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ
1.93−197.8
|=|
1.93
| = 10148 % π‘’π‘Ÿπ‘Ÿπ‘œπ‘Ÿ
There is a dramatic percentage error between experimentally calculated and
theoretically calculated peak RMS voltage. This means that the experimental method we
used was wrong. But this does not mean that the Fourier series cannot be proved
experimentally. The high percentage error is due to the lack of good knowledge of using the
Function Generator, Oscilloscope and Inductance box used for the experiment. Hence we
could not experimentally verify the Fourier series.
Fourier Transform:
The idea of Fourier transform comes from the Fourier series. In the study of Fourier
series, complicated but periodic functions are written as the sum of simple waves
mathematically represented sine and cosines. But Fourier series cannot be solely periodic
function. Hence Fourier transform is a form of Fourier series that comes into play when the
period of the represented function is lengthy and is allowed to approach infinity. The
Fourier Transform decomposes a waveform into sinusoids and from those sinusoids we
can find the amplitude of frequency spectrum and phase shift of any non periodic vibrating
signals or functions.
Definition:
∞
Let the function 𝑓(𝑑) be piecewise continuous for−∞ < 𝑑 < ∞, and let ∫−∞|𝑓(𝑑)| 𝑑𝑑
exist in the sense that result is finite. Then the Fourier transform of 𝑓(𝑑) exists and is
defined as
∞
𝐹[𝑓(𝑑)] = 𝐹(π‘–πœ”) = ∫ 𝑓(𝑑)𝑒 −π‘–πœ”π‘‘ 𝑑𝑑 − − − − − − − − − − − − − − − − − − − − − −(17)
−∞
14
The transform, 𝐹(π‘–πœ”), represents the frequency spectrum of 𝑓(𝑑) and it may be
complex even though 𝑓(𝑑) is real. The real part, | 𝑓(𝑑) |, can be found using following
formula: |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) , which is the amplitude spectrum
of 𝑓(𝑑).
The phase shift can be found using the following formula: ∅ = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/
π‘…π‘’π‘Žπ‘™(𝑓(𝑑))
The notation 𝐹(π‘–πœ”) emphasis the fact the Fourier transforms is a function of a complex
variable.
Note:
πœ” = 2πœ‹π‘“
𝑒 𝑖π‘₯ = cos(π‘₯) + 𝑖𝑠𝑖𝑛(π‘₯)
Forward Fourier Transform:
Forward Fourier Transform maps a time series (e.g. audio samples) into the series
of frequencies (their amplitudes and phases) that composed the time series.
∞
𝐹(πœ”) = ∫ 𝑓(𝑑)𝑒 −π‘–πœ”π‘‘ 𝑑𝑑 − − − − − − − − − − − − − − − − − − − − − − − − − − − (18)
−∞
Inverse Fourier Transform:
Inverse Fourier Transform maps the series of frequencies (their amplitudes and
phases) back into the corresponding time series.
∞
𝑓(𝑑) = ∫ 𝐹(𝑓)𝑒 π‘–πœ”π‘‘ 𝑑𝑑 − − − − − − − − − − − − − − − − − − − − − − − − − −(19)
−∞
Forward and Inverse Fourier Transform are inverse to each other.
Example 3:
Find the Fourier Transform of the following function with ∝:
𝑓(𝑑) = {
0,
𝐴𝑒 ,
−𝛼𝑑
𝑑<0
𝑑≥0
15
Now we can check the validity of above function either it can be transformed into frequency
domain or not.
0
∞
∞
∫ |𝑓(𝑑)| 𝑑𝑑 = ∫|𝐴| 𝑒 −𝛼𝑑 𝑑𝑑 + ∫ |𝐴| 𝑒 −∝𝑑 𝑑𝑑
−∞
|𝐴|
𝛼
0
−∞
Which is finite for α>0.
Thus the Fourier transform of the above function can be computed.
Now using the definition of Fourier Transform:
∞
𝐹[𝑓(πœ”)] = ∫ 𝑓(𝑑)𝑒 −π‘–πœ”π‘‘ 𝑑𝑑
−∞
∞
= ∫ |𝐴| 𝑒 −∝𝑑 𝑒 −π‘–πœ”π‘‘ 𝑑𝑑
−∞
∞
= ∫ |𝐴| 𝑒 −(∝+π‘–πœ”)𝑑 𝑑𝑑
0
𝑒 −(𝛼+π‘–πœ”)𝑑
= −|𝐴| (𝛼+π‘–πœ”)𝑑 π‘“π‘Ÿπ‘œπ‘š 0 π‘‘π‘œ ∞
𝑒
=
𝐴
𝛼 + π‘–πœ”
|𝐴|
Thus 𝐹(π‘–πœ”) = 𝛼+π‘–πœ” This amplitude spectrum can be determined by computing 𝐹(π‘–πœ”)
πœ”
and phase spectrum tan−1 ( 𝛼 ) .This Fourier transforms represents a function of time in
terms of frequency.
Let |𝐴| = 2 and 𝛼 = 2, then the Fourier Transform will be:
𝐹(π‘–πœ”) =
|2|
2 + π‘–πœ”
Matlab code:
-------------------------------------------------------t=[0:.1:4];
foft=2*exp(-2*t);
%Plot magnitude of F(w)
16
w=[-4:.1:4];
Fw=2./(sqrt(2+w.^2));%Fourier Transform
clf
subplot(2,1,1),plot(t,foft)
xlabel('t')
ylabel('f(t)')
title('Fourier Transform of f(t)')
subplot(2,1,2),plot(w,Fw)
axis([-4 4 0 1.1])
xlabel('Radian frequency w')
ylabel('|F(w)'|)
---------------------------------------------------------------The plot of this transform is shown below:
𝐹𝑖𝑔 6: πΉπ‘œπ‘’π‘Ÿπ‘–π‘’π‘Ÿ π‘‡π‘Ÿπ‘Žπ‘›π‘ π‘“π‘œπ‘Ÿπ‘š
In figure 6, the function 𝑓(𝑑) which was in time domain is transformed into frequency
domain. Now it can be concluded that any integral function that is non periodic and
continuous can be transformed from time domain to frequency domain as well as from
frequency domain into time using Forward and Inverse Fourier Transform.
Properties of Fourier Transform:
1.) Linearity: The Fourier Transform is a linear function of π‘₯(𝑑).
π‘₯1 (𝑑) ↔ 𝑋1 (π‘—πœ”)
π‘₯2 (𝑑) ↔ 𝑋2 (π‘—πœ”)
π‘Žπ‘₯1 (𝑑) + 𝑏π‘₯2 (𝑑) ↔ π‘Žπ‘‹1 (π‘—πœ”) + 𝑏𝑋2 (π‘—πœ”)
17
2.) Time Shifting :
𝐹[π‘₯(𝑑 − 𝑑0 )] = 𝑒 −π‘—πœ”0 𝑑 𝑋(π‘—πœ”)
3.) Time and Frequency Scaling:
1
πœ”
𝐹[𝑓(π‘Žπ‘₯)] = |π‘Ž| 𝐹 ( π‘Ž ). where ‘a’ is a real non zero constant.
Example 4:
Compute the Fourier Transform of a triangular pulse shown below where T=A=1.
𝐹𝑖𝑔 7: π‘‡π‘Ÿπ‘–π‘Žπ‘›π‘”π‘’π‘™π‘Žπ‘Ÿ 𝑃𝑒𝑙𝑠𝑒
From the definition of Forward Fourier transform:
∞
𝐹(π‘–πœ”) = ∫ 𝑓(𝑑)𝑒 −𝑖2πœ‹π‘“π‘‘ 𝑑𝑑
−∞
∞
𝐹(πœ”) = ∫ 𝑓(𝑑)[cos(2πœ‹π‘“π‘‘) − 𝑖𝑠𝑖𝑛(2πœ‹π‘“π‘‘)] 𝑑𝑑
−∞
1
𝐹(πœ”) = ∫ 𝑓(𝑑)[cos(2πœ‹π‘“π‘‘)] 𝑑𝑑
−1
0
1
= ∫(1 + 𝑑)[cos(2πœ‹π‘“π‘‘)] 𝑑𝑑 + ∫(1 − 𝑑)[cos(2πœ‹π‘“π‘‘)] 𝑑𝑑
−1
Now,
0
18
0
∫−1(1 + 𝑑)[cos(2πœ‹π‘“π‘‘)] 𝑑𝑑 = (1 + 𝑑).
=
sin(2πœ‹π‘“π‘‘)
2πœ‹π‘“
− ∫(
sin(2πft)
2πf
) 𝑑𝑑 from -1 to 0
1 − cos(2πœ‹π‘“)
4πœ‹ 2 𝑓 2
Note:
cos(2π‘₯) = cos 2 π‘₯ − sin2 π‘₯ = 1 − 2 sin2 π‘₯
2 sin2 π‘₯ = 1 − cos 2π‘₯
Thus using above trigonometric relation,
0
∫(1 + 𝑑)[cos(2πœ‹π‘“π‘‘)] 𝑑𝑑 = (𝑠𝑖𝑛2 (πœ‹π‘“))/(2πœ‹ 2 𝑓 2 ) − − − − − − − − − − − − − − − −(π‘Ž)
−1
1
∫(1 + 𝑑)[cos(2πœ‹π‘“π‘‘)] 𝑑𝑑 = (𝑠𝑖𝑛2(πœ‹π‘“))/(2πœ‹ 2 𝑓 2 ) − − − − − − − − − − − − − − − − − (𝑏)
0
Adding equations a and b gives:𝐹(π‘–πœ”) =
2sin2 (πœ‹π‘“)
2πœ‹ 2 𝑓 2
=
sin2 (πœ‹π‘“)
πœ‹2 𝑓2
− − − − − − − − − − − −(𝑐)
Thus from equation c, it can be concluded that we can find frequency spectrum of
any continuous pulse.
Again Fourier transform would not be helpful to find the dominant frequency of
sound and seismic wave because it only works with the signals that are continuous. A
separate mechanism is necessary to figure out the dominant frequencies of the signals that
are discrete. Hence we decided to use the idea of discrete Fourier transform to address our
aforementioned problem.
Discrete Fourier Transform:
Discrete Fourier Transform is the numerical approximation of the exponential
Fourier series and the integral Fourier transform of real valued signals by sums of finite
length. In short hand, it is called DFT. It is used when both time and frequency variables are
discrete.
Let 𝑓(𝑑) be the continuous signal which is the source of the data. Let N samples be
denoted 𝑓1 𝑓2 , 𝑓3 , 𝑓4 , …….. 𝑓5 , ,…….., 𝑓𝑁−1 , . Assume that a function 𝑓(𝑑) is defined at a set of N
19
points, 𝑓(𝑛𝑇𝑠) for n =0,………….,N-1 values. The DFT is defined by the formula which yields
the frequency spectrum at N points as:
𝑁−1
π‘˜
𝐹(
) = ∑ 𝑓(𝑛𝑇𝑠 )𝑒 −2π‘–πœ‹π‘›π‘˜/𝑁 − − − − − − − − − − − − − − − − − − − − − − − −(20)
𝑁𝑇𝑠
𝑛=0
For k=0, ………,N-1. . The N sample points of the signal in time gives us N frequency
1
components with a spacing of 𝑓𝑠 = 𝑇, where 𝑇 = 𝑁 𝑇𝑠 is the period of the sampled time
signal.
The DFT is assumed to have the form: 𝐹(𝑓) = πΉπ‘Ÿ (𝑓) + 𝑖𝐹𝑖 (𝑓),where πΉπ‘Ÿ (𝑓)the real
part of is transform and 𝐹𝑖 (𝑓) is the imaginary part of transform
In simple language a digital signal of finite duration can be specified in the time
domain as a sequence of N scaled impulses occurring at regular sampling instants: each
impulse taking on the amplitude of the signal at that instant. The same signal may also be
described as a combination of N complex sinusoidal components, each of a given frequency
and phase, and each being a harmonic of the sampling rate/N. This frequency-domain
representation can be obtained from the time-domain using DFT. The time domain and the
frequency domain are simply different ways of representing the same digital signal. 2
Similar to the Fourier transform, the Discrete Fourier Transform can be divided into
forward and inverse discrete Fourier Transform.
Forward Discrete Fourier Transform:
π‘˜
−2π‘–πœ‹π‘›π‘˜/𝑁
−2π‘–πœ‹π‘›π‘˜/𝑁
𝐹 (𝑁𝑇 ) = ∑𝑁−1
or 𝐹𝑛 = ∑𝑁−1
− − − − − − − − − − − −(21)
𝑛=0 𝑓(𝑛𝑇𝑠 )𝑒
𝑛=0 π‘“π‘˜ 𝑒
𝑠
In DFT, the complex numbers 𝑓0 , … … … … . , 𝑓𝑁 are transformed into complex
numbers𝐹0 , … … … … . , 𝐹𝑁 . In general 𝐹|𝑛| is the DFT of the sequence 𝑓|π‘˜| . Thus this
equation can be written in matrix form as:
𝐹[0]
𝐹[1]
=
𝐹[2]
…..
(𝐹[𝑁 − 1]) (
2
3
1
1
1
1
𝑓[0]
1
1
1 …… 1
2
3
𝑁−1
𝑓[1]
π‘Š π‘Š
π‘Š …. π‘Š
2
4
6
𝑁−2
3
π‘Š
π‘Š
π‘Š …. π‘Š
𝑓[2]
………….
…..
𝑁−1
π‘Š
π‘Š 𝑁−2 π‘Š 𝑁−3 … . π‘Š ) (𝑓[𝑁 − 1])
http://www.phon.ucl.ac.uk/home/mark/basicdsp/05FourierTransform.pdf
http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf
20
Inverse Fourier Transform:
1
−2π‘–πœ‹π‘›π‘˜/𝑁
π‘“π‘˜ = 𝑁 ∑𝑁−1
− − − − − − − − − − − − − − − − − − − − − − − − − − − (21)
𝑛=0 𝐹𝑛 𝑒
In inverse DFT, the complex numbers 𝐹0 , … … … … . , 𝐹𝑁 are transformed into complex
numbers𝑓0 , … … … … . , 𝑓𝑁
Example: 5
Determine the DFT for the discrete function. Find the amplitude and phase transform as
well.
1, 0 ≤ 𝑛 ≤ 4,
𝑓𝑛 = {
The total number of points are N=10.
0,
5 ≤ 𝑛 ≤ 5,
Now using the definition of DFT,
9
πΉπ‘˜ = ∑ 𝑓𝑛 𝑒 −2π‘–πœ‹π‘›π‘˜/10
𝑛=0
0
0
0
0
0
𝐹0 = 1 ∗ 𝑒 −2π‘–πœ‹∗0∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗1∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗2∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗3∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗4∗10 + 0
0
∗ 𝑒 −2π‘–πœ‹∗5∗10 + 0 + 0 + 0 + 0 + 0
= 1 + 1 + 1 + 1 + 1 + 0𝑖 = 5 + 0𝑖
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(52 + 02 ) = 5
0
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = tan−1 (5) = 00
1
1
1
1
1
𝐹1 = 1 ∗ 𝑒 −2π‘–πœ‹∗0∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗1∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗2∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗3∗10 + 1 ∗ 𝑒 −2π‘–πœ‹∗4∗10 + 0
1
∗ 𝑒 −2π‘–πœ‹∗5∗10 + 0 + 0 + 0 + 0 + 0
= 1 + 𝑒 −0.6283𝑖 + 𝑒 −1.257𝑖 + 𝑒 −1.885𝑖 + 𝑒 −2.513𝑖 + 0
= 1 + 0.809 − 0.587𝑖 + 0.309 − 0.951𝑖 − 0.309 − 0.951𝑖 − 0.809 − 0.588𝑖
= 1 − 3.077𝑖
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(12 + 3.0772 ) = 3.235
−3.077
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = tan−1 (
1
) = −720
21
Now using same calculating methods DFT can be easily calculated. Thus,
𝐹2 = 0
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(02 + 02 ) = 0
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = 00
𝐹3 = 1 + 0.7265𝑖
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(12 + 0.72652 ) = 1.23
0.7265
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = tan−1 (
1
) = 360
F4 = 0
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(02 + 02 ) = 0
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = 00
𝐹5 = 1
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(12 + 02 ) = 1
0
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = tan−1 (1) = 00
𝐹6 = 0
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(02 + 02 ) = 0
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = 00
𝐹7 = 1 − 0.7265𝑖
22
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(12 + 0.72652 ) = 1.23
−0.7265
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = tan−1 (
) = −360
1
𝐹8 = 0
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(02 + 02 ) = 0
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = 00
𝐹9 = 1 + 3.077𝑖
Amplitude |𝑓(𝑑)| = √(π‘…π‘’π‘Žπ‘™(𝑓 (𝑑))2 + πΌπ‘šπ‘Žπ‘”(𝑓(𝑑))2 ) = √(12 + 3.0772 ) = 3.235
3.077
Phase shift(∅) = π‘Žπ‘Ÿπ‘π‘‘π‘Žπ‘›(πΌπ‘šπ‘Žπ‘”(𝑓(𝑑)/π‘…π‘’π‘Žπ‘™(𝑓(𝑑)) = tan−1 (
1
) = 720
The magnitude and phase shift of any digital signal can be calculated using DFT.
Fast Fourier Transform:
A fast Fourier transform (FFT) is an algorithm to compute the discrete Fourier
transform (DFT) and its inverse. A Fourier transform converts time domain to frequency
and vice versa; an FFT rapidly computes such transformations. As a result, fast Fourier
transforms are widely used for many applications in engineering, science, and
mathematics.
The DFT is obtained by decomposing a sequence of values into components of
different frequencies. This operation is useful in many fields but computing it directly from
the definition is very slow. An FFT is a way to compute the same result more quickly:
computing the DFT of N points using the definition takes O(N2) arithmetical operations,
while a FFT can compute the same DFT in only O(N log N) operations.
The difference in speed can be drastic when N is thousands or millions. Thus FFTs
are of great importance for a digital signal processing. The FFT is the correct method to
solve our problem statements.
A very simple example is shown below calculating the Fourier transform at different
frequencies.
23
Example 6:
−3𝑑
𝑑≥0
Let 𝑓(𝑑) = { 12 𝑒
0
𝑑<0
Using the concept of example 3, the Fourier Transform of given function can be obtained as:
12
(π‘–πœ”) =
.
3+π‘–πœ”
Matlab code:
%--------------------------------------------------------------------N=128;
t=linspace(0,3,N);
f=12*exp(-3*t);
Ts=t(2)-t(1);
Ws=2*pi/Ts; % sampling frequency in rad/sec
F=fft(f); % use matlab to compute the fft
% now compute the positive frequency components and mult by
% Ts=T/N to approximate F(w)
Fp=F(1:N/2+1)*Ts ;
% build the frequency axis from zero to the frequency Ws/2
W=Ws*(0:N/2)/N;
F_exact = 12./(3+i*W); % evaluate the exact FT of f
% now plot the results
plot(W,abs(F_exact),W,abs(Fp),'ok')
xlabel('Frequency, Rad/sec')
ylabel('|F(w)|')
title('Fourier Transforms at different Frequencies')
%--------------------------------------------------------------------
𝐹𝑖𝑔 8: πΉπ‘œπ‘’π‘Ÿπ‘–π‘’π‘Ÿ π‘‡π‘Ÿπ‘Žπ‘›π‘ π‘“π‘œπ‘Ÿπ‘š π‘Žπ‘‘ π‘‘π‘–π‘“π‘“π‘’π‘Ÿπ‘’π‘›π‘‘ π‘“π‘Ÿπ‘’π‘žπ‘’π‘’π‘›π‘π‘–π‘’π‘ 
24
From the figure 8, we can find the frequency spectrum at each point. Thus discrete
Fourier Transform was a correct mathematical method to solve our aforementioned
problems.
Problem 1: Find Dominant Frequency of sound waves:
Step 1: Record sound using Matlab.
%This code records the sound in matlab. The recorded sound wave
is saved as myRecording.wav. This matlab code was modified and
rewritten under the instruction of Dr. Clark Merkel.%
---------------------------------------------------------------------function [Y,FS,time]=myRecord(record1,time,FS,NBits)
if nargin<4
NBits=8;
%bits per sample
end
if nargin<3
FS=11025
% samples/sec
end
if nargin<2
time = 5
%sec
end
if nargin<1
filename='myRecording.wav'
end
fprintf('Recording file: %s \n',filename)
fprintf('Length: %f seconds \n',time)
fprintf('Sample rate: %i
\n',FS)
fprintf('Sample Resolution: %i \n',NBits)
disp(' ')
disp(' ')
Now_Recording=input('Hit enter when ready to record','s')
Y = wavrecord(time*FS, FS, 1,NBits);
fprintf('.\n.\n.\n.\n.\n.\n.\n.\n.\n')
disp('Recording complete!')
disp(' Hit enter to continue.')
plot(Y)
disp(' Hit enter to play back')
pause
wavplay(Y, FS);
wavwrite(Y,FS,filename)
----------------------------------------------------------------------
25
Step 2: Read file as Read_Wave_File.m
%This code plays the sound file in .wav format and plots the
sound wave as well. Then the dominant frequency of the graph is
obtained using FFT. This matlab code was modified and rewritten
under the instruction of Dr. Clark Merkel. %
---------------------------------------------------------------------FILE='MyRecording.wav'
[y,FS,NBITS]=WAVREAD(FILE);
figure(1)
plot(y)
time=length(y)/FS
t=linspace(0,time,length(y));
np=16
N=2^np
% points used
SampleRate=FS
% samples/s
figure(2)
plot(t(600:700),y(600:700))
grid
xlabel('time [s]'), ylabel('y'),title('Finding Fundamental frequencies
using FTT')
figure(3)
Y=fft(y,N);
Pyy=Y.*conj(Y)/N;
f=SampleRate*(0:N/2-1)/N;
plot(f,Pyy(1:N/2))
PlotTitle=sprintf('np = %i',np)
title(PlotTitle)
grid
axis([0, 1000, 0, 10])
xlabel('frequency [hz]'), ylabel('Freq Power Density')
wavplay(y,SampleRate,'async')
----------------------------------------------------------------------
Original sound wave:
26
FFT of original sound waves gives:
Hence the dominant frequencies are 5 Hz, 350 Hz and 700 Hz.
Problem 2: Find Dominant frequency of seismic wave:
---------------------------------------------------------------% This matlab code pulls data from .sac file and gives a plot of
seismic waves those are discrete. Then from the plotted graph
fundamental frequency is found using FFT. This idea for this matlab
code is obtained from ------------------------%
function plot_this_sac(filename)
[Ztime,Zdata,ZSAChdr] = fget_sac(filename)
%[Ztime,Zdata,ZSAChdr] = fget_sac(‘MYJH.sac’)
figure(1)
plot(Ztime, Zdata,’b’)
xlabel(‘time’)
ylabel(‘magnitude’)
grid on
axis([200, 400, -1e6, 1e6])
SampleRate=1/(Ztime(2)-Ztime(1))
N=length(Ztime)
figure(2)
y=Zdata
Y=fft(y,N);
Pyy=Y.*conj(Y)/N;
f=SampleRate*(0:N/2-1)/N;
plot(f,Pyy(1:N/2))
%axis([0, 10, 0, 10])
xlabel(‘frequency [hz]’), ylabel(‘Freq Power Density’)
%wavplay(y,SampleRate,’async’)
27
Original seismic wave:
FFT of original seismic wave gives:
Hence the dominant frequency is 2-3 Hz.
28
Conclusion:
Fourier series and Fourier transform are the techniques to find the find dominant
frequencies of any vibrating waves. But our goal is to find the fundamental frequency of
sound and seismic waves which were not periodic, continuous, and contains countless
points which is impossible to do by hand. Thus Fast Fourier Transform was used for the
Fourier analysis of sound wave and seismic wave. The main techniques that are necessary
for Fourier analysis are given below:
Topic: Fourier Techniques
Name
Fourier Series
Fourier
Transform
Characteristics
𝑓(𝑑) continuous
𝐹(πœ”π‘– ) discrete
𝑓(𝑑) continuous
𝐹(πœ”π‘– ) continuous
Typical use
Analysis of periodic functions and signals
Frequency analysis of signals and
systems
DFT
𝑓(𝑑𝑖 ) discrete
𝐹(πœ”π‘– ) discrete
Computation of other transforms
Analysis of sampled signals
FFT
𝑓(𝑑𝑖 ) discrete
𝐹(πœ”π‘– ) discrete
Algorithm to compute the DFT
29
Work Citation:
Harman L., Thomas, Advance Engineering Mathematics, PWS Publication Company
Osgood, Brad, The Fourier Transform and its Application, Electrical Engineering
Department, Stanford University.
http://www.math.psu.edu/wysocki/M412/Notes412_8.pdf
http://www.intmath.com/fourier-series/3-fourier-even-odd-functions.php
http://www.engr.sjsu.edu/trhsu/Chapter%206%20Fourier%20series.pdf
Download