All Types of Fourier Transforms in PYTHON

  Рет қаралды 51,915

Mr. P Solver

Mr. P Solver

2 жыл бұрын

Check out my course on UDEMY: learn the skills you need for coding in STEM:
www.udemy.com/course/python-s...
In this video I delve into the libraries of sympy and scipy to take a look at Fourier analysis in python. I look specifically at 1. Fourier Transforms, 2. Fourier Series, and 3. The Discrete Fourier Transform. Some of these transforms involve integrals that can be evaluated analytically (i.e. integrals can be solved symbolically using sympy) while other transforms involve integrals don't have analytic solutions: numerical solutions can be obtained for such integrals using scipy.
Fourier Transforms show up in fields such as quantum mechanics when one wishes to convert a wavefunction in a position basis to a momentum basis. If the analytical form of the wavefunction is known, this transition is seamless using scipy or sympy. Fourier series can often show up in the study of partial differential equations. Finally, the discrete Fourier transform is a useful tool in data analysis to obtain a spectral density estimator for a given time series, for example.
Link to code
github.com/lukepolson/youtube...
Discord Server
/ discord
2:46 1 .Fourier Transforms (Function Domain Unbounded)
8:35 2. Fourier Series (Function Domain Bounded)
15:05 3. Discrete Fourier Transform (Function Discretely Measured)

