Fourier Series: Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome back so we're talking about the Fourier series now in our lecture series on the Fourier transform and wavelets which is from chapter 2 of our book data-driven science and engineering so I'm going to talk about the Fourier series which is a way of approximating arbitrary functions f of X as a sum an infinite sum of sines and cosines of increasingly high frequency okay so this is my function f of X let's say that it's currently defined from negative PI to PI so I'm going to define something that's two pi periodic these two pi periodic sine and cosine waves and I'm going to write down the Fourier series and kind of derive how how you can approximate f of X using these sines and cosines ok so I'm just going to write it down and then we're going to talk about it so we can represent our function f of X as a sum from k equals 1 to infinity of cosines and sines of increasingly high frequency so I'm going to write this as a sub K cosine of KX plus B sub K sine KX where a and B are coefficients these are called my Fourier coefficients and then this index started K equals 1 to infinity and so these are my sines and cosines of period one period to period three and so on and so forth and I'm also going to add kind of the zeroth frequency if I had K equals zero I would get a constant cosine term here and so I would having a zero and I'm gonna scale this by two for reasons you'll see later okay so I have some constant term plus a sum of cosines and sines of increasingly high frequency so as K goes from 1 to 2 all the way up to infinity these cosines become higher and higher frequency these sines become higher and higher frequency and these a K and B K coefficients tell me how much of each of these signs and coasts so I need to add up to recover my function f okay so the last ingredient here is how do I actually compute these coefficients a and B and before I start I want to I want to point out these cosine and sine waves are two pi periodic I've specifically made them so that this is if I plugged in 2 pi for X and if K was an integer I would get you know 2 pi periodic functions in X okay good so now what we're gonna do is is walk through how you actually compute these coefficients a and B so my K coefficients are going to be given by 1 over pi times the integral from minus PI to PI my function f of X of f of X times my cosine KX DX ok and so you'll see already that this looks a lot like an inner product between f of X and cosine KX and that's exactly what this this is just an inner product of f of X with that caithe cosine wave ok and similarly I'm going to write my B sub K is equal to 1 over pi times the integral from negative PI to PI of f of X with multiplied with my sine of KX DX ok good so what we have here are now an expansion of F we can approximate f by a sum of cosines and sines of higher and higher frequency with coefficients that are determined by the inner product the the Hilbert space inner product of my function f with that particular cosine so the caithe coefficient is my inner product of F with the case cosine wave and similarly for BK's and sine case okay and I'll write this out explicitly here this is maybe I'll write it right here this is the inner product of f of X with my case cosine function cosine KX normalized by the magnitude of this cosine function okay so this is normalized by 1 over the norm of cosine KX squared ok so that that's a really important thing to do is when I project f into this cosine K direction I'm talking in vector vector speak now I need to normalize by the length of this function and that the norm of this function is given by 1 over norm of cosine KX squared you could compute this by taking the inner product of cosine KX with itself and squaring it ok or sorry that just the inner product of cosine KX with itself that is the norm squared good and similarly for the the BK this can be written as 1 over sine KX norm squared times the inner product of f of X sine KX ok good so what we've done here is we have written these coefficients a and B in terms of inner products with my function f and that particular frequency cosine and sine wave and again we're normalizing by the length by the length of those functions the norms of those functions squared which happened to be 1 over PI in this case okay good so there's kind of a geometric picture that goes along with this that I think I want to show you because I think this is super important to build your intuition for what we're doing here so what we have in our F expression is some come of a k's times cosine KX is plus b ches times sine of K X's okay and I told you that these coefficients a K and B K are just my function projected on to that particular cosine and sine wave okay and so what I want to draw here now this is how I think about these Fourier see so let's say I have two sets of two orthogonal basis for a 2-dimensional vector space so let's say I have this little X unit direction and my little Y unit direction here and let's say I have a completely different orthogonal basis given by U and V ok and if I have some test vector F in this vector space let's say I have some test vector F I can represent F in either my XY coordinate system or my UV coordinate system okay and the way I would do that is quite simple if I want to represent F in my XY coordinate systems I take the projection of F in the X direction that's literally given by the inner product of F with X so I'm going to write this out we have F and I'm going to write it in blue ok so f hat is equal to the inner product of F with my little X unit direction in the unit direction of X plus I do the same thing i project F in the Y direction ok plus the projection of F in my y coordinate Direction times my little Y unit vector now if this was not a unit vector X and this was not a unit vector Y I would have to divide by the norm of x squared and I'd have to divide by the norm of Y squared ok now I can do the exact same thing in U and V coordinates I could equally well approximate this function I could say that this is also equal to F projected into the U Direction that's the inner product of F with you it tells me how much of F points in the U Direction plus the inner product of F with V in the V Direction ok this is U bar divided by norm of U squared plus the inner product of F with the in the V Direction norm of V squared okay so what am I doing this for I'm trying to convince you that the Fourier series definition here is exactly the same as how we write a vector F in an orthogonal basis in r2 in a two dimensional vector space I pick some basis let's say x and y and what I do the first thing I do is I take the inner product of F in the X direction then I take the inner product of F in the Y direction and I take those coefficients let's call these kind of a 1 and a 2 I take those coefficients and I multiply them by the X unit vector and the Y unit vector and I add them up that's exactly what we're doing in our Fourier series here okay so let's walk through this one last time we have our function f and we're gonna say that it is a sum of coefficients that are just the projection of F in that function direction in this basis Direction times that basis vector so this is kind of the meaning of the Fourier series is that my sines and cosines are orthogonal functions just like x and y are orthogonal vectors and I can take my function f and I can project I can figure out how much of f is in this cosine direction that's my a case coefficient and I multiply that by that cosine function and I add all of those up okay so I want you to think about this this takes a little while to sink in but the Fourier series is literally just how to write F in an orthogonal basis of sines and cosines exactly how we're used to writing or vectors in orthogonal basis okay now the last thing I want to point out is that this is particularly useful for approximation this is an equality this is an exact equality I can represent this function f through this infinite sum but in practice I might only want to keep some of these elements I might only sum from k equals 1 to 10 I might only keep the first ten sines and cosines in this case I only took the first three and I would hope that I get a pretty good approximation to my function and that's actually why the Fourier series is so useful is because if I truncate this Fourier series if I say approximately equal and I get rid of my infinity and I just say ten then I get a pretty good function approximation through a truncated Fourier series okay and that's something we're going to talk about we're going to work out some examples in MATLAB and Python to show how you would approximate functions using Fourier series okay so key concepts you can represent these functions f in terms of a sum of sines and cosines of increasing frequency the coefficients a K and B K can be computed easily numerically using these integrals and there's a very clean interpretation of what these coefficients are these coefficients are literally how much inner product F has in that cosine direction and how much inner product F has in that sine direction which essentially means that we're figuring out how much F is pointing in each of these orthogonal function directions okay so we'll talk about this more next time and we will code this up also alright thank you
Info
Channel: Steve Brunton
Views: 87,301
Rating: undefined out of 5
Keywords: Fourier transform, Fourier Series, FFT, Fourier analysis, Wavelets, Machine Learning, Data science, Linear algebra, Applied mathematics, Compression, Python, Matlab
Id: MB6XGQWLV04
Channel Id: undefined
Length: 12min 15sec (735 seconds)
Published: Sun Mar 08 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.