3. Divide & Conquer: FFT

Sdílet
Vložit
  • čas přidán 3. 03. 2016
  • MIT 6.046J Design and Analysis of Algorithms, Spring 2015
    View the complete course: ocw.mit.edu/6-046JS15
    Instructor: Erik Demaine
    In this lecture, Professor Demaine continues with divide and conquer algorithms, introducing the fast fourier transform.
    License: Creative Commons BY-NC-SA
    More information at ocw.mit.edu/terms
    More courses at ocw.mit.edu

Komentáře • 201

  • @junweima
    @junweima Před 5 lety +405

    Erik: "I didn't go to high school but I assume in high school you learned this..."

  • @KaushikMishrakk
    @KaushikMishrakk Před 4 lety +206

    Just a tip for new viewers:
    Don't stop!! Continue watching the video, don't expect yourself to understand everything as you go, grab the essence of each section of the video and in the end it is all gonna make sense. If it did not you can always go back but don't quit this video. Amazing job Erik!!!

  • @andrestifyable
    @andrestifyable Před 5 lety +142

    Am I the only one really impressed by the quality of that chalk? It never makes those high pitched sounds ... soo smooth

    • @hektor6766
      @hektor6766 Před 5 lety +42

      It's called railroad chalk. Made with calcium sulfate (gypsum), not calcium carbonate (chalk). Softer than chalk hence bolder lines and no screech. Dustier though, so treated with a dust inhibitor, that's why the surface of the stick is yellow but it writes in white.

    • @matthewquinn5192
      @matthewquinn5192 Před 4 lety +2

      I didnt want to watch this video because i hate that sound so much, thank you for the reassurance so i can watch without fear

    • @vishalvibes_
      @vishalvibes_ Před 3 lety +2

      Is it hagoromo?

    • @henrypeterson8497
      @henrypeterson8497 Před 2 lety +1

      @@vishalvibes_ nope

  • @TW0T0NGUE
    @TW0T0NGUE Před 7 lety +118

    Not going to lie, I cam here to learn the FFT as an engineering student, but stuck around to learn about this CS time complexity.

  • @leminhphuc10t1
    @leminhphuc10t1 Před 5 lety +28

    The part about how size of X needs to be reduced by 2 when we go to X^2 is just brilliant! That explains the choice of x_k's that I saw on other ppl's implementation so well!

  • @abdulelahaljeffery6234
    @abdulelahaljeffery6234 Před 7 lety +90

    This is the best overview of what FFT is, brilliant teacher!

  • @henrytay1706
    @henrytay1706 Před 2 lety +5

    Professor makes his lecture seems the learning material is so easy! Thank you!

  • @skyzhangty1
    @skyzhangty1 Před 2 lety +3

    This is THE BEST FFT lecture ever. Erik is simply awesome!

  • @mario7501
    @mario7501 Před 3 lety +12

    Amazing to see that such a brilliant guy can also be a brilliant educator. From my experience this is pretty rare!

  • @nalcow
    @nalcow Před 9 měsíci +4

    Its always a pleasure to listen Eric's lecture. Great professor.

  • @personanongrata987
    @personanongrata987 Před rokem +4

    I first encountered the FFT derivation of the DFT thirty years ago when I took a digital filters class while a graduate student at Georgia Tech, and I am as bolled-over now as I was then by this most elegant and incredibly useful algorithm. Thank you, Professor Demaine.
    --

  • @aSeaofTroubles
    @aSeaofTroubles Před 7 lety +9

    One of the best lectures I've seen :) really brings out the true nature of the DFT

  • @yashjakhotiya5808
    @yashjakhotiya5808 Před 5 lety +9

    27:46, we can use Lagrange's Formula to compute Coefficients from Samples. It is O(n^2) but avoids inverse computation by Gaussian Elimination.

  • @szyszkienty
    @szyszkienty Před 2 lety +1

    This guy oozes brilliance! Amazing lecture!

  • @sanatanshrivastava1725

    As he puts it, this all was "very cool, very cool".
    Thanks, Erik.

  • @tibortresla
    @tibortresla Před 7 lety +54

    These tattoo jokes tho. BRILLIANT!

  • @programmingbro2424
    @programmingbro2424 Před 2 lety +2

    this lecture is freaking amazing

  • @chethankumar4303
    @chethankumar4303 Před 6 lety +8

    Gave an in depth understanding of FFT...Brilliant Explanation

  • @Kaslor1000
    @Kaslor1000 Před 5 lety +2

    Phenomenal lecture.

  • @randomperson1048
    @randomperson1048 Před 3 lety +3

    Real men cried at the end when he brought up those applications. Truly beautiful mathematics

  • @akshaydarekar5863
    @akshaydarekar5863 Před 5 lety +24

    My Brain Stack starts overflowing after 35:00.

  • @nikhil_kolla_12
    @nikhil_kolla_12 Před 4 lety +1

    Excellent explanation.

  • @stefanosmakris5641
    @stefanosmakris5641 Před 4 lety +1

    This was AWESOME! Thank you!

  • @iamshadmirza
    @iamshadmirza Před 7 lety +1

    This guy is amazing

  • @mavenuparker
    @mavenuparker Před 7 lety +3

    Didn't know that Jin from SamuraI Champloo now teaches at MIT.
    Thanks for the amazing overview of FFT. Amazing lecture

    • @SR-kp8zu
      @SR-kp8zu Před 4 lety

      lmaooo did not expect to see a samurai champloo reference while learning about the FFT

  • @sa6opopov
    @sa6opopov Před 3 měsíci

    This is the most beautiful algorithm I have seen

  • @sakules
    @sakules Před 5 lety +1

    wonderful teacher

  • @DominicLondon
    @DominicLondon Před 6 lety +68

    Beware of the plot τwist.

  • @paragggoyal1552
    @paragggoyal1552 Před rokem

    at last, absolute detail!

  • @vamsimohan5369
    @vamsimohan5369 Před 3 lety +3

    Throughout the whole video i could not stop wondering about him(he is a child prodigy, became a professor at MIT at 20 )

  • @muhammedafifi6388
    @muhammedafifi6388 Před 5 lety +13

    I don't know how I used to call myself an engineer before watching this video!

  • @fatihcihanhizlikan1427

    I loved this video.

  • @RSPSupply
    @RSPSupply Před 6 lety

    Great Job!

  • @andrewolesen8773
    @andrewolesen8773 Před 6 lety

    So is the Nfft value for the FFT function in the matlab signal analyzer app the same as the 'n value rounded to the next largest power of 2' he talks about in the video?

  • @shivamtomar2325
    @shivamtomar2325 Před 3 lety

    Nicely explained

  • @kaushiksurikuchi
    @kaushiksurikuchi Před 6 lety +1

    Erik, the best

  • @c0t556
    @c0t556 Před 5 lety +3

    This guy is so cool

  • @BuiDucLoc419
    @BuiDucLoc419 Před 4 lety

    Best lecture

  • @jayhoeliotdecabrio4050
    @jayhoeliotdecabrio4050 Před 2 lety +2

    Erik: "I didn't go to high school but I assume in high school you learned this..." reminds me seldon cooper

  • @everaldoantoniomoreiraalve1023

    Amazing!

  • @chinmaydas4053
    @chinmaydas4053 Před 3 lety +1

    Sir what is the best programming language for analysis and design of data structures and algorithms??...

  • @udomatthiasdrums5322
    @udomatthiasdrums5322 Před 4 lety

    love it!!

  • @suicide_king6804
    @suicide_king6804 Před 6 lety +14

    Having barely mastered some basic arithmetic, this may be a little advanced...even though I have no idea wtf this guy is talking about/drawing, it is fascinating to try and understand it.

  • @MaxMarrone
    @MaxMarrone Před 5 lety +4

    Okay, we've figured out how to convert between different representations of polynomials, but how do we go from there to the familiar application of the FFT - converting between the time domain and frequency domain? Given a bunch of samples, we want a weighted sum of sinusoids, but what we get here is the coefficients of a polynomial.

    • @sophiophile
      @sophiophile Před 3 lety +1

      This question has been plaguing me for a while. Did you ever discover an answer to this.

    • @THeMin1000
      @THeMin1000 Před 2 lety +2

      @@sophiophilethe coefficients that we get IS the FT, instead of the points being the coefficients of the polynomial representing the time domain function we get the samples from the polynomial representing the polynomial in frequency domain.

  • @rohankhandelwal7681
    @rohankhandelwal7681 Před 4 lety +14

    i was present in this class

    • @Deshammanideep
      @Deshammanideep Před 4 lety +3

      That's a great thing. What are you doing now brother...?

    • @vetiarvind
      @vetiarvind Před 3 lety

      Wow you went to mit? How did you apply, from India or USA?

  • @linuxmaster2327
    @linuxmaster2327 Před 4 lety

    I love you teacher

  • @RandomGuy12562
    @RandomGuy12562 Před 7 lety +12

    is there a mistake @28:35 ?
    we know V.A = Y ( V - vandermond matrix, A - coefficien matrix, Y - samples matrix)
    (multiplying by V inverse i.e. V^(-1) both sides)
    => V^(-1).V.A = V^(-1).Y
    => A = V^(-1).Y
    So to go from samples matrix to coefficient matrix we need to do V^(-1).Y right ??

    • @donxu1332
      @donxu1332 Před 7 lety

      you are right.
      it is a mistake

    • @danielf9110
      @danielf9110 Před 6 lety

      I think you are correct

    • @AdamCajf
      @AdamCajf Před 6 lety

      Yes, this should be V^{-1} Y

  • @prateeksamaiya
    @prateeksamaiya Před 6 lety +4

    the product of two n-1 degree polynomial will be 2n-2 and we need 2n-1 unique points to derive a 2n-2 degree polynomial and nth root of 1 gives just n points and not 2n So My question is dont we need 2n points intead of n?

    • @_rashadmammadov_
      @_rashadmammadov_ Před 6 lety +1

      It's already been noted that two polynomials should be reduced to the same degree and up to the nearest power of 2 (simply by adding the coefficients with zeros). In addition, as a result of the product of two polynomials of degree (n - 1) a polynomial of degree (2n - 2) is obtained; therefore, in order for the result to be correct, it is necessary to double the degrees of each polynomial (again by adding zero coefficients to them)

  • @domenicozaza192
    @domenicozaza192 Před rokem

    The tatoo gag is amazing!

  • @kaiovieira230
    @kaiovieira230 Před 3 lety

    Awesome!

  • @khoily9137
    @khoily9137 Před 5 lety +6

    High pass filter removes low frequency, and low pass filter removes high frequency

    • @xinli6243
      @xinli6243 Před 5 lety

      yeah, I caught this as well.

  • @kaustavguharoy4532
    @kaustavguharoy4532 Před 2 lety

    Marvellous

  • @Selbstzensur
    @Selbstzensur Před 3 lety +1

    This was hard. Hope i will understand it soon.

  • @abugigi
    @abugigi Před 9 měsíci

    Erik is Demaine man!

  • @martinstefcek4089
    @martinstefcek4089 Před 6 lety +1

    The root representation should be (x-r1)...(x-r(n-1)) not from (x-r0), you can easily see that if you do it from r0, then you will have polynomial of x^n (which is one degree higher than what he used in the first rep.)

    • @sophiophile
      @sophiophile Před 3 lety +1

      He did this because he claimed you need n points to represent an n-1 polynomial. If you watch later into the video, he wrote it in this weird way cuz he was centring things around the number of points you need, not the number of coefficients represent the polynomial.

  • @woosix7735
    @woosix7735 Před rokem

    I like this guy

  • @leeris19
    @leeris19 Před dnem

    COOL! The only thing I don't prefer ( for lack of nicer word ) is the fact that he used a claim for last proof (IFFT). The problem with claims is that they are the result of some careful thinking, we're just proving that that thinking is correct. It would have been beautiful if he showed us the steps that resulted in the inverse of V being a n * V conjugate so we can fully sympathize for I believe sympathizing is the best way to learn math

  • @TheBoutchard
    @TheBoutchard Před 3 lety +1

    Me: Has a school assignment where I have to implements an algorithm dividing two polynomials and I have no idea what to do
    This man: I'm about to save this man whole career

  • @beback_
    @beback_ Před rokem

    How does one perform FFT on a larger domain consisting of multiple cosets of a multiplicative subgroup of the field? I've heard it can be done but couldn't find any sources that explained how.

  • @noguide
    @noguide Před 5 lety +3

    *Stands up & claps* Eric, take a bow. This should be the reference for any instructor of how to explain the FFT.

  • @azizchafik
    @azizchafik Před 4 lety

    in 42:06 I think we need to compute the sum of cost in each level not only the last !!!

  • @shivamp5410
    @shivamp5410 Před 3 měsíci

    Why do we still have x elements when we split the set and each part has n/2? I'm a bit confused on this part any help would be appreciated. Thanks.

  • @Selbstzensur
    @Selbstzensur Před 3 lety

    44:00 in this moment, all the other stuff about fft made a little more sense :-)

  • @vivekdabholkar5965
    @vivekdabholkar5965 Před rokem +3

    Nice lecture! I thought MIT classes would be very hard.

    • @BTDiLmarinen
      @BTDiLmarinen Před rokem +1

      MIT isn't a place for geniuses, it's just a normal university that only accepts students that can apply themselves.

  • @roushankumar-lu2ov
    @roushankumar-lu2ov Před 5 lety +2

    I'm in third semester,but this particular video seems to much difficult ,there are so many things in this I don't know

  • @madhukiranattivilli2321
    @madhukiranattivilli2321 Před rokem +1

    Implemented FFT algo for both polynomial multiplication and integer multiplication
    Deadly algo :)
    % java FFTPolynomialMultiplication
    i/p polynomial A :
    2 + 3x + xˆ2
    i/p polynomial B :
    1 + 2xˆ2
    n (=2ˆk) = 8
    o/p polynomial C :
    2 + 3x + 5xˆ2 + 6xˆ3 + 2xˆ4
    % java FFTPolynomialMultiplication
    i/p polynomial A :
    8 + 7xˆ2 + 3xˆ3 + 9xˆ5
    i/p polynomial B :
    4 + 5x + 6xˆ2 + 7xˆ3 + 8xˆ4
    n (=2ˆk) = 16
    o/p polynomial C :
    32 + 40x + 76xˆ2 + 103xˆ3 + 121xˆ4 + 103xˆ5 + 122xˆ6 + 78xˆ7 + 63xˆ8 + 72xˆ9
    % java FFTIntegerMultiplication
    i/p integers :
    A = 123,456,789
    B = 956,227,496
    n = 32
    product = 118,052,776,209,670,344
    % java FFTIntegerMultiplication
    i/p integers :
    A = 2,147,483,647
    B = 2,147,483,647
    n = 32
    product = 4,611,686,014,132,420,609

  • @haardshah1676
    @haardshah1676 Před 4 lety

    1:07:35 if the complex conjugate is just minus the power in the exponential, why did he write exp(-ijkT/n/n)? why the divide by n divide by n (again)? is it a mistake?

    • @willlenk862
      @willlenk862 Před 2 lety

      Because he's trying to invert the V-matrix which requires a complex conjugate operation and then a divide by n. Note he later corrected the division by n (because the magnitude of the xk values must be 1), and deferred it to after the matrix multiplication

  • @hektor6766
    @hektor6766 Před 5 lety +3

    I was just thinking earlier today about root 2/2 being the sine and cosine of 45 degrees, e^(2)i pi (e^i tau) and how they related to the unit square and circle. Fourier, Gauss, Dirichlet all stood on Euler's shoulders.

    • @englishmotherfucker1058
      @englishmotherfucker1058 Před 3 lety

      it always comes back to euler like it's rome
      all roads, somewhere, somehow, all lead to euler

  • @saltcheese
    @saltcheese Před 5 lety +1

    if there is a god, MIT is doing her work

  • @phillipabramson9610
    @phillipabramson9610 Před rokem

    So what is the math doing in practical terms? If I understand correctly, it's using the behavior of a signal over time to determine specific properties of that signal at specific moments. Is that correct?

    • @chrism7574
      @chrism7574 Před rokem

      The FFT has a lot of applications. What it's most usually associated with is frequency decomposition. The FFT is just a computationally faster way to calculate the discrete Fourier transform of a periodic signal, which extracts the frequency components of a signal. This is used for basically everything that deals with periodic signals.
      More generally, the FFT can be expanded to include different roots of unity, like finite fields or integer integer rings, and that is used for cryptography and other various topics.
      As far as practicality, this algorithm is a major step forward in the advancement of our species. It touches nearly everything in our current world.

  • @64standardtrickyness
    @64standardtrickyness Před 4 lety

    Does anyone have intuition as to why Fourier transforms pop up here?

  • @noguide
    @noguide Před 5 lety +7

    LOL 53:04 ^ 57:15 ^ 1:17:08

  • @BigBHole69
    @BigBHole69 Před 4 lety +1

    My only gripe is that an 80 minute video labeled Divide & Conquer FFT spends only 20 minutes discussing the FFT algorithm. Otherwise good.

  • @not_melkor
    @not_melkor Před 2 lety

    This is what reaching GOD Level feels like in teaching?

  • @off4on
    @off4on Před 3 lety +2

    I think he meant V\Y not V\A at around 29:00...

  • @93nites
    @93nites Před 6 lety

    Taylor's polynomial seems to be O(n) eval,addn and multiplication

  • @MrAwesomeaditya
    @MrAwesomeaditya Před 4 lety +3

    is it just me or does he look like post malone had a studious brother

  • @erans0496
    @erans0496 Před 2 lety

    Erik: " I didn't go to high school, but I assume in high school algebra you learn this...."
    Me: Drop from CS and cry...

  • @qiguosun129
    @qiguosun129 Před 2 lety

    Pro Erik is fabulous

  • @AmanGarg95
    @AmanGarg95 Před 7 lety +8

    Did he just throw a Frisbee at 4:54 ? I cracked up xD

    • @orbik_fin
      @orbik_fin Před 7 lety +4

      I guess the idea is to somehow encourage participation. I'd like to know if there's a more in-depth study about this - does it enhance or take away concentration from the actual subject? (Or choice C - neither, it's just a bit of fun)

    • @GMPGIRI
      @GMPGIRI Před 6 lety

      let me know if u ever found an answer to it @orbik.

    • @TheKivifreak
      @TheKivifreak Před 6 lety

      sounds a little like dog training where you throw a frisbee as a reward for the dog.

    • @ashishjog
      @ashishjog Před 6 lety +3

      czcams.com/video/HtSuA80QTyo/video.html Here you go watch at 26:27 in that video, Instructor: Srini Devadas, mentions about it!

  • @ilyboc
    @ilyboc Před 3 lety

    55:13 This should be squared no?

  • @aayushbajaj2260
    @aayushbajaj2260 Před 11 měsíci

    holy crap, the tau thing

  • @rosenzhang1704
    @rosenzhang1704 Před 5 lety +2

    why we must take the nth root of unity, cant we take like -1, 1, -2, 2 ....as X? This will also collapse?

    • @elliotwaite
      @elliotwaite Před 5 lety +5

      Squaring those numbers will give you 1, 1, 4, 4, giving you the set {1, 4} (a collapse of 4 numbers to 2), but if you square those again you get {1, 16}, which doesn't collapse the set any further. You need the collapsed set to collapse again when you square each value a second time, and then collapse again when you square the numbers a third time, and so on, hence the complex numbers. You could use the nth roots of any number, but using the nth roots of 1 is simpler and lends the alternative representation to represent amplitude and phase information in frequency space. If you used the nth roots of another number I don’t think the alternative representation could be interpreted the same way.

    • @haardshah1676
      @haardshah1676 Před 4 lety

      ​@@elliotwaite 1:07:35 if the complex conjugate is just minus the power in the exponential, why did he write exp(-ijkT/n/n)? why the divide by n divide by n (again)? is it a mistake?
      (also sorry I asked as subcomment; I thought it'd get lost in the clutter otherwise)

    • @elliotwaite
      @elliotwaite Před 4 lety

      @@haardshah1676 it looks like the second division by n was a mistake. He realizes this soon after writing it and erases it. Does that answer your question?

  • @wtw5002
    @wtw5002 Před 3 lety +3

    "Screw Pi" - omg i nearly died. That was hilarious. I deeply regret my decision to avoid STEM classes in high school and college. That was a terrible mistake.

    • @ka1wht
      @ka1wht Před 2 lety

      It’s not too late to learn. Think of the ones you regret not taking and either purchase a book or take a class. One of the greatest things about our minds is that they are malleable.

  • @kokomanation
    @kokomanation Před 3 lety

    FFT sounds like fast Fourier transformation I don’t know what it is though

  • @pepehimovic3135
    @pepehimovic3135 Před 7 měsíci

    Let me guess, it involves powers of 2?

  • @Harish-ou4dy
    @Harish-ou4dy Před 12 dny

    whats the deal with those frizbees?

  • @ezzoalgaddafy5934
    @ezzoalgaddafy5934 Před rokem

    Is it too complex or just a first impression?

  • @rodacoram
    @rodacoram Před rokem

    Is divide and conquer a genetic algorithm?

  • @thinhnguyenvan7003
    @thinhnguyenvan7003 Před 2 lety

    53:07 "I believe in Tau so much, I got it tattooed on my arm..."
    wow,lollllllllllll

  • @5daydreams
    @5daydreams Před 2 měsíci

    is there a followup to this lecture?

    • @mitocw
      @mitocw  Před 2 měsíci

      Here's the recitation that followed the lecture. Linking to it from the playlist: czcams.com/video/TOb1tuEZ2X4/video.html&pp=iAQB. We hope this is what you are looking for.

  • @xinli6243
    @xinli6243 Před 5 lety +1

    Can someone explain why at 40:16 the last item is O(n + |x|)? Where does this n come from? I think it should be O(|X|) because once we get Aeven(x) and Aodd(x) for any x in X, it just constant time to compute Aeven(x) + x*Aodd(x) for each x. Now we have |X| points to computer, so it takes |X| time to get A(x) for x in X. Correct me if I am wrong

    • @kyawshinthant4237
      @kyawshinthant4237 Před 2 lety +1

      This is a very late comment but I'm posting so that other people can see. I think that n comes from creating the two coefficient vectors for the two polynomials A_even and A_odd by linearly scanning the coefficient vector of the polynomial A.

  • @user-oc2ld9cv3y
    @user-oc2ld9cv3y Před 5 lety

    9:54 can anybody why it is O(n^2) ?

    • @user-oc2ld9cv3y
      @user-oc2ld9cv3y Před 5 lety +1

      nvm, i was dumb. it was n term times n terms so it should be n^2

  • @bryanlozano8905
    @bryanlozano8905 Před rokem

    Dude, why are you erasing the chalkboard before I finish taking notes?

  • @dianamartinez6071
    @dianamartinez6071 Před 4 lety

    In what minute did you get lost?

    • @englishmotherfucker1058
      @englishmotherfucker1058 Před 3 lety

      last lecture, actually
      just wandering around from there
      well I actually got lost in 6.006

  • @distrologic2925
    @distrologic2925 Před 3 lety

    TAU IS A WHOLE CIRCLE

  • @jimaaman
    @jimaaman Před 2 lety +1

    Did I come here planning to learn about the nth roots of unity and how polynomial representations can be exploited to improve the scaling of computational complexity... No
    Did I just spend an hour watching this guy because it is freaking interesting and incredibly well presented? You bet I did 😅

  • @HeisenbergHK
    @HeisenbergHK Před 11 měsíci

    How can i find the full playlist?

    • @mitocw
      @mitocw  Před 11 měsíci +1

      Every MIT OpenCourseWare course on CZcams has a playlist. They are named by the course. In this case, the playlist is "MIT 6.046J Design and Analysis of Algorithms, Spring 2015" czcams.com/play/PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp.html. Every video we publish has the course name and number in the video description. Best wishes on your studies!

  • @64standardtrickyness
    @64standardtrickyness Před 4 lety

    OMG why is this not the standard way of introducing FFT

  • @nitishsandhu4462
    @nitishsandhu4462 Před 7 lety

    I think there is one mistake at 15:36, when he wrote down samples to represent a polynomial of degree n. He took n samples to represent a polynomial of degree n uniquely. But this is untrue, to represent a polynomial of degree n, we need at least n+1 sample points, for all different x points.

    • @Davissb1aine
      @Davissb1aine Před 7 lety +12

      The polynomial is of degree n-1: (1 + x + ... + x^(n-1)). Therefore, you need n sample points to uniquely represent this polynomial.