r/Python • • Oct 14 '19

When Python Meets Fourier Transform

2.3k Upvotes

122 comments sorted by

View all comments

Show parent comments

9

u/Helicon_Amateur Oct 14 '19

Can you elaborate?

6

u/potatochemist Oct 14 '19

Essentially, if you add up the right combination of sine waves with different heights and speeds, you can recreate any function/graph/picture.

3

u/Helicon_Amateur Oct 14 '19

Okay. Now I get it and feel really stupid for not thinking of it that way. I understand what an FFT does but didn't relate it to this picture.

So each frame of this drawing should then consist of a peice of a signal, say there is this really long signal in the time domain - then stepping over a finite chunk of that signal would produce this graph, is that correct?

4

u/potatochemist Oct 14 '19

The "signal" is the shape of the dog. However instead of volume over time (like a microphone), it's x-y pairs over time where each pair is a point somewhere on the dog.

They then take the FFT of this to get the size and speed (magnitude and frequency) of the sin waves shown by the circles.

Here's a gif of the same thing with a time signal (like volume).

Here's a really good video if you want to get a bit deeper.

3

u/FauxReal Oct 14 '19

Funny lookin' muzzle on that dog of yours.