So what we did here was to get a complex signal, decompose it to its original frequencies and I want to kind of look at this use case a bit more, because I want to also talk a bit about individual signals. In order to understand Fourier transform better, we need first to understand individual signals. And also, we need to find the way to generate individual signals so we can play with them. So if I go back here, right, in my case with the piano, I had three individual signals, having their own frequencies and amplitudes. And I merge them together, and then I decompose them using Fourier transform. In my first example, in this one, the signals were very simple because they all had the same frequency. The only difference was in the amplitudes. And also you will notice that all the signals here start at the same time. So, if you look at the second signal, s2, it starts zero zero. So there is one wave here, goes all the way down and back to the zero on the y axis. And this is the same case with s1. It starts at zero zero, and then you have one wave, goes back to zero. And the same with this guy here. The combined signal of course. Now this is not always the case. First of all, signals can have different frequencies. So if I look at this more complex example, you see that the frequency of this signal here is not the same as the frequency of that signal. For the same period of time, if I said this is s2 and this is s1, for the same period of time in s1 I get, I don't know, n waves. Here in S2 I get something like 2 times n, right? I have more waves for the same period of time, because the second signal has higher frequency. That's what frequency is, the number of occurrences per unit of time. But also, if you look here, where the signal start, s2 starts at 0.0 and then you have the first wave. But S1 doesn’t start at 0,0. If you continue this until it reaches the zero on the y axis you will see it starts at minus something, right? So at zero, I already have the maximum amplitude for the signal. And this is what we call phase shift. The signal is slightly shifted, it doesn't start at 0.0. So this is called phase shift, I'll write it down here, phase shift. So if you want to describe a signal, you need three things. First, you need the frequency of the signal, which shows you how many occurances in the period you have. Second, you need the amplitude. You need to know how high the signal goes, what is the strength of the signal. And three, you need the phase shift, you need to know where the signal starts. And this is all captured in a very elegant and super simple mathematical formula. So we can generate signals, we can generate the y value. If this is x where I have the time and this is y where I have the strength of the signal or the amplitude. You can get y as function of t, and this will be A times sine of 2pi f t + phi, right. Where A is the amplitude of the signal, f is the frequency and phi is the phase shift. And using this formula, we can generate any type of signal that we want, and we can then merge them together and play with them. So let me go back to the code, and I have prepared another script. This one, which is a very simple function called gen_wave that accepts the frequency, the amplitude, the period, and the time shift. And there is another parameter, sampling rate. I will talk about sampling rate later. So what this function does is it just generates the values for x the time period and then it computes the signal by multiplying the amplitude, times, you can see it here, amplitude times the sine of two pi times the frequency, the time, and the phase shift. And we can use this to generate a simple signal. So if I generate a signal with a period of one second, frequency of one hertz, and amplitude of one, what we get is something like this. You see that on the x axis I have my time going from 0 to 1, and then I have a single wave, right. So what will happen if in this function I actually put, let's say I set my frequency to two or maybe three. And I run the script again. So what I would get is for the same period of time, 0 to 1, I get three waves, right, simple. What will happen if I set my amplitude to, let's say, 5? Okay. I have to also scale my plot so we can see this better. There, I have my amplitude the strength of the signal going all the way up to five, right? What will happen if I add a bit of shift, maybe add a phase shift of 1.5? Okay, now you see that my signal doesn't start at 0,0 it starts at its maximum. And we can use this function to generate all kinds of signals if you want. And it's interesting to see, if I go back here, how we can use this function to generate complex signals. So if this is my signal S1, S2, and S3, I can actually use the same function to get S1 + S2 + S3. So let's do this. Right, so let me, I'm adding some space here because my camera is in the way I can't see my screen very well. So what I will do now is I will, Generate a signal. With, let me, Set the limits back. I will generate a signal. Okay, with frequency of 1, amplitude of 1, and the period is 10, which means that this signal repeats every 10 seconds. I can also generate another signal. Let's say with a frequency of two and then add these two signals together. Right, let's see what happens. So these are the two signals summed up together. Signal one is frequency of 1 over 10 seconds. Signal two is frequency of 2 over 10 seconds. And I can do something even more interesting, and yeah, as you can see also, the amplitude of the second signal is 2. So that's why we have this like almost two waves overlapping, because the amplitude of signal one is 1, the amplitude of signal two is 2. And I can add a third one here that has a frequency of 3. And then the amplitude is, I don't know, maybe set it to 4, see what happens. And we have to add it, right. So this is how we can generate complex signals. And of course if you now apply Fourier transform to this signal, you will, hopefully, get the original three signals that are being added together to construct this more complex signal, all right, Okay, so essentially, what we did with the piano was this. We had this complex signal, we kind of passed the signal through a Fourier transform and then the output was the spectrogram that allows us to recover the original frequencies. And we can then actually reconstruct the original signals if we want. However, so far we've been treating Fourier transform as a black box, we don't actually know how it works. And now I think it's time to look at the maths behind Fourier and to kind of open this black box.