Fourier Transform

Anything not related to STM32
Post Reply
flyboy74para
Posts: 26
Joined: Tue Apr 23, 2019 4:38 am
Answers: 1
OS: windows
IDE: System workbench
Core: N/A
Board: Blue pill, STM32F407

Fourier Transform

Post by flyboy74para » Sat Sep 07, 2019 1:58 am

I recently discovered the Fourier series while helping my son learn calculus. I have used a 2D Fourier transform to draw out my company logo "SEQ Paragliding".

Each epicycle (clock hand) turns at a constant rate never changing but using a Fourier transform I am able to calculate the needed starting conditions (freq, amplitude and phase) that the resultant will be drawing the exact path that I want.

I did write all the code in python on my PC and used OpenCV library to create the animation.

https://www.youtube.com/watch?v=oo41fNZ ... e=youtu.be

stevestrong
Posts: 60
Joined: Tue Mar 05, 2019 7:49 am
Location: Munich
OS: Win7 & 10
IDE: Arduino 1.8.8, Sloeber
Core: Libmaple
Board: Bluepill, Generic F4VET6 black & mini
Contact:

Re: Fourier Transform

Post by stevestrong » Sun Sep 08, 2019 4:27 pm

Nice.
Can you share some code?

flyboy74para
Posts: 26
Joined: Tue Apr 23, 2019 4:38 am
Answers: 1
OS: windows
IDE: System workbench
Core: N/A
Board: Blue pill, STM32F407

Re: Fourier Transform

Post by flyboy74para » Sun Sep 08, 2019 8:25 pm

stevestrong wrote:
Sun Sep 08, 2019 4:27 pm
Nice.
Can you share some code?
A few others have asked for the code too.

I just need to clean the code up a little then I will post it. Might even get to it today :)

flyboy74para
Posts: 26
Joined: Tue Apr 23, 2019 4:38 am
Answers: 1
OS: windows
IDE: System workbench
Core: N/A
Board: Blue pill, STM32F407

Re: Fourier Transform

Post by flyboy74para » Mon Sep 09, 2019 11:51 am

Ok I have put up some clean code that is hopefully easy to follow.

I have 2 version of the code.

The first version I wrote the code to perform the discrete fourier transform (DFT). This will show the main underbelly of the magic that happens but I haven't had the time to clean it up and make it nice and readable for public.

The second version I used a function from the numpy library (numerical python) called fft (fast fourier transform). It is basically an very optimized version that achieves the same outcome as DFT

Here is a link to a blog that helped me understand how it all works https://betterexplained.com/articles/an ... DQoASvNDUI

Here's a link to my code for second version so you can see how I implemented it https://github.com/OutOfTheBots/epicycles

Post Reply