Coding Challenge 125: Fourier Series

  Рет қаралды 581,004

The Coding Train

The Coding Train

Күн бұрын

In this coding challenge, I visualize a Fourier series for a square wave in JavaScript with p5.js. Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge #124:...
🎥 Next video: • Coding Challenge #126:...
🎥 All videos: • Coding Challenges
References:
🗄 Fourier Series: en.wikipedia.org/wiki/Fourier...
📄 Purrier Series (Meow) and Making Images Speak: bilimneguzellan.net/purrier-se...
📄 An Interactive Guide To The Fourier Transform by Better Explained: betterexplained.com/articles/...
Videos:
🎥 What is a Fourier Series?: • What is a Fourier Seri...
🎥 But what is the Fourier Transform? A visual introduction: • But what is the Fourie...
🚂 Polar Coordinates: • 3.4 Polar Coordinates ...
🔴 Coding Train Live 163: • Coding Train Live 163:...
Related Coding Challenges:
🚂 #61 Fractal Spirograph: • Coding Challenge #61: ...
🚂 #130 Drawing with Fourier Transform and Epicycles: • Coding Challenge #130....
Timestamps:
00:00 Welcome! Some resources on the Fourier Series
02:44 Explain! What is a Fourier Series?
07:00 Code! Create a dot spinning around a circle!
11:41 Code! Draw the wave path of the dot!
14:41 Oops! Invert the order of the wave!
16:16 Code! Add multiple circle waves!
23:50 Code! Draw the Fourier series!
25:30 Code! Add slider for number of circles!
27:39 Suggestions
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: kzbin.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#fourier #maths #javascript #p5js

