L
L
lemon_spb2012-07-17 00:27:43
C++ / C#
lemon_spb, 2012-07-17 00:27:43

What is the essence of the result of the fast Fourier transform?

Hello, dear habraobiteli! Please don't hit me with your boots!
For the first time I encountered the Fourier transform, and I need to quickly figure it out.
I understand its “physical” meaning as follows: there is a signal that changes in time in a certain way. After its transformation, a spectrum is obtained, i.e. amplitude(frequency) is obtained from the amplitude(time) dependence.
I got to Wikipedia for a fast conversion algorithm:
Wikipedia FFT
made ctrl+C, ctrl+V of the first example. At the output I get the following file:
0.000000 0.000000 0.000000
0.500000 0.000000 0.250000
0.000000 0.000000 0.000000
0.000000 0.000000 0.000000
0.000000 0.000000 0.000000
0.000000 0.000000 0.000000
0.000000 0.000000 0.000000
0.500000 0.000000 0.250000
The first column is the real part, the second is the imaginary part, the third is the sum of the squares of the real and imaginary parts.
According to the code, as far as I understand, a cosine FFT is made with a frequency of 2 * pi / 8, which is approximately equal to 0.785. A stupid question is brewing, how does this file relate to the cosine spectrum, which should be zero everywhere, except for the cosine frequency, in which it should be equal to 1?
Explain, please, dear experts. Maybe I'm not taking the right example?
PS I removed minuses in front of zero values ​​in the file so that it looks even :-)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2012-07-17
@limon_spb

In order to get 1 peak, it is necessary to make a cyclic shift of the values ​​of the frequency values.
This is described in detail in this article on habré
habrahabr.ru/post/112068/

G
galaxy, 2012-07-17
@galaxy

Well, it's not a cosine transformation.
cos(a) = (e ia +e -ia )/
2 there will be 2 frequencies in the complex transform: 1 and -1 (mod 8) = 7

W
Wott, 2012-07-17
@Wott

Fourier, like any expansion, is finding coordinates (coefficients for the sum) in the space of orthogonal vectors (in this case, cosines with a frequency multiple of pi-something-there). If your original vector (function, in this case cosine) is parallel to one of the bases (that is, the frequencies are the same), then you will get zeros except for one value. If not, then you will get a decomposition into several vectors (frequencies), the sum of which with the found coordinates-coefficients will give you the original function (with a given accuracy).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question