Python Forum

Full Version: Fourier series in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I'm new here so I hope I'm in the right place to ask some questions !

I would like to get the equation of the Fourier series of a (complex) curve.
There are a few scripts on the internet that plot the Fourier series curve at different orders, but none of them give the equation (or work). I looked for an existing function but it doesn't seem to exist .....

I have linked to this post a screenshot of a curve that I would like to get the Fourier series. As you can see, I can plot the curve, but I don't get the equation.

For those who know MatLab, I'm looking for a function like the "fit" function : https://fr.mathworks.com/help/curvefit/fourier.html

I hope that my post was clear enough ! :)

Thanks for your help !
(Mar-18-2022, 09:45 AM)Larz60+ Wrote: [ -> ]see: https://docs.scipy.org/doc/scipy/tutorial/fft.html
and: https://numpy.org/doc/stable/reference/g....fft2.html

Maybe I don't get it, but those links are the FFT, and I'm looking for Fourier series Confused (maybe we can get the Fourier series from the FFT ?)
Armandito Wrote:Maybe I don't get it, but those links are the FFT, and I'm looking for Fourier series Confused (maybe we can get the Fourier series from the FFT ?)

From difference between.org:
Quote:Difference between Fourier Series and Fourier Transform

Fourier series is an expansion of periodic signal as a linear combination of sines and cosines while Fourier transform is the process or function used to convert signals from time domain in to frequency domain. Fourier series is defined for periodic signals and the Fourier transform can be applied to aperiodic (occurring without periodicity) signals. As mentioned above, the study of Fourier series actually provides motivation for the Fourier transform.

I used fft in my work many years ago (almost 30) while working R & D in spectra-chemical instrumentation design and honestly can't remember enough to properly answer your question.