Пікірлер: 508
@vigneshwarm
@vigneshwarm 4 жыл бұрын
3blue1brown recommended this video for his Fourier transform video
@akremhadji7326
@akremhadji7326 4 жыл бұрын
I've just watched it, it was amazing !!!
@FilthyManatee
@FilthyManatee 4 жыл бұрын
I just watched his video, then I tried coding my own Fourier series. Figured I would come on here and see what I did wrong.
@akremhadji7326
@akremhadji7326 4 жыл бұрын
​@@FilthyManatee In this video the Fourier series is developed in JavaScript language to be run on a normal web browser. If you want more advanced tools to work with such series you can use mathematical software (Matlab, Maple, Octave ..) they have many dedicated methods to be implemented easily. If you want to do things the hard way ;) you can download the code of the presented script in this video and try to modify the coefficients or change other parameters.
@FilthyManatee
@FilthyManatee 4 жыл бұрын
@@akremhadji7326 I wrote mine in the hard/fun way (javascript/canvas) already. I did it very differently than what was shown here, but was still able to learn a thing or two watching this video. It gave me a few things to think about and change in my code. I went right into the chain of alternating spinning vectors and drawing from the last point on the chain.
@ejejej9200
@ejejej9200 4 жыл бұрын
I came here from 3 Blue 1 Brown. And, I am so happy I did! This is a great channel! :)
@oscard4801
@oscard4801 5 жыл бұрын
I'm 11 and I'm from Mexico, and have been programming for 3 years and Coding Train is my source of inspiration and learning.
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
So nice to hear! Please feel free to share anything you make 🙂
@GodofChookie
@GodofChookie 5 жыл бұрын
it's awesome to have such a productive hobby you get enjoyment from and willingly invest your free time. especially at such a young age. keep it up
@philippg6023
@philippg6023 5 жыл бұрын
Awesome keep it up
@LongLe-nt8bv
@LongLe-nt8bv 5 жыл бұрын
b0ss thats great for his age and its called a "comment", plus he just want to say thanks to Daniel
@oscard4801
@oscard4801 5 жыл бұрын
​@@don1041 I learned Javascript, p5.js, HTML and CSS
@jonnylinford
@jonnylinford 5 жыл бұрын
So happy to see you and Destin interact. This is the intersection of all the best content on KZbin
@blasttrash
@blasttrash 5 жыл бұрын
who is destin?
@alexandermcclure6185
@alexandermcclure6185 12 күн бұрын
@@blasttrash destin is the smarter every day dude
@x-lightsfs5681
@x-lightsfs5681 5 жыл бұрын
That took me -1/12 lines of code
@sujals7108
@sujals7108 5 жыл бұрын
Infinite lines is impossible.
@x-lightsfs5681
@x-lightsfs5681 5 жыл бұрын
@@sujals7108 But what if i made a code that adds a line to the js file every frame?
@sujals7108
@sujals7108 5 жыл бұрын
@@x-lightsfs5681 Then to make infinite lines, you would need an infinite number of frames, hence infinite time.
@poopmaster9984
@poopmaster9984 5 жыл бұрын
@@sujals7108 how bout making more line each frame? Then you'll get to infinity in no time :v
@PhoenixD
@PhoenixD 5 жыл бұрын
@@x-lightsfs5681 cant go to infinity since memory is always limited :)
@RoGeorgeRoGeorge
@RoGeorgeRoGeorge 5 жыл бұрын
@3:30 What you are calling "Amplitude" is in fact the "Peak to Peak" value. The "Amplitude" will be only half of that.
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Indeed, thank you for the correction!
@CJBurkey
@CJBurkey 5 жыл бұрын
But the coefficient (often called amplitude) is the vertical peak to peak distance of the wave.
@NoorquackerInd
@NoorquackerInd 4 жыл бұрын
@@CJBurkey Peak-to-Peak value isn't the coefficient or the amplitude. Peak is the absolute distance from the average of a function to either the min or max and peak-to-peak is the absolute distance from min to max. The amplitude is the peak value, and on sinusoidal functions, the peak-to-peak value is double the amplitude or peak value. This is more of the electrical engineer view of it, though
@sergey1519
@sergey1519 3 жыл бұрын
What are you calling "peak to peak value" is in fact sometimes called "peak to peak amplitude", and what you calling "amplitude" is sometimes called "semi-amplitude". It's kinda similar situation as with "Natural numbers" - the name is ambiguous and it's better to refer to it either as "Positive integers" or "Non-negative integers" depending on what exactly you mean.
@sharphurt8753
@sharphurt8753 5 жыл бұрын
I'm Russian student and I want to express my huge thanks to The Coding Train channel! Thanks to you I have top marks in my school! The whole world loves you!!!
@cassandradawn780
@cassandradawn780 5 жыл бұрын
Я думал русских ент
@maximgasai1349
@maximgasai1349 5 жыл бұрын
Теперь это русский чат макс репост
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Thank you!
@sharphurt8753
@sharphurt8753 5 жыл бұрын
@@maximgasai1349 Русские везде Russians everywhere
@user-xh9pu2wj6b
@user-xh9pu2wj6b 5 жыл бұрын
@@sharphurt8753 у вас в школе преподают JS? Жестко.
@ibuucoksiregar9024
@ibuucoksiregar9024 4 жыл бұрын
90% of my coding skill is from Coding Train. Everytime my friends ask me where i learned something, I always show them this channel. I love this channel so much❤️❤️
@carlosmorasalguero
@carlosmorasalguero 5 жыл бұрын
Wow, smarter every day in the coding train... Avengers is no longer the most ambitious crossover in the history of the world
@revimfadli4666
@revimfadli4666 5 жыл бұрын
Yeah who needs Rewind if they keep making quality crossovers like these
@abhishektyagi4428
@abhishektyagi4428 5 жыл бұрын
Fuckavengers
@AdamBechtol
@AdamBechtol 4 жыл бұрын
:p
@USAwizeguy
@USAwizeguy 5 жыл бұрын
As an EET major looking back at studying how to code, I love this! We look at wave forms all day. I am going to recreate this and show my fellow electrical engineers at work.
@SineEyed
@SineEyed 4 жыл бұрын
Did you do it? Were they impressed, or at least mildly entertained?..
@alexandermcclure6185
@alexandermcclure6185 12 күн бұрын
please we need an update
@PatrickAnimator
@PatrickAnimator 5 жыл бұрын
dude...I am obsessed. you are literally one of the best teachers Ive ever experienced.
@sirecartier7881
@sirecartier7881 5 жыл бұрын
I am a high-school student from France and I am really happy to see how great and efficient code can be with people like you!!!
@sobanudlz
@sobanudlz 5 жыл бұрын
*Procrastinating intensifies*
@AntonySimkin
@AntonySimkin 4 жыл бұрын
Underrated comment lol
@TheFishKing64
@TheFishKing64 3 жыл бұрын
hah, yeah
@unlikelysalmon786
@unlikelysalmon786 3 жыл бұрын
hell, there are worst ways to distract yourself. programming fourier transformations is a decent way to waste your time (though time spent learning isn't wasted, I'm told)
@snacksy7754
@snacksy7754 4 жыл бұрын
28:28 I love that ending. *Has a good moral:* If you stumble over your words instead of trying to solve the confusion just give up, blow your flute, and say goodbye :D
@ianprado1488
@ianprado1488 5 жыл бұрын
I need to more consciously appreciate the amazing, high quality content on KZbin. We are living in a beautiful time in history
@iVideo1011
@iVideo1011 5 жыл бұрын
Just stumbled across your channel. This is the best KZbin channel I've ever seen. So many high quality videos and such great teaching and enthusiasm. I'm just speechless!
@dianewilliams5830
@dianewilliams5830 5 жыл бұрын
Thank you. As always, you make learning so much fun. I've never been able to visualize how Fourier creates a square wave or any wave until now.
@MrSonny6155
@MrSonny6155 4 жыл бұрын
After visualising this in the full complex form, it becomes pretty clear how higher frequencies enhance the "precision" of the wave position. I love how the whip rolls up into a tight ball with each rotation and each addition of epicycles.
@shashik962
@shashik962 5 жыл бұрын
My favourite channel... This is really great...
@oblivionronin
@oblivionronin 4 жыл бұрын
An interesting thing that was done i think in 3blue1brown was to assign random or non-regular growing or shriking radius to the circles. Theses Fourrier series create really unique and interesting patterns, some of them event ressembing famous man made paintings.
@RicardoOliveiraRGB
@RicardoOliveiraRGB 4 жыл бұрын
It's the first video of yours i've seen, and damn! I wish my brain could think that fast for programming crazy math stuff lol. Congrats man, you got a new fan here
@zackd41
@zackd41 5 жыл бұрын
LOVE The Crossover with Smarter everyday, Been getting into coding because of you, thanks!
@shannonadamj
@shannonadamj 5 жыл бұрын
Yoooo nice plugging smartereveryday. I love that channel.
@AliParlakci
@AliParlakci 5 жыл бұрын
1:21 Website's name actually means "science is so beautiful"
@ferhatakan5056
@ferhatakan5056 4 жыл бұрын
dafgjkdfjaglh
@Abhishek-hy8xe
@Abhishek-hy8xe 3 жыл бұрын
I love this channel and this guy and all the videos. Thank you .
@POPO-od8jb
@POPO-od8jb 4 жыл бұрын
Isn't it so satisfying to witness that sine waves are making rectangular wave , that ending of this video made my whole 2019 yr , and a good start of 2020 , thanks for this awesome video 🌷
@HeerdyesMahapatro
@HeerdyesMahapatro 2 жыл бұрын
Fantabulous! This needs to be taught in every DSP course!
@myetis1990
@myetis1990 4 жыл бұрын
You can translate Bilimneguzellan= Bilim+ne+ guzel +lan = Science+ what+ beautiful +guy = hey guy Science is what a beautiful thing ! for pronounciation, go to google translate, select turkish , type the "Bilim ne güzel lan" and tap the voice button :)
@muhtesemtavasap6411
@muhtesemtavasap6411 4 жыл бұрын
Oh be gördüm rahatladım. Yoksa ben yazacaktım.
@eminmerden1072
@eminmerden1072 3 жыл бұрын
Iyi yetiştin
@amorphsilicon938
@amorphsilicon938 3 жыл бұрын
Adamsın, adam sitenin ismini okurken bunaldım...
@ataberkaslan2235
@ataberkaslan2235 3 жыл бұрын
djfsdfsjdfjdfljdfg çok iyi okumadı mı dfghjkdfghjdfghjhjdfgkdfg
@sonik382
@sonik382 5 жыл бұрын
Awesome, interesting and instructing. Thank you for all the effort you put in the channel!
@FM-kl7oc
@FM-kl7oc 4 ай бұрын
27:18 Kinda cool illustration of aliasing that happens when the sampling rate is not a perfect multiple of the signal frequency being sampled. After increasing it to 100, sometimes you get a big spike at the corners on the square wave, sometimes not -- this is the aliasing. Sometimes you're "lucky" to sample (draw) when the tip of the pendulums are at the very top or bottom of the corner, and you get a spike. Sometimes you're "unlucky" to sample (draw) when the tip of the pendulums are not near the top or bottom, and you get a more traditional "90 degrees corner" without the spike.
@tmendoza6
@tmendoza6 2 жыл бұрын
this is so freaking fantastic! I could do this all day
@siddhantrai7529
@siddhantrai7529 5 жыл бұрын
I love the way the best and the brightest youtube channels are inspired and motivated by each other...that is a really positive environment.... Siraj,you,smarterEveryday,3 blue 1 brown..... You guys really help me and many others as well . Thank you.
@deez_gainz
@deez_gainz 5 жыл бұрын
That refactoring song though ahah! We need 10 hour version for productive coding work!
@izzy31337
@izzy31337 5 жыл бұрын
you always release coding challenges just when im studying a specific topic
@marcinkienast1134
@marcinkienast1134 5 жыл бұрын
Yeah, I'm supposed to study algorithms and time complexity proving. So... I guess I will fail the test, but I will know a bit more about FS. Totally worth it xD
@marcus_w0
@marcus_w0 5 жыл бұрын
Right? I was recently looking into graph plotting and stumbled upon this, too. And within a week there this video. Hee's tracking my browser history.... I have to go.
@maxteer2800
@maxteer2800 4 жыл бұрын
I really appreciate the goofs and slight logic mistakes on this one, it was almost more enlightening than if he had just done the thing
@gloubiboulgazeblob
@gloubiboulgazeblob 4 жыл бұрын
awesome !!! The movement of all those circles radii looks so "biologic", fascinating !
@jonathanwalther
@jonathanwalther 5 жыл бұрын
Best analogy ever. Very smooth.
@HisMajesty99
@HisMajesty99 5 жыл бұрын
This was amazing, thanks for doing a video on this
@jerryplayz101
@jerryplayz101 5 жыл бұрын
4:12 - To play a musical note, the sine wave is made of multiple sine waves. You have the note you want, but you also have some overtones.
@xnick_uy
@xnick_uy 5 жыл бұрын
The end result looks like a fantastic whip. WT-TSH!!
@abhijithnair3078
@abhijithnair3078 5 жыл бұрын
It's wappah
@MACHINEBUILDER
@MACHINEBUILDER 5 жыл бұрын
Wow awesome job it's super satisfying! :)
@michael-gary-scott
@michael-gary-scott 5 жыл бұрын
I’m actually so excited for this video
@kavinbharathi
@kavinbharathi 4 жыл бұрын
the slider part at the end is even more interesting as it gives even chaotic curve which when condensed give non continuous sine waves of different frequencies......*wow*
@jegant8216
@jegant8216 4 жыл бұрын
This is a good example of coding Fourier series, thanks.
@Wolf-gt3kd
@Wolf-gt3kd 4 жыл бұрын
This was really fun to watch that i didn't notice the video's lengh was 30min. Nice work really :D
@BonsayCow
@BonsayCow 5 жыл бұрын
Fun fact at 27:20 you can see spikes on the corners of the function and this is called the Gibbs phenomenon and you can never get rid of it, due to the discontinuity of the function that you are trying to approximate.
@jonathangodar4239
@jonathangodar4239 5 жыл бұрын
I searched on how to get the x and y values on something that had been rotated for hours. I knew that it would be something having to do with the angle and the hypotenuse, but I never found what I was looking for. I finally got the answer by some guy on Reddit this morning. Why couldn’t I have watched this video when I really needed it?
@HardusHavenga
@HardusHavenga 5 жыл бұрын
Dude, you are my new hero.
@JenishJain6
@JenishJain6 5 жыл бұрын
What a coincidence the video was suggested to me just when I was about to start Fourier series for my exam prep.👻
@kindpotato
@kindpotato 5 жыл бұрын
I'm glad after a couple years of thinking about the fourier transform, I made something like what he talked about with the homer simpson being drawn,
@askquestionstrythings
@askquestionstrythings 5 жыл бұрын
I was anticipating your video since you mentioned doing this in the smarter everyday video comments.
@Apocalypsee07
@Apocalypsee07 5 жыл бұрын
I like these Coding Challange videos :) trying to replicate these in python makes learning so much fun and also easier. Thank yyou!
@Brenzle
@Brenzle Жыл бұрын
What do you use to draw in python? Turtle?
@iqbaltrojan
@iqbaltrojan 4 жыл бұрын
27:38 - 27:40 there is a time where the line is near horizontal facing right! pause and use the , (comma) and . (period/full stop) to go back/forward by 1 frame edit: press 27:38 then wait for it to go right edit 2: 27:55 also edit 3: also at 27:54 it's at a very high point (right side)
@SreenikethanI
@SreenikethanI 4 жыл бұрын
hehe yeah even I noticed that, when all the circles are extended to the right, it essentially cuts the wave!!!
@anandprakash4995
@anandprakash4995 5 жыл бұрын
This video inspired me to learn p5.js .Will be my new resolution to learn p5.js !!!
@matthewvicendese1896
@matthewvicendese1896 5 жыл бұрын
You can make y = negative radius sin(time) ..... because y is upside in computer land.
@sidim.aourid9958
@sidim.aourid9958 5 жыл бұрын
The amplitude is from axis x to max or to min. Example if, s(t) = a sin(t), a is the amplitude. Thank you for all your videos, they are instructive and well done.
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Thanks for the correction!
@mefuri_k
@mefuri_k 5 жыл бұрын
You have a great taste on youtube channels you watch
@yusufberkaygirgin9694
@yusufberkaygirgin9694 5 жыл бұрын
page's name is "bilim ne guzel lan" and it means in english "science is what a sweet thing buddy" :D
@djtygre
@djtygre 5 жыл бұрын
my most favorite to date
@AlGhifari7
@AlGhifari7 4 жыл бұрын
Hey, go to 3Blue1Browns Channel for a new video about Fourier Series!!
@eda-un8zr
@eda-un8zr 3 жыл бұрын
I'm native Turkish and i like how you pronounce the name of the website :D and great video, thank you
@xnick_uy
@xnick_uy 5 жыл бұрын
In case you are wondering, although a Fourier Series and a Fourier Transform are not the same, it is possible to devise a framework in which you can formally treat them on equal footing if you want to (you might need to look into Dirac combs and intervals of ever-increasing length). And more importantly: within the realm of numeric computation you are pretty much forced to use the *Discrete* Fourier Transform instead of the "bare" (continuous) Fourier Transform, which turns out to be essentially the same as the Fourier Series. (I'm assuming you don't make a distinction about using either trigonometric functions or complex exponential).
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Thanks for this clarification! I'm hoping to do a video on DFT next!
@alajlan2012
@alajlan2012 5 жыл бұрын
this is EPIC , would you please continue uploading like this content? especially on fourier drwaing visuals?
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
yes, i'm planning to!
@joecamroberon9322
@joecamroberon9322 5 жыл бұрын
You deserve so much more attention.
@aeswere
@aeswere 5 жыл бұрын
I took a small hiatus from this channel but came back as I was bored, decided to follow this video (I usually watch). I changed the slider into an input box so you could input whatever number you'd like, and the circles would be added. I'm not sure if this is the best way to use an input box in this scenario but it does work. function setup() { createCanvas(960, 350); input = createInput(); input.position(5, 325); } function draw() { frameRate(30) background(0); translate(200, 200); let x = 0; let y = 0; let circles = 0; if (input.value() == 0) { circles = 1; } else { circles = input.value(); } for (let i = 0; i < circles; i++) { let prevx = x; let prevy = y; let n = i * 2 + 1; let radius = 50 * (4 / (n * PI)); x += radius * cos(n * time); y += radius * sin(n * time); stroke(255, 100); noFill(); ellipse(prevx, prevy, radius * 2); //fill(255); stroke(255); line(prevx, prevy, x, y); //ellipse(x, y, 8); }
@tomasvenegas6062
@tomasvenegas6062 3 жыл бұрын
How did you make the html document or how did you see the code in Chrome?
@matthewvicendese1896
@matthewvicendese1896 5 жыл бұрын
I am so excited !!
@luisaisat
@luisaisat 5 жыл бұрын
thanks, yesterday i was trying this
@BillyBustamante
@BillyBustamante 3 жыл бұрын
Primer video que veo. Adoro!
@shamilcarela1699
@shamilcarela1699 5 жыл бұрын
Great video, loved it.
@bertronixtv
@bertronixtv Жыл бұрын
Amazing. Thank you for sharing your awesome skills.
@clementlebeau484
@clementlebeau484 5 жыл бұрын
I’d love to see a part 2!
@AmirAdzim
@AmirAdzim 5 жыл бұрын
Just to correct you there on the definition of amplitude at about 3:45 the amplitude is the height difference between the very top and the middle part of the wave (position of equilibrium) :) overall very nice video!
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Yes indeed, thank you for pointing this out!
@AmirAdzim
@AmirAdzim 5 жыл бұрын
@@TheCodingTrain thank you as well for providing very educational (and interesting) content!
@rahulbansode1537
@rahulbansode1537 5 жыл бұрын
What do you mean the middle part or position of equilibrium Sorry I don't understand
@AmirAdzim
@AmirAdzim 5 жыл бұрын
@@rahulbansode1537 the point that is right in between the highest peak and the lowest peak of the sine wave is called the equilibrium position. Say you have a child on a swing. The equilibrium position is the position of the child when the swing is at rest. When the child starts swinging, the highest peak (and this is relative) is when the child is on the highest position in front (positive) of the equilibrium position and the lowest peak is when the child is on the highest position behind (negative) the equilibrium position. So the amplitude (or in this case the maximum height at which the child is swinging at) is the height difference from the position of equilibrium (not swinging) to any of the maximums (either behind or in front of the swing). Sorry if this analogy is too complicated im not really good at explaining stuff.
@rahulbansode1537
@rahulbansode1537 5 жыл бұрын
@@AmirAdzim that was a great explanation thank you!
@bobbymcdingdong
@bobbymcdingdong 4 жыл бұрын
Brother, dude, friend Daniel, thank you!
@vladimirshitov2160
@vladimirshitov2160 5 жыл бұрын
Damn, I love Python and wanna use it for work. But I don't know yet how to do all these cool stuffs in Python so I learn JS because of this channel :D Thank you, that is great!
@devious5348
@devious5348 4 жыл бұрын
python has p5 too
@wesleycantarino4464
@wesleycantarino4464 5 жыл бұрын
this video made me study Fourier series again
@OonHan
@OonHan 5 жыл бұрын
I needed this
@smanzoli
@smanzoli 5 жыл бұрын
Interesting to see the fractal tree branches being produced here by the circles radiuses 23:50
@bamkparto
@bamkparto 5 жыл бұрын
4:56 - Fourier Serier is like a smothie, like a video in premiere, like a song in FL, like a 3d scenerey in Blender,like a lego model, 7:53 - 10:09 - VS autocomplete feature 3:45 - Amplitude is the height difference between the very top and the middle part of the wave (position of equilibrium) :) overall very nice video! ​​@irAdzimm by @K When you went to 100 iterations for the square wave, the overshoot spike would jump from the top of the wave to the bottom after it was already drawn. Look around @ and pay close attention to the top and bottom of the wave after they're drawn, as they move across the screen. *Related* *Projects* kzbin.info/www/bejne/eZupg2emZrKqpsk @t
@anjardwisaputra1671
@anjardwisaputra1671 5 жыл бұрын
AMAZING!!
@RegisMichelLeclerc
@RegisMichelLeclerc 3 жыл бұрын
Cool! In generating sound samples, it means I can represent anything by a series of function modifiers, amount depending of the level of precision I need. Now, how can I do the opposite, i.e. transform an arbitrary sample to a series of modifiers? IIRC, Mathologer did something like that with his Homer Simpson drawing using a similar mechanism, (epicycles) but he used Mathematica to figure the functions, not very practical. Is there a way to do that with JS instead?
@diemirarr4728
@diemirarr4728 5 жыл бұрын
Amazing!
@johnvonhorn2942
@johnvonhorn2942 5 жыл бұрын
This guy is the smartest guy in the neighborhood - the Mr Rogers of code.
@stuartyellow1679
@stuartyellow1679 5 жыл бұрын
Do you know about the Gibbs phenomenon? It dosent matter how hard you (your computer) try you will have those "peaks" at discontinuities. Only if you add up infint waves it is theroretically converging to the rectangular function. I hope my explantion makes sense :)
@johnphilmore7269
@johnphilmore7269 5 жыл бұрын
Hey man! Found your channel today And I really love it! I do want to just correct a little error. There’s a difference between the Fourier TRANSFORM and the Fourier SERIES. The transform is indeed unsmoothying a smoothie so to say, but that has to do with infinity integrals in the complex plane (don’t ask). The series on the other hand takes a periodic function and approximates it with an infinite series of simple sines and cosines. Kinda like a Taylor series for periodic waves. There may be a connection between the two, I don’t deal with them a lot in my life, but just wanted to let ya know 😊 Edit: ah I see u addressed it. Thank you!
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Thanks for the feedback!
@johnphilmore7269
@johnphilmore7269 5 жыл бұрын
The Coding Train my pleasure! I really enjoy the channel! Will be staying glued to ur work for a good long while As a coding challenge, why not try Runge Kutta approximations of differential systems? Something very similar to what you did with Lorenz System, but much more accurate. Just maybe something to tickle your fancy
@user-co5ob1fv1m
@user-co5ob1fv1m 5 жыл бұрын
Very very useful. Thank you so much Dan
@johnnyserup5500
@johnnyserup5500 4 жыл бұрын
I like your approach to explanation - really interesting - cool video
@fatehaligolani7751
@fatehaligolani7751 4 жыл бұрын
Thank you so much man
@alonh.4968
@alonh.4968 4 жыл бұрын
OMG, I like this channel a lot! thank you and, btw, how did you cancel the auto-fill? 😂
@germandavidmurillasmondrag4004
@germandavidmurillasmondrag4004 4 жыл бұрын
very nice code, ofcourse would be nice other slider for time this is the function that I made for this timeslider = createSlider(0.001, 0.05,0.001,0.001); and then where it is time u put timeslider, the variables for this are (min,max,default,setpbystep)
@buddhanag4987
@buddhanag4987 5 жыл бұрын
Just awesome
@The.Jaynish
@The.Jaynish 4 жыл бұрын
You are the best man
@oxydol3456
@oxydol3456 2 жыл бұрын
Thanks!
@TheCodingTrain
@TheCodingTrain 2 жыл бұрын
Thank you for the support!
@easyunderstandbanglatv7080
@easyunderstandbanglatv7080 5 жыл бұрын
Brother me Bangladeshi your good tips my head very easy work thank you so much brother
@jamesstreets5176
@jamesstreets5176 2 күн бұрын
good video :)
@morphyngames
@morphyngames 5 жыл бұрын
Thanks for making the video
@gwawrz1
@gwawrz1 5 жыл бұрын
I'm curious, what's that song "I will refactor this later"? :D
@rafaelamaral7756
@rafaelamaral7756 Жыл бұрын
this guy is so funny i love it
@cainespade514
@cainespade514 3 жыл бұрын
What I see is "The Professor" is teaching us the Fourier
@Moccar
@Moccar 5 жыл бұрын
Shoutout to 3blue1brown! His videos are really good as well as yours Dan!
@harrysvensson2610
@harrysvensson2610 4 жыл бұрын
28:20 Eyyy that would be based on quaternions. Fun.
@Forced2
@Forced2 4 жыл бұрын
Is it just me or is this pattern of circles rotating around eachother looking like a whip when it reaches a hundred. Maybe this is how a whip delivers such a fatal blow.
Coding Challenge #126: Toothpicks
31:13
The Coding Train
Рет қаралды 82 М.
Coding Challenge #130.1: Drawing with Fourier Transform and Epicycles
46:09
SHE WANTED CHIPS, BUT SHE GOT CARROTS 🤣🥕
00:19
OKUNJATA
Рет қаралды 14 МЛН
顔面水槽をカラフルにしたらキモ過ぎたwwwww
00:59
はじめしゃちょー(hajime)
Рет қаралды 19 МЛН
Coding the Collatz Conjecture
23:08
The Coding Train
Рет қаралды 128 М.
Coding Challenge 183: Paper Marbling Algorithm
32:10
The Coding Train
Рет қаралды 58 М.
Coding Challenge 168: MandelBulb 3D Fractal
28:02
The Coding Train
Рет қаралды 364 М.
Coding Challenge #139: Calculating Digits of Pi with Collisions
31:42
The Coding Train
Рет қаралды 409 М.
Coding Challenge 166: ASCII Text Images
22:42
The Coding Train
Рет қаралды 1,1 МЛН
Coding Challenge #143: Quicksort Visualization
30:06
The Coding Train
Рет қаралды 244 М.
Coding Challenge #127: Brownian Tree Snowflake
19:25
The Coding Train
Рет қаралды 79 М.
Coding Challenge #12: The Lorenz Attractor in Processing
21:21
The Coding Train
Рет қаралды 404 М.
Coding Marching Squares
26:28
The Coding Train
Рет қаралды 175 М.
Coding Challenge #124: Flocking Simulation
42:27
The Coding Train
Рет қаралды 323 М.