Discrete Fourier Transform example

Page 1

Acoustic Prediction

Discrete Fourier Transform

Discrete

Fourier

Transform Two Examples step-by-step José Mujíca

1


Acoustic Prediction

Problem 1.-Let’s take a simple sine wave of 1Hz (Hertz) and an amplitude of 1Hz.

Discrete Fourier Transform

Prolog This guide doesn’t pretend to teach the topic under consideration but pretend to illustrate it by means of two step-by-step complete examples.

Choose a sampling Frequency 0f 8 Hz (Number of samples N=8).

The idea is that an Audio Technician with a basic knowledge of math and one scientific calculator can recreate the Fourier transform to change a sound wave expressed in Time Domain into a Frequency Domain. I’m also including explanations about imaginary numbers and how to work with them using the Casio FX-95MS calculator.

Values for these particular points are shown next.

I would like to dedicate this Work to my friends of The Audio Engineering Society (AES) and McNally & Smith College of Music. Also to the Community of the Institute of Electrical and Electronics Engineers (IEEE ), National Association of Broadcasters (NAB), Acoustical Society of America (ASA) and The Society of Motion Picture & Television Engineers (SMPTE). Credits: Simon Xu (Mechanical Engineer of the Department of the U.S. Navy) and Ramon Mata-Toledo, Ph.D. Professor of Computer Science and Affiliate Professor of Mathematics and Statistics at James University and Computer Science Editor of the McGraw-Hill’s Access Science.

2


Acoustic Prediction

Discrete Fourier Transform

X0=0

Step 1. (Optional) How do we obtain these values?

X1=0,707

Evaluating the function Sin(x), for example,

To express the sinx in degrees in a calculator use the (Deg Mode*):

X2= 1 X3=0,707 X4= 0 X5= - 0,707 X6= -1 X7= - 0,707

Step 2.-Using the previous values we can now use the Discrete Fourier Transform (DFT) to get eight coefficients (Discrete variables).

3


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X0

Euler’s Identity = Cos(x)+jSin(x)

Using Euler’s identity we obtain:

¿What are Imaginary numbers? Any complex number (x,y) can be written as x + yi where “I” represent the imaginary unit. A pure imaginary number (0,y) is a complex number whose real part is zero (0). That is, to say (0,y) = 0 + yi. The 2 imaginary unit, “i”, is such that i = -1. in 1637, Rene Descartes came up with the standard form for complex numbers. However, he didn’t like complex numbers. Euler used complex numbers extensively, he introduced i as the symbol for √-1. Complex numbers were called Impossible numbers and solutions impossible. Engineers use it to study stresses on beams and to study resonance. ¿Why “j” and not “i”? In the study of electricity and electronics, j is used to represent imaginary numbers so that there is no confusion with i, which in electronics represents current.

X0=0

4


Acoustic Prediction

Discrete Variable X1

Euler’s identity = Cos(x)+jSin(x)

Discrete Fourier Transform

Complex Number Every complex number has two coordinates; namely its real and imaginary parts. It is natural therefore to represent complex numbers as points in what is called the complex plane. In this representation, the convention is to plot the real part of the complex number on the horizontal axis and the imaginary part on the vertical axis. We find the magnitude using the Pythagorean -1 Theorem and the Angle by Arctan (Tan ).

Using Euler’s identity, we obtain:

0+(0,5-0,5j)+(-j)+(-0,5-0,5j)+0+-(0,5-0,5j)+(-j)+(-0,5-0,5j)

X1=-4j

5


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X2

Using Euler´s identity, we obtain:

X2=0

6


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X3

Using Euler’s identity, we obtain:

X3=0

7


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X4

Using Euler´s identity, we obtain:

X4=0

8


Acoustic Prediction

Discrete Variable X5

Discrete Fourier Transform

Geometric interpretation of the Complex Number, 4j

Using Euler´s identity, we obtain:

X5=0

9


Acoustic Prediction

Discrete Variable X6

Discrete Fourier Transform

Nyquist Theorem The Nyquist sampling theorem provides a prescription for the nominal sampling interval required to avoid aliasing. It may be simply stated as follows: The sampling frequency should be at least twice the highest frequency contained in the signal.

Using Euler´s identity, we obtain:

Or in mathematical terms: fs ≼2 fc Example. Most of the information conveyed in speech does not exceed 4 kHz. Sampling uses Nyquist theorem, the voice signal is sampled at 8000 Hz so that frequencies up to 4000 Hz can be recorded. The sampling rate will be 2*B= 2*(4,000 Hz), that is 8000 Hz, equivalently to 8,000 samples per sec. (1/8000).

X6=0

10


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X7 Plotting the Result of the discrete values, we obtain the following graphic.. We can see values of 4 for th 1Hz and 7Hz. The 7Hz value corresponds to the 8 Discrete number. Applying Nyquist Theorem doubling 4, we get a magnitude of 8 at 1Hz. If now we divide this result by the number of discrete points we obtain Fr= 8/8 = 1Hz as the frequency resolution.

Using Euler´s identity, we obtain:

X7=4j

11


Acoustic Prediction

Discrete Fourier Transform

Step 1. Evaluating the Function for 4 samples

Problem 2

Sampling the function 4 time per second (4Hz) implies t=K/4. The function can be rewritten as follows:

Let’s consider the following function in the time domain:

DC

1HZ

2Hz

Plotting (Optional) with MAPLE 14. We can use the Maple Multiple plot command to see the complex wave (Blue) and its parts. In this case, the obtained values are shown as follow: the 5 value, direct current (DC) in grey, the 1Hz wave in red and the 2Hz one in pink.

The samples (Mn, 0,1,2,3) will be: M1

The multiple command builds a composite plot. Each argument must be separate by colon. With 4 samples (4Hz) we have:

F(0) = 8 M2 F(1) =4 M3 F(2)=8 M4 F(3)=0

12


Acoustic Prediction

Discrete Fourier Transform

Step 2. Using The Discrete Fourier Transform (DFT) to get 4 coefficients(X0, X1, X2, X3) F0=8 F1=4 F2= 8

Discrete Variable X0

F3=0

Euler’s identity = Cos(x)+jSin(x)

Using Euler’s identity, we obtain:

13


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X1

Euler’s identity = Cos(x)+jSin(x)

Using Euler’s Identity, we obtain:

14


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X2

Euler’s identity = Cos(x)+jSin(x)

Using Euler’s identity, we obtain:

15


Acoustic Prediction

Discrete Fourier Transform

Discrete Variable X3

Plotting the coefficients

Euler’s identity

= Cos(x)+jSin(x)

Using Euler´s identity, we obtain:

16


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.