Пікірлер: 73
@lucaspaes3821
@lucaspaes3821 2 жыл бұрын
One of the best channels on youtube right now, congrats great content dude.
@Seriosso
@Seriosso 2 жыл бұрын
Man! Where the hell have you been hiding from my recommendation list all this time? I have been looking for someone that would do EXACTLY your content for like ages! Thank you for all the time and effort to remove the fog from my eyes!
@RhoChalmers
@RhoChalmers 2 жыл бұрын
Thank you. Have shared this video in our college Discord because our professor doesn't really explain things that well.
@wilsoncarofilis7595
@wilsoncarofilis7595 2 жыл бұрын
Thanks for this video, I was struggling with my assignment, almost give up but here found a way to solve it! Very appreciated bro!
@frednalyanya4015
@frednalyanya4015 5 ай бұрын
I wish I found out about this channel two years ago! It is not late though. Great work boss!
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
Not sure if the persistent integration issues with the upper integral limit `T' has to do with the many improvements to SymPy 1.11.1. However, after lengthy consideration, here is the code that actually returns `x_FT` quickly and correctly without kernel crashes: x_FT = sp.integrate(1/T * x*sp.exp(-2*sp.pi *sp.I *fn*t), (t, 0, sp.oo)).simplify() 🤓 Love your lectures. 😍
@krupamaypanda8177
@krupamaypanda8177 2 ай бұрын
He he he, love this channel even more! Some contents from this video were really helpful (been looking for these explanations from months, but found it here). Your channel is one of the reasons why I love scientific computing in python...Thanks a looooot
@aqueeqazam
@aqueeqazam 2 жыл бұрын
You are unbelievable programmer.
@abcd-gp6is
@abcd-gp6is 2 жыл бұрын
I have Fourier transform this sem, thank you for understanding my heart 😉💜 I'm gonna comment again after watching and doing it....
@Nobuhara
@Nobuhara 2 жыл бұрын
Are you planning on making a video about ipywidgets? After watching most of them I'm seriously considering getting [sympy + ipywidgets + numpy + numba + jupyter] as a free Mathematica-like environment. Also, please, keep posting videos! They are very good and in time you will be in the 1M+ subs range!
@JeanDAVID
@JeanDAVID Жыл бұрын
Nov 2022 : to correct exception when reading image 24:49 im_array = io.imread('flower.png') img = color.rgb2gray(color.rgba2rgb(im_array))
@amithkumars562
@amithkumars562 2 жыл бұрын
highly underrated!!
@rostamr4096
@rostamr4096 5 ай бұрын
Thank you for these detail and very helpful videos
@scoot_tv
@scoot_tv 2 жыл бұрын
It'd be awesome if you could cover Gabor analysis or other time-frequency analysis methods.
@jx4864
@jx4864 Жыл бұрын
That rap is sick, man, keep on it.
@toobabb3613
@toobabb3613 2 жыл бұрын
Hey Thankyou so much. Its too helpful. Stay blessed!
@ilredeldeserto
@ilredeldeserto 2 жыл бұрын
my thanks for this video, you saved me and my exam too! lol
@mro5858
@mro5858 2 жыл бұрын
Very nice videos! Thank you so much.
@Karim3ds
@Karim3ds 2 жыл бұрын
hi, thank you so much for your informative videos, is it possible to do a video for solving the image MTF using py, thanks alot
@SarthakGamer
@SarthakGamer 2 жыл бұрын
Another amazing video
@tactusxii
@tactusxii 7 ай бұрын
@24:29 nyquist frequency: 1/(2*dt), I thought is was supposed to be (1/2)*dt ?
@minma02262
@minma02262 2 жыл бұрын
Definitely liking this for the rap in the beginning.
@DrJessicaGrogan
@DrJessicaGrogan Жыл бұрын
I subscribed before the singing, happy I subscribed. LOL awesome vid
@baghdadiabdellatif1581
@baghdadiabdellatif1581 7 ай бұрын
Great work 👌👏👍
@chiragsharma5624
@chiragsharma5624 17 күн бұрын
try solving mit intigration bee problem in python
@sittiparkkaewka7647
@sittiparkkaewka7647 2 жыл бұрын
WOW. Nice Video!! 💙
@kkantse9351
@kkantse9351 2 жыл бұрын
Great and hansome!
@PhysicsKeeda_99
@PhysicsKeeda_99 2 жыл бұрын
hey its great can you please help me in the code for how to fourier transform a signal which i have already plotted in python itself
@rezhar3640
@rezhar3640 Жыл бұрын
How about fractional fourier transform? Can you explain it?
@toobabb3613
@toobabb3613 2 жыл бұрын
I want to fourier transform position wavefuntion to momentum for infinite square well and plot it. I am following this video where you transformed time to frequency. But in my case p (momentum) equals (iota)*(planck constant)*(partial by partial x). I am not sure hoew to define this. If you have sample of position to momentum fourier transform o anything to help, kindly tell me. Regards
@user-dv8id8vd7g
@user-dv8id8vd7g Жыл бұрын
Hi Mr Solver, thanks for your great effort to put this boring theory into interesting and visual python coding. I tried out your codes everthing works except #2 Fourier Series (continuous time, discrete frequency). Your suggested solution is much appreciated
@reapicus557
@reapicus557 7 ай бұрын
After messing around with things a little bit I have found that the following works: a = smp.symbols('a', real = False) x_FT = smp.integrate((1/T) * x *smp.exp(-a*t), (t,0,T)).subs([(a, 2*smp.pi*smp.I*fn)]).simplify() This makes a symbolic answer that looks different than the video, but reproduces the same numeric results, so it should be fine! :^)
@user-dv8id8vd7g
@user-dv8id8vd7g 7 ай бұрын
@@reapicus557 Thank you, your solution works!
@ravenecho2410
@ravenecho2410 Жыл бұрын
u bait me with the memes... and now im in image Fourier, pretty cool
@neilbohar8212
@neilbohar8212 2 жыл бұрын
Plz share inverse fourrier transform system video too
@Mayank-mf7xr
@Mayank-mf7xr Жыл бұрын
Great content.
@user-er1lo1hj4x
@user-er1lo1hj4x 2 жыл бұрын
How can study Fe(Phen) using monte carlo simulation in python program-ising model 2D .. please
@bean_mhm
@bean_mhm Жыл бұрын
Great video
@rrr33ppp000
@rrr33ppp000 2 жыл бұрын
Great work as always! Have you ever checked Steve Brunton's channel? He has some nice videos on this topic and many other data-driven techniques. Highly recommended
@brianlivian3149
@brianlivian3149 Жыл бұрын
Great video thanks
@rubenvicente4677
@rubenvicente4677 5 ай бұрын
it is imposible to flow now if you do not have the version of your module (pip freeze) :(
@eyal4
@eyal4 2 жыл бұрын
thank you very much !
@nehakhanra9853
@nehakhanra9853 Жыл бұрын
Awesome lecture ever. Hello sir, can you make a tutorial on Fourier series of a triangular waveform?🙏🙏
@user-bs5ue3bu3p
@user-bs5ue3bu3p 7 ай бұрын
Thank you!
@brisingreye5209
@brisingreye5209 2 ай бұрын
nice video! I ran into two problems: 1) I can not seem to load an image that is located in another folder. How can I tell the program to search for it? 2) When I do add it to the folder python expects it to be, i get the following error: ''ValueError: the input array must have size 3 along `channel_axis`, got (571, 564, 4)'' How can you resolve this problem?
@reapicus557
@reapicus557 7 ай бұрын
If anyone is having trouble getting a symbolic result in the Part 2 section without a kernel crash, then try adding the following 'a' symbol: a = smp.symbols('a', real = False) x_FT = smp.integrate((1/T) * x *smp.exp(-a*t), (t,0,T)).subs([(a, 2*smp.pi*smp.I*fn)]).simplify() This gave me something that looks different from the video's symbolic form, but it reproduces the numeric plot, so I'm happy with it!
@tilkesh
@tilkesh 9 ай бұрын
Thank you.
@kusy
@kusy 2 жыл бұрын
5:58 If I use smp.exp instead of np.exp in def x, then the quad will fail.
@vaibhavgarg1982
@vaibhavgarg1982 2 жыл бұрын
Hey, Discovered your channel and have been hooked since. Just a small request. Would you mind zooming in just a little bit. The text is hard to read even at the highest res of 1080p. Thanks.
@MM-vw1ck
@MM-vw1ck 2 жыл бұрын
3 weeks too late for me, but thank you for this vid
@frankkoslowski6917
@frankkoslowski6917 2 жыл бұрын
Great Lecture! Although as the frequency goes up, the sampling rate ought to be sufficiently INCREASED for good analog audio to be retrieved from a file with data recorded at, let's say 320bps, so as to avoid aliasing as alluded to in cell 39. Should it not?
@Zorzek
@Zorzek 2 жыл бұрын
Yes, he probably meant to say that "dt" should be small enough (and not sampling rate), which inversely means that sampling rate should be high enough. Just an honest mistake on his part.
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
@@Zorzek Speaking of honest mistakes, I took the liberty to re-write one of the formulas in 2.Fourier Series (`Continuous time, Discrete Frequency`): $$\displaystyle\color{blue}{\hat x(f_n) = \frac{1}{T}\int_0^T x(t)e^{-2\pi i (f_n)(t)} dt}$$ because this is what we are actually doing in the code that expresses it.
@lucapalese475
@lucapalese475 Жыл бұрын
DFT formulas are a bit messed up. Useful vid :)
@HH-mw4sq
@HH-mw4sq 2 жыл бұрын
I keep getting the following error: "x_FT_integrand_real = lambda t: np.real(x(t, k)*np.exp(-2.0*np.pi*1j*f*t)) TypeError: 'Mul' object is not callable" Why is this occurring, and how to get around it?
@ferrusmannus6784
@ferrusmannus6784 Жыл бұрын
D ear Mr. P Solver, can you tell us how to make spectral derivative in Python?
@taybabusra1695
@taybabusra1695 2 жыл бұрын
Make video on epicycle And converting any image to epicycle drawing
@user-gm7jf8wo4q
@user-gm7jf8wo4q 4 ай бұрын
ur a true god
@rostamr4096
@rostamr4096 5 ай бұрын
What is the editero you are using?
@iitian1201
@iitian1201 2 жыл бұрын
Please simulate random walk probably by python 🙏🙏🙏🙏
@eschool8812
@eschool8812 5 ай бұрын
Hi, I have a discrete voltage and current signal in time domain, what will be the formula to calculate the power using both voltage and current waveform in FFT method, it will be sum of the Individual powers in frequency domain or if you can put some insights or share your mail I can send you a email stating the exact problem. Thanks for the video.
@kelixoderamirez
@kelixoderamirez 2 жыл бұрын
permission to learn sir
@user-qc2gq2sn7e
@user-qc2gq2sn7e 4 ай бұрын
which software is this..?
@cherryslab3034
@cherryslab3034 2 жыл бұрын
Noise
@leonardosaads
@leonardosaads 2 жыл бұрын
Where is dtft?
@AJ-et3vf
@AJ-et3vf 2 жыл бұрын
❤️❤️❤️❤️❤️
@ryanjosephtatel1330
@ryanjosephtatel1330 2 жыл бұрын
This is where repp'n and math collide
@user-er1lo1hj4x
@user-er1lo1hj4x 2 жыл бұрын
Hello..I am a PhD student in physics from Iraq..I hope you can help me find codes in the Python program to study the Fe(II)particle (ising model 2D)to determine the spin crossover of the electrons and find the energy..with many thanks to you.
@KrishnaGupta-pn8ee
@KrishnaGupta-pn8ee 9 ай бұрын
Video quality is worst.. Can't see what's types
@et4493
@et4493 Жыл бұрын
What about amplitude and phase? And what about an entire spectrum of frequencies, instead of a basic ass sin function? This is so generic and superficial might as well just read the instructions on the np sp manuals SMH
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
I don't know what kind of magic you used to get a symbolic answer for: x_FT = sp.integrate(1/T * x*sp.exp(-2*sp.pi *sp.I *fn*t), (t, 0, T)).simplify() because the Kernel in Jupyter simply dies. 😓 Here are the errors that were eventually generated in PyCharm using an alternate installation of Python: File "C:\Users b_se\AppData\Local\Programs\Python\Python38\lib\site-packages\sympy\integrals\integrals.py", line 1084, in _eval_integral h = heurisch_wrapper(g, x, hints=[]) File "C:\Users b_se\AppData\Local\Programs\Python\Python38\lib\site-packages\sympy\integrals\heurisch.py", line 158, in heurisch_wrapper slns += solve([d], dict=True, exclude=(x,)) File "C:\Users b_se\AppData\Local\Programs\Python\Python38\lib\site-packages\sympy\solvers\solvers.py", line 1114, in solve solution = _solve_system(f, symbols, **flags)
@frankkoslowski6917
@frankkoslowski6917 2 жыл бұрын
Doesn't look much like a simplification to me. Which ever way, one always gets this: $\frac{1 - e^{- T k - 2 i \pi n}}{T k + 2 i \pi n}$
How To Interpolate Data In Python
15:21
Mr. P Solver
Рет қаралды 46 М.
The Fourier Series and Fourier Transform Demystified
14:48
Up and Atom
Рет қаралды 786 М.
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 55 МЛН
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 7 МЛН
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 71 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 72 МЛН
Understanding the Discrete Fourier Transform and the FFT
19:20
But what is the Fourier Transform?  A visual introduction.
20:57
3Blue1Brown
Рет қаралды 10 МЛН
Grad School Be Like...
3:35
Mr. P Solver
Рет қаралды 96 М.
Denoising Data with FFT [Python]
10:03
Steve Brunton
Рет қаралды 168 М.
When Your Code Runs Without Errors...
2:23
Mr. P Solver
Рет қаралды 115 М.
Plotting the Fourier Transform in Python (DFT/FFT)
10:46
Signal Processing with Paul
Рет қаралды 16 М.
Derivatives In PYTHON (Symbolic AND Numeric)
17:37
Mr. P Solver
Рет қаралды 46 М.
Python Libraries Be Like...
2:30
Mr. P Solver
Рет қаралды 95 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 608 М.
Best mobile of all time💥🗿 [Troll Face]
0:24
Special SHNTY 2.0
Рет қаралды 618 М.
Cadiz smart lock official account unlocks the aesthetics of returning home
0:30
Asus  VivoBook Винда за 8 часов!
1:00
Sergey Delaisy
Рет қаралды 1,1 МЛН
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 4,3 МЛН