 Hello, my name is Simon Benjamin and this is the fourth of my lectures on Fourier series including Fourier transforms and partial differential equations. Now in this lecture, which I've been really looking forward to it's Fourier transform time. We've had three lectures all about Fourier series, various aspects of them and in the last lecture we finished up by the complex form of the Fourier series and that was so that we could spend this whole lecture talking about Fourier transforms, which is an incredibly powerful and important area. So specifically what we're going to do is recap Fourier series just briefly and then we'll motivate the upgrade from Fourier series to Fourier transforms and then of course we'll do that upgrade and we'll do an example. We'll perform the Fourier transform for an interesting function. Then we'll spend a bit of time thinking about broader properties and uses of the Fourier transform including some mentions from maybe some areas of physics that you might find pretty interesting and then I want to go further still and do a almost an example of using the Fourier transform that you could really just put to use straight away if you wanted to in terms of processing audio recordings. All right, so that's going to be the lecture and as always the notes for this course are available to everyone as PDFs and you can find them at SimonB.info. That said, this lecture in the notes it's just the core of it so it's really about how to do the upgrade and working through an example and a lot of the rest of the stuff I'm going to say in terms of like getting the intuition and seeing some applications that's not in the notes that's only in the lecture unusually. All right, let's begin. So here on this screen, I've summarized Fourier series as we've come to know and love them in the last few lectures. So at the top here is the form of Fourier series that we spent the most time with which is where we express a function in a series as a series of building block functions added together and those building blocks are just signs and causes and they have an integer frequency compared to the the basic sign and cause. So we have sign of cause of x or of 2x or 3x or 4x and for each of those possibilities we have some coefficient which we write either an or bn and those coefficients we know how to figure out. That's what we did in the first lecture. We deduced that an and bn must be given by these integrals. So that was the Fourier series written in terms of signs and causes and then the end of the last lecture we went ahead and translated that into our complex form. We simply substituted the signs and causes for their complex exponential notation alternatives and then just tied it up the sum and the integral things into the new form. So that looks less intuitive, I know. At least to most people, I think it will. It is we have to admit a very compact expression. Clearly the stuff written in the green box is less stuff than the stuff written in the blue box. But it's the crucial thing to remember is it's the same thing. You can go from the green box to the blue box or from the blue box to the green box. They are equivalent statements. So I hope not too disturbing to have gone from the sign cause form into the complex form. But now what can we say about getting beyond a more profound change, for sure, which is to go beyond the Fourier series to the Fourier transform? I'd like to start by motivating that for you by having a little bit of an investigation of how some Fourier series change as we alter the period of the function and from that we'll whip over to Mathematica. Right, we're actually not over in Mathematica because I went over there, generated these diagrams and then I realized I wanted to be able to write on them so I've pasted an image into my drawing program. So what have we got here? We've got a grid of six graphs. Now on the top row here what we have is the actual Fourier series that we get with a truncated Fourier series. So this is our f of x and it's truncated. I've actually truncated it to I think maximum n equals 19 as the highest sign or cause index that I'll have there and we can see that over on the case of the square wave that has led to these still quite visible, quite prominent overshoots. This Gibbs phenomenon thing that we were talking about. That's fine. So that's the reconstructed periodic function itself. What I have on the middle row here is just so in this column here I'm showing the components that go together to make the function above. So if you take all these things and add them up and you take all the on the other side or those ones and add them up then what you end up with is the function above. Those are literally with the correct frequency and also the correct amplitude, waiting those are the components. Where you see that there's a straight line there like that one I've just put a dot on that reminds you that cause 2 of x or this is the sign on the square wave is made out of that sign terms as you may remember. So then sine 2 of x and sine 4 of x and sine 6 of x are all their amplitudes of rule 0. We don't use any of them when we build this basic square wave and similarly for the triangular wave which is made out of causes we again don't have any of those even frequencies. So that's fine. So I hope from the previous lectures this kind of makes sense. Those are the components that go in and then on the bottom I've just drawn or graphed out a series of points. The actual the connective lines like that one there are just mathematically joining up the points for us as a guide to the eye that there there really aren't lines there are just points it's a series of numbers and those numbers are of course just the weights. So these are the the bn coefficients of our sine terms and these are the an on the other side the an coefficients of our cos terms that go into those particular functions. So I'm showing you this as a warm-up exercise because you've seen this before not quite in this form but I wanted you to see that to understand the language I'm using the graphical language and now I want to show you something new. This is the same thing but for different functions a function that we haven't analyzed as part of these lectures but you could analyze it it's nothing too strange it's simply a triangular wave and then a region of zero before we repeat. So here the repeat point on this example over on the right is about there I actually can't even remember what I set the periodicity to be but it's sort of from there to there if you want to think of it that way and then a cycle repeats now importantly the width of the triangular tooth so to speak is just one in both these diagrams. So it looks narrower over here on the other side but that's just because it's plotted on a wider x-axis so that width is one and the height for its worth is also one. So what I'm saying is the triangular teeth are exactly the same in these two diagrams. What's different is the distance between them how far we go before we repeat so this distance here I'm trying to plot around more diagrams with lots of lines is less than this didn't say the one on the right is further so if we call this well the complete distance from the middle of one to the middle of the next we call that L1 for the one on the left call it L2 for the one on the right and so the only difference between these two functions is that L2 is more than L1 and you can see roughly by how much more sort of 50 percent more or something. So now what does that what consequences does that have so if we come down to the middle row of our diagram we can see that we need a broader range of frequencies by the look of it in order to build the object on the right so this where I'm drawing the arrow goes a bit further down and that's what we might expect I suppose because in our previous experience of playing with the sine and cos here again we saw that dramatically so the the square wave needed a lot more frequencies or okay there's an infinite sum in both cases but the frequencies the higher frequencies had more weight for the square wave because that is further from being a simple cos or sine the triangular of course is also not a cos or sine but it's closer and in the same sort of intuitive reasoning we might expect that the further apart we move these spikes the more complex they become or rather the further they are from being a simple oscillatory function like a sine or a cos so it needs more frequencies in order to build it that would be a very rough intuition now what I really want to draw your attention to is these curves at the bottom maybe I'll change color so we see here again just the individual weights the line that's drawing that's joining them up that I'm drawing your attention to is just Mathematica joining up a series of discrete points but when we do that when we join these points up we notice something which is that these two functions kind of look similar to each other except the one on the right is sort of more stretched out but they both have the property that they curve down to zero and then have a slight recovery a sort of ripple and in fact if we were to zoom in we'd see there's even I'll show you where with this arrow there's even another ever so slight increase again in the amplitude as we ask how much of each increasing frequency do we want now when a someone who's used to using maths for modeling things or a mathematician sees this kind of thing you're dealing with two related problems because the only difference between these I remind you is how far you have to get through the zero region before you're allowed to have another one of these triangular teeth so closely related problems and the graphs look or the graphs of the weights look similar to the eye now and what that makes you wonder as a mathematician someone using maths is are they actually the same are they the same function and just stretched or are they actually just a bit different even if we were to scale them to try and fit the two these two on top of each other would they lie perfectly on top of each other which would then be trying to tell us something then that shape must mean something because it somehow isn't changing as we change the problem or are they actually just slightly different curves and sort of just optical coincidence that they have some characteristics in common how would we answer that well we would scale them and put them on top of each other if we wanted to continue to look at it numerically that is with the help of a computer of course we can also go over to the maths which we'll do in a bit and and figure it out from that end but coming on the idea of scaling things how would we scale it what would be the right way well we could just I could literally go back to Mathematica and make it so that I can drag one on top of the other and and scale but that would be very hand wavy kind of you know trial and error approach should be able to do better than that and to do better than that what we need to do is think about what the x-axis in these two diagrams really is uh yes it's it's the number n that appears in a term of either um actually these are all causes by the way because the function at the top there I've already drawn on it so heavily let me draw one more time as you can see the basic object there is symmetric um on the y-axis and then it's just mirrored so this is just it's an even function so it's made out of causes but my question is what is that horizontal axis really yes it's the integer n but can we have a more intuitive picture of what it is let's go back to the expression for it and see so here I've gone back to our equations and I've put on in purple the thing I want to focus on which is that because I was plotting there functions that have some period period l that is not 2 pi in fact I was altering that period so impairing different values of the periodicity then I was using this substitution here which we met a lecture or two ago where we see that if we replace n with 2 pi over l times n then we can describe a function of any periodicity we like because when x moves through a this a change of l then um what cos c's is something that has moved through a change of 2 pi because of this 2 pi over l factor and so that is what we should really be plotting if we want to compare two different situations with different periodicities we should account for that what they have in common is that we can ask what is this this term which is by the way a frequency that is if you have cos of something times x that's something is a frequency it's a spatial frequency it tells you how far you have to go before you repeat the function or if we were looking at instead of x our variable x if we were using t because we were analyzing something that varies over time and building a Fourier series first then of course it would be a temporal frequency but either way it's a frequency it's a frequency times 2 pi that's okay an angular frequency but that is a clearly a physically meaningful thing and it allows us to then compare two different situations we can say well let's look at the frequencies that they contain so that's long story short what we want to do is rather than plotting our graphs they are against n we should plot them against n divided by l optionally multiplied by 2 pi that wouldn't make any difference because it will affect them both the same but crucially we scale by l let's see what happens when we do that okay there at the bottom i've pasted in the result of scaling by exactly a factor of 1 over l and then putting the two diagrams above on top of each other to be clear the orange points come from that side and the blue points let me change the blue come from that side they so the orange ones have been scaled by more of course because l2 is the is the larger of the two periods but the point is that now they seem to lie pretty much perfectly on top of each other it seems that our waiting for our Fourier series is described by some underlying function and that when we want to get the values for a particular period of particular value l we just need to sample at regular intervals and that interval is is you know described by 1 over l so it gets denser we need to sample more often if we are asking for a longer period so hence the orange dots are closer together but they still lie on the same function what does that mean in order to think about that we might say well what happens if we continue this progression we started from a certain separation between a certain periodicity and then we considered a larger one and what would happen if we kept going if we now tried a larger and a larger and a larger separation we could go and do that in mathematics it would take a while so i'll just tell you what would happen i'll put on some purple dots to show you if we went to a much larger separation we would get this sorry there was a pink that's all right pink dots and so we would see a very dense range of dots but again they would follow this same underlying function and they would keep going by the way the reason that there aren't more orange dots on here is because we stopped at n equals 19 when generating these things but of course that really they go on forever so whichever separation we chose we would end up plotting out the entire curve is a series of dots now here's my question what happens as we go to infinitely large separation so as l what are we not using purple down here as l goes to infinity what would we expect then well what we would expect if this example of just two cases is continued is that those points that are the the particular weights we need against frequency would come infinitely close together they would essentially form a continuous line but still lie on the function in other words that underlying curve would be completely created through a continuous series of points and what would a Fourier series be if the period were infinite well it's no longer periodic in that case we would have broken free of our rule that we can only model periodic functions or functions which you know are only defined in a finite range and then we make them periodic but that's still a kind of periodic function just an extra step but here if we make the distance between one cycle and next infinity that's that's a non-periodic function because it means we get to define the full you know range of our function it's how strange to say it but a periodic function with period infinity is is not periodic essentially we've broken free so it seems that somehow this curve this characteristic curve which comes down and has its ripples is telling us about something more than a Fourier series a Fourier series that's broken free of being periodic and that's what we now want to investigate before we can do that well we're going to do that using the complex Fourier series just because that's going to give us the notation that's the conventional one but this little analysis here both for the the reminder in terms of the square wave and triangular wave and these new triangular occasional tooth functions have all been done in times of sine and cos and so these plots made of dots are the a n and b n coefficients just the a n actually here because it's just the cos function that was needed what would it what would we see if we have repeated this analysis this little investigation and we had instead used the complex Fourier series well that's actually super easy to answer you already made a note of it but i'll write it here again if you want to get the c numbers which have either a positive or negative index n if you're if you could have written the Fourier series as a sum of cos terms which is the case here then it's just the a just make the magnitude of n divided by 2 so that's that's those are the complex coefficients that we would need and if we did a graph of those where we can see what what we're saying here is that instead of the function that we have at the bottom let me tidy it up because i've kind of drawn on it so much instead of just that we would have now have a function that's half the height because of the factor of 1 over 2 but has exactly the same shape in other respect so it was still have these little ripples but it will have half the height i somehow managed to draw it so badly that it looks like it has more try it's pretty difficult to draw so in that tiny space it has half the height and then crucially it's mirrored right because we can now have these negative values but they must just be the same the same value in each case so we had some value here and that would be the same over here so once again my drawing skills are not quite what i would wish them to be but i hope that you can get the idea though what i've tried to draw on here with the purple line the new purple line is something that has half the height of the previous function and is mirrored so it has the same you know the whatever you have on the horizontal axis our frequency if we allow that to go negative as we do for our complex series it's just the mirror image that's the thing that i would like to or i hope will come out of our analysis when we look at the complex Fourier series we ask what happens when the periodicity goes to infinity and then we actually plug in this specific example so let's do that now so what we're going to do is we're going to take the complex form of the Fourier series and just explore the idea of making the period of it become infinite so the first thing we'll need to do is to take what's written in the green box here and then write it in the form where we indeed we make the period explicit so it isn't locked to being 2pi but we know how to do that so let's just quickly write that out so there i've written it out in orange our generalized version what are we doing we're just sticking in our little factors here that allow us to go for a function that doesn't have a period 2pi note the limits of the integral are now over one complete cycle but written in terms of l and instead of one over 2pi in front we have one over l so let's clean that up those are the differences and it's that form that i want to now explore as l becomes larger and larger as the first step of our generalization i'm going to introduce a new function and its job is going to be to generate those c numbers for us whenever we want them so that we no longer have to write them in in the way we've been doing up till now but let me just write out what this new function is and then we look at it i'm going to use capital f for the new function because we're already using lowercase f for the original function and more than that to avoid confusion with x i'm going to use a different variable k so let me just write out what it is all right what does it look like it looks a lot like the line of immediately above that's generating our constant cn for us but it is a little different now what i want to know is what is cn written in terms of f what do i have to do to f to generate one of my cn terms well i can see that uh i'm going to need to divide by l because my capital f function doesn't have that well one over l in front so it's one over l times f what so now i need to think what value of k should i feed in in order to get um exactly stop using orange in order to get uh exactly this expression here well i can see that in fact uh it's just that uh business up inside the exponential that is the difference between the functions that's where k appears so k will need to be two pi n over l and then they will match up so let's put that in f of two pi n over l so with that uh relationship my new function f will generate any cn that i want so i can use it instead fine so let me rewrite that i don't want to take too many steps at once so i'll rewrite uh my complex Fourier series using this new function we could think of it as a weighting function because it the job it's doing is to generate these weights for us whenever we want one uh so let's write that out so there we are tidying things up uh that's just the complex Fourier series the only difference is we're writing in our function capital f that uh for we're going to think of as the weighting function it will generate for us those constants c subscript n um when we feed in the appropriate frequency but it's that's just a rewriting of things we've done nothing substantial yet but now it's time to think about what happens as the quantity l becomes larger and larger and the big well actually first let's think about what happens to our weighting function because that's going to be easy in the um let's write as l tends to infinity okay but if that's a bit of an awkward idea just think of it becoming as large as you like arbitrary large very large then we can write that our f k function the one that gives us back the weights we need well it goes from l over to minus l over two to l over two but that's just going to be going from minus infinity to infinity right so that one is easy minus i k x the rest of it there's no change um so it it still just looks over one complete cycle if you like it's just that that cycle is now the entire possible range of x so that's very easy but of course the interesting part is to have a look at this sum over an infinite number of terms and do some work on that for the case that l is becoming larger and larger the first thing is i want to rewrite the sum just to emphasize that a different way of thinking about summing over the integers is that we are summing over the allowed values of the frequency so i'll use the symbol k for that and i'll say that we're summing over the allowed k is equal to two pi over l times n and we understand that n is in any possible integer so that's that doesn't change anything it's just emphasized that to sum over the allowed in all integers is to sum over the allowed values of k defined like that same thing but uh that means that we can just write things a bit more compactly like this that's quite nice now the final thing i want to notice is how does k change as we go from one allowed value of k to the next what's the increment well as as we go from n goes to n plus one that is the next allowed term then k goes to uh two pi over l times n plus one which is just uh the original value of k plus two pi over l so k goes up by two pi over l when we um when we hop from one allowed k to the next that deserves its own symbol because the increment in the quantity is clearly important and let's call that delta k it is a small quantity because l is we now understand tending to be infinite large it's arbitrarily large quantity whereas two pi is just a constant so this is a small quantity and i noticed that i've already got a one over l in my expression here so that invites me to now write down the f of x expression in about the um the closest form to an integral that we can possibly get while still writing down a sum and then we're going to take that final step so um i noted that one over l let me give myself uh an extra factor of two pi so that where i had one over l i can now write two pi over l and then replace that with delta k so what will we get we'll still have our oops we'll still we'll still have our sum term over allowed k of uh f of k the weighting function capital f of k e to the i k x delta k well there we are that is really suggestive of an integral isn't it we've got some quantity that that depends on a thing that we are sweeping over a range in other words the k quantity the frequency quantity we're multiplying it by a small amount a small interval in that k so i don't think uh you'll be at all surprised if we now say well it's a very small step of the imagination to suggest that what we should have in the limit of uh l becoming infinite is we have an integral now over the k quantity e to the i k x and now we write d excuse me dk um and now what is the range of that integral it's all the allowed k what are the allowed k they are from minus infinity to infinity um that's all the possible frequencies full frequency the full frequency range so there we are that is now our Fourier series evolved into an integral form let's summarize what we've got it's two very compact expressions actually so i will rewrite them and there we are so that that is what we've figured out should be the evolved form of the Fourier series we've got ourselves this thing we've called the waiting function you feed the waiting function any frequency and it tells you what the amount so to speak of that frequency is that's needed in the combination but the combination now is no longer a sum but it's become a smooth integral because we're allowing all possible frequencies and if we look at how this waiting function is defined it's defined um in a way that looks very similar to the the two expressions look very similar to each other and this thing we've been calling the waiting function is in fact the Fourier transform so so one more time the Fourier transform is really just a waiting function that tells us how much of each possible frequency we need to build the original function we're thinking of yes it's a quite an elegant expression we can see that the way we've written it the only real difference is between the two lines is that one of them has a one over two pi out in front and where one of them is e to the plus ix the other is e to the minus excuse me plus kx the other one is e to the minus kx but of course they are integrating over different things the first expression which is our new uh our way to break up the um original function this is sweeping over the allowed frequencies which is all frequencies um and the second entity the waiting function the Fourier transform is obtained by sweeping over the x parameter so inspecting the full width of the original function so a very nice complementary set of two expressions there i should just quickly say that there are other ways other conventions that are a little bit different i'll write them out just so that you've seen them so that one in lime green is exactly the same expression it's just using different symbols but of course these are just dummy symbols in the sense that they appear on both sides you could use a smiley face if you like that symbol but the reason uh to highlight it is because when we are working with a Fourier an original function which is something changing in time except instead of something changing over a range of space then it's conventional of course to use t as the index for time and to use omega as the frequency which is now a temporal frequency instead of a spatial frequency it's actually the angular frequency if you want to get technical because it's got that two pi in it so that one is a trivial reexpression those are clearly the the the expressions in purple in the purple box and those in the line box are obviously the same because they have exactly the same structure they're just using different symbols but they are the conventional choices for a spatial analysis and a temporal analysis and then something i've just got enough room probably to write it in the top corner let me write it for you there we are i've waged it up into the top corner it's perhaps slightly more the mathematicians way to write the Fourier transform a couple of things to note that we're writing the Fourier transform instead of a capital f as an f with a hat on it that's the Fourier transform function and although it's again just a dummy variable so you could use anything you want often in this representation this squiggly e that i'm not to be honest with you very good at writing out which is the Greek letter psi it's even quite hard for me to say but anyway this messy squiggle symbol is um is the one that represents the frequency but the important point is that we've pulled out a 2 pi inside the definition here and the consequence of that is that we no longer have the 1 over 2 pi now with all that said let's go back to our mathematical mystery and ask what was that thing that we seem to be converging to in our numerical experiments can we now obtain that curve and what will it be so what that means is we need to now do a Fourier transform for the case we were looking at which was if you recall a let's draw it here this was the function we were playing with right except in the examples in Mathematica it did recur with some periodicity but now we are interested in the case where that l that overall period goes to infinity so we're only going to get one of our triangular wave teeth it goes from minus a half to plus a half and it's simply a straight line up to its peak at one and back down again that is what we now need to analyze so what we want to do is we let's choose the appropriate one I would guess we're going to use this definition so this is going to be our Fourier transform we want this for this particular case now how could we write out what f of x is equal to well um f of x here we could say that the definition of it we want is that it is going to be well we're going to want some kind of trick like one minus the absolute value of x except we know it should go to zero at x is equal to a half so what we want is one minus two times the absolute value of x and that is understood to be let's move it to make a bit more space that is when the absolute value of x is less than a half or if you want less than or equal to a half and it's equal to zero otherwise now that makes our Fourier integral that we need to do to compute our Fourier transform a bit nicer in the sense that we were integrating from minus infinity to infinity over x but this function is zero except in that finite range so immediately we can say well all right that's just going to be the integral from minus a half to a half of what well of one minus two absolute value of x and then e to the minus i k where k is going to be a constant for the purposes of this integral and now we have to figure out how to do that we might ask is this an odd or an even function because i like odd and even functions well a nice thing to do at this stage there's a few ways we could go forward but let's uh let's say we don't really like complex numbers so let's turn this into causes and signs and and carry on that way that's easy enough so we no longer need our diagram for the time being so that's just breaking up my complex exponential oh and i uh should have a uh no that's correct um there's a minus sign though which inside the cause makes no difference so if i put in a minus there i could immediately remove it because cause of minus something is equal to just cause of the positive version but for sign uh the minus sign comes out through the sign function and so what we'll end up doing is changing this plus to a minus has that helped well yeah because now i don't have to think about complex numbers anymore and i can just look at these and see whether we've got odd or even functions now this first term this one here first integral is an odd function excuse me is an even function multiplied by another even function good uh that tells me that i can rewrite it as just the integral um from nought to the positive value of twice i just double the integral and that means since it's now x can only be positive or zero i can drop that absolute sign off of it which makes it a much more standard integral now how about what's going on over here with the sign it's even better news right because now this is an even function multiplied by an odd function even function multiplied by an odd function that's an odd function when we integrate an odd function between symmetric limits either side of the origin it's zero so no more thinking required there that term can just go away great so we're off to a flying start because we've reduced our Fourier transform problem to just working out a pretty straightforward integral it's um going to well let's just finish it off the first one is just the integral of cause of some constant so no worries there it's going to give us two times well we'll need to make that cause well integrate to sign the positive sign uh in front so a little problem divided by k remember k is just a constant for the purposes of these integrals and then we have a little bit of more work to do we've done this kind of thing before though and this is going to be an integration by part so i won't labor the story i'll just write it down all right so we're ready to basically finish this up we're going to have our first expression here now sine of zero is zero so only the upper limit here will potentially come to something non-zero so that will give us sign of uh half x x over two divided by k because we subtract off a zero what's going on in the next uh stop the limits there what's going on in our next expression well we're going to have again the zero to the part will vanish now doubly so because it's sine of zero and x is multiplying in there as well so only the value at a half is meaningful so a similar expression of sine uh k over two actually um over two k but that is going to cancel with the first term if i'm not mistaken so then it's all down to the remaining term let's uh multiply the let's get rid of those curly brackets and so we're going to need to put that factor of four in and the minus become two minuses become a plus so four over k and now we have this final integral to do sine becomes cos minus cos actually let's not forget that sine again divided by k and again at zero and a half so as i was saying these first two terms actually cancel with each other um that's convenient so all we're left with then is four over k well cos of uh zero is just uh one so that's going to be uh let's so let's take the k out in front so that's k squared so we're going to get cos of x over two sorry x is a half so cos of k over two minus one but the whole thing has a minus sign so in fact i regret not having so we're tidying it up and what we're saying is that our Fourier transform f of k which is the weighting function where we feed in any spatial frequency we care about and it tells us how much of that we should have is going to be simply uh one minus cos of the frequency divided by two the whole thing divided by the frequency squared i notice that that is oh and i'm sorry uh there should be a factor of four let's take it out in front because it would look nicer that way maybe over here would have been actually nicer in hindsight to have defined my triangular tooth from plus minus one to plus one and then we wouldn't have had these halves going through but there we are that's what i did so it's not caused too much trouble but there's our uh our answer all right let's find out if i've made a slip in the derivation or if we've discovered the answer to our puzzle what we're claiming is that that oscillatory dampening down function that we were numeric we were seeing coming out of the numerics is the uh the weighting function the Fourier transform that we've just derived so let's see if it is if it matches or not so there we are that's that's um four multiplied by one minus cos k over two divided by k squared and now we want to plot that so uh we're saying let's plot our new function f of k defined as above from k let's do minus five to five see whoops minus five to five see what we get that's a limited range of frequencies of course the function is defined from minus infinity to infinity but let's just see what that shapes up to be all right that um let me just rescale that for you that uh it's hard to tell because what we want is a function that damps down and oscillates and i simply haven't given it enough range to do that by the look of it so we'll need to beef it up a bit let's go from minus 15 to 15 so that looks like that's encouraging right it's it's got that dip and recovery let's uh stop mucking around and go to a really wide range here let's go from minus 40 to 40 see what the thing really looks like and there it is that certainly looks just like the function that we were sampling points along in our initial numerical investigation and uh spoilers i can reveal that it is so having obtained and checked that expression let's just review now and make sure that we completely understand what we've done we had this a little bit of a mystery as to why it is that when we considered Fourier series with different periodicity the weights all were on us on the same underlying curve and that underlying curve was what we got when we made the x-axis in our diagrams not the integer n but instead the frequency why was it that they all lined up on the same curve and that curve has turned out to be the Fourier transform we can look back now at the key moment in our derivation uh that answers that question so here in the pink box is the last time that we wrote down a Fourier series before changing to a Fourier transform we'd written uh we'd introduced a weighting function instead of the c coefficients and the weighting function is something where you fed in a particular frequency and it told you what the weight going along with that frequency should be but that of course is exactly what that scaled set of curves was it's when we made the x-axis the frequency so this f of k object is that curve and the only question is why didn't that curve change when we altered the periodicity in other words why doesn't this integral change when we alter the value of l which is our complete cycle the answer is we were altering it by introducing more zero the interesting part the non-zero part was that triangular tooth that stayed with a fixed width and so of course this integral stayed the same regardless of how much zero we put either side of that fixed tooth and even all the way out to the infinite limits which of course is our Fourier transform so that's why that worked okay new topic uh the new topic is a second example that we will just use mathematics here to show us the second example so that we don't have to work through it it's actually a similar level of difficulty to derive the Fourier transform i.e. not too bad at all and it's an exercise in the questions that go along with this course to actually do that so that's one of the reasons i'm not showing the actual expression but what are we looking at well our input function here is simply a function that is equal to one the constant one near the origin specifically between x is minus one and one and then it drops to zero and then it's at zero everywhere else fine so there's a second Fourier transform very nice what can we learn from it well what i'd like to do is to ask you this if i tighten up the original function so that now it only goes between plus and minus a half so i'm squishing the range of that input function by a factor of two what do you expect will happen to the Fourier transform of it will it change its shape dramatically or will it simply stretch a bit well you might have said well it won't change dramatically because after all what we're putting in is basically the same thing it's a flat function that then drops down and is zero everywhere else all we're changing is the width of that so we might expect that our Fourier transform will keep the same character but it will also change it will either stretch or shrink which will it do will it stretch or will it shrink if we narrow the input what happens to the outputs the Fourier transform well let's find out so we need to keep an eye on the bottom function here so we see how it changes and it's wider okay so it is the same function but it has twice the width and just to confirm that that's the right trend if we go in the other direction and make our input function uh let's say 1.5 so we make our input function wider than our initial choice we should see then that the Fourier transform becomes very narrow let's see yes so that's the that's the relationship the wider the input function the narrower the Fourier transform okay so i don't know if you guessed that or not um it's a reasonable thing that you you might have guessed it let me go back to the one that's uh that's the wide Fourier transform uh it's a reasonable thing that you might have guessed because the more sharply defined the input the higher the frequencies that we would need to capture that narrow object you might say that might be the intuition but why am i showing this you this in particular because this is a very nice there's a very nice meaning to this that we can immediately assign and it comes through quantum physics in fact of the famous things about quantum physics you know like Schrodinger's cat and all this kind of thing there's one phrase you might already be thinking of when i tell you that um as one thing becomes more narrowly defined another thing becomes broader you might that might give you a hint so let me let me tell you what we could how we could interpret this mathematics this would be the correct way to describe the situation if we had a quantum particle like an electron that was confined in a region so imagine an electron is confined to be between here and here it's not allowed to be out here but it can be anywhere within this region in fact we might imagine we just made a measurement to confirm that we don't know anything about this electron except that it's not in the regions in the forbidden region our measuring device might be such that it checks the electron is in the confined region but in such a way that it leaves it equally likely to be anywhere within that region well then this function that we've drawn here this top hat function if you want to call it that describes the probability of where the electron is and in fact it would describe the wave function of the electron now what is the Fourier transform of the wave function of an electron written out as a sort of distribution of a space that actually gives us the momentum distribution of the electron the way to say it is if we looked for exactly where the electron is we would have to find it somewhere in this constrained region and it would be equally likely to find it anywhere but the more constrained the region is we ask the same question about the momentum if we measured the momentum of the electron said okay what is your momentum there would be a broader and broader range that we could get and actually that momentum would just be the square of our Fourier transform here so let's the probability of it so that that function now is showing us the the values for momentum that we might measure if we got in there and measured that electron so that's enough waffle but this is nothing less than the famous uncertainty principle and this is the correct mathematics the Fourier transform is the correct piece of equipment to transform between understanding something about how a quantum particle is spread out in space and understanding how a quantum particle's momentum is also spread out over a range of possibilities squeeze one you must broaden the other there's no way around it uncertainty principle all right so we've got five minutes left and I just like to show you something something fun something that shows you that the Fourier transform as we've as we have it now doesn't need to be enhanced any further it's already a powerful tool it's fully equipped to do impressive things immediately so I want you to witness the full power witness the firepower of this fully armed and operational Fourier transform all right so what we're going to do is we're going to record some audio but we're going to use audio software that would be too easy we're going to use math software it turns out that Mathematica can record sound for us and so let's do that but we'll also make it kind of challenging by adding in a horrible sound that we don't want and seeing if we can sort that using the Fourier transform all right so here are some instructions to Mathematica don't worry about how they work but it basically says to Mathematica I want you to record something it's ready now to record but to make it challenging I'm going to introduce a horrible noise from a tone generator and then do my little audio recording so trigger warning if you hate horrible tones as I do you might want to make sure you turn down your headphones or whatever horrible horrible sounds fully armed and operational battle station phew that was a horrible sound but now let's do the Fourier transform of it in Mathematica Mathematica has recorded the signal strength from the mic which is essentially just recording the pressure variation at the surface of the microphone now by doing the Fourier transform of that as always we'll be asking what are the different frequency components that make up that pressure signal and so let's find out there we are now the dense region of blue that you see down in the lower left that is my voice all the different frequencies in my voice during that sample the spike that you see the very high spike there I strongly suspect is that horrible sound that we heard there's another spike actually it's exactly a double that frequency and that will be a harmonic of the of the of the basic one but it's not as strong and then we see the whole thing mirrored at what we would take to be very high frequencies that is an artifact I won't explain that in detail but it's expected it's an artifact of the fact that Mathematica doesn't really have a continuous function for the pressure variation the mic actually just samples the pressure strength at a very high rate something like a 44 000 times a second and feeds those stream of individual numbers so then Mathematica has actually done something called a discrete Fourier transform that we won't talk about in detail it's just related to the work we have been doing and an artifact of that is that very high frequencies appear very similar to very low frequencies when the high frequency almost matches the sampling rate it's it's it's quite interesting but we won't talk about it now because I just want to get down to business so the challenge of course is that we will edit this Fourier transform manually change it and then go back to the sound and see what it does so I want to destroy these two very narrow very tall peaks which I suspect are the horrible sound let's do it there we are and you see I've completely removed those two gigantic lines and in fact we're now looking at a more zoomed in you can see my voice more clearly because it's no longer dominated by those two frequencies now test is what will it sound like I don't know but hopefully it will sound a bit better this is very very crude so it's not going to sound amazing let's see we can get Mathematica to go back from the Fourier transform to the original sound in fact if you in fact if you think about those expressions that we derived for the Fourier transform they're so similar that you can see that if you just apply the same process a second time you'll get back to the original function so that's what we're going to do both with the untouched version of the audio file and the hacked one where we've altered it in the Fourier transform space and then gone back so let's listen to them here's the first one the original recording I sound like that maybe okay have we improved it let's do it I'll do it one more time and then I'll play the hopefully improved one my suspicion and I haven't listened to this yet is that it will we'll still be able to hear a bit of that horrible tone actually at a higher frequency because I think it will be a harmonic that has escaped my very crude hack let's see if that's true so here's the original again and I'll immediately play the adjusted one fully armed and operational battle station fully armed and operational battle station well I think that's a success yes the sound is still there a bit but we've massively reduced how loud it is and as I suspected it's a higher frequency I could go back five more minutes and I could clean that up completely and here's the thing I'm cleaning it up with math software this isn't audio software although I could easily get that the audio software would do the same stuff but would hide it behind sliders and other things so that I don't have to think about the maths we're using math software and we have already seen how to dramatically change the quality of audio could also adjust my voice to be higher and lower all that stuff just playing with it at the mathematical level okay so that's enough about Fourier transforms we'll meet them briefly again later on in the second half of the course which starts in the next lecture and is about how we tackle some very interesting physics problems all stuff about diffusion which includes how materials mix how gases spread how stuff melts into each other and also waves which is an incredibly broad and important topic we'll be tackling scenarios that we have would have no chance to deal with if we didn't have this Fourier equipment that we've been laying so I hope you'll join me for that next time thanks