Welcome again to the course on audio signal processing for music applications. In this class, I want to highlight the basic mathematic concepts that are required to understand what we will cover in the course. I will not explain them in depth. So, if you have not seen them before or, you have already forgotten. I strongly encourage you to go over them by yourself as soon as possible. In the context of this course, sounds are discrete signals, and the processes that we will develop are discrete systems. Thus we will require some background on discrete mathematics. The good news, is that, no Calculus is required to follow these course. You just have to know a little bit about sinusoidal functions, complex numbers, Euler's formula, complex sinusoids, scalar product of sequences, even and odd function and convolution. That's not that much. You really don't need much more than these. The rest we'll cover and explain in the course. So let me now present these concepts, so you can identify what you should review before really starting into our core topics. Our first basic concept, is the sinewave. A sinusoidal function or sinewave is a mathematical curve, that describes a smooth repetitive oscillation. It occurs often, in physics, engineering and many other fields. Here we see the equation of a sinewave. x of n, which is our function. Is equal to capital A times the cosine of omega n capital T plus phi. So, where A is the amplitude of the sinewave. Omega is the angular frequencies, so it's expressed in radians. And then nT is basically our time, n is our time index and capital T is our sampling period. So we, we multiply n by capital T, we obtain the t in seconds. And then the phi is the initial phase, also expressed in radians. And the frequency can be expressed also in hertz. So to convert the omega into hertz, we basically have to divide by 2 pi. So omega divided by 2 pi is equal to the frequency in hertz. Okay, the most common visual representation of a sine wave is this one. So you see here a plot, in which we can see the time in the horizontal axis. And the amplitude in the vertical axis. So, we can play it. [SOUND] So this is the sound of this sinusoid, this is the code that generated the sinewave. All our examples and and plots will be generated using Python, and all the assignments and exercises too. So this is a very simplified code for the sinewave in which we see the amplitude which was 0.8. The frequency, which is 1,000 hertz. So the frequency we heard is 1,000 hertz. Then, there is an initial phi, which is the initial phase at time 0. At which time 0 is right in the middle. And then in order to generate the function, we need to generate a time array, which is all the time that we will be displaying. So, a small t is an array that goes from minus 0.002 seconds to 0.002 seconds but of course sampled at the sampling rate at fs and this is the equation that we actually type into Python to generate the sinewave. Okay, so another needed basic concept is the one of complex numbers, which are numbers that are built of two parts. One part is what we call real part, and the other is the imaginary part. So a would be the real part, and b would be the imaginary part. In order to, to represent imaginary part, we multiply by j, which is the imaginary unit. is the square root of minus 1. So jb composes the imaginary part. And then these number, these complex numbers are normally represented in what we call the complex plane. Shown here. In which the real part is the horizontal axis, so it's plotted on the horizontal axis. And the imaginary part, the b value, is plotted in the vertical axis. And then we normally have this circle, which is magnitude one. So this is what we call the unit circle. And here are all the complex numbers that have magnitude 1. A complex number can be expressed in two ways, in what we call rectangular form or in polar form. The rectangular form is the most direct form, in which we explicitly express the a value, the real part, and b, the imaginary value. And therefore the intersection of these two values in the complex plane with this cross, is the actual complex number. In polar form, what we do is we consider this complex number, this cross, as the tip of the vector with origin at (0, 0). Therefore as a vector it has a magnitude which is capital A. That can be computed from a and b, as the square root of the sum of the squares. And then it also has an angle, and also can be computed from a and b by computing the inverse tangent of b over a. The polar form representation makes the sum and multiplication operations of complex numbers more intuitive. For us, that will be a great advantage. And we will use the polar form representation of complex numbers and functions whenever possible. Now let's combine sines and complex numbers. Euler's equations establishes a very useful relationship between rectangular and polar co-ordinates of a complex number. So the number e to the j phi, which is a complex exponential, can be expressed as the sum of a cosine plus a sine. A real part, cosine phi, plus an imaginary part, j sine phi. And we can go back and forth in the two directions. So we can start from, from the complex exponential and obtain the, the real part, cosine phi. Or the imaginary part, sin phi, and the other way around. It's a nice looking formula, and in fact the physicist Richard Feynman. Call this equation the, the most remarkable formula in, in mathematics. If we show this in the, in the complex plane, in this diagram that we show here, we can see these components that we mentioned. So we see the complex value as the e to the j phi. Which seems, has magnitude 1, is in the unit circle. And we can see the, the real part and the imaginary part. One being the real part, cosine phi. And the imaginary part being sine phi. So this formula will be fundamental to understand the, Discrete Fourier Transform, we will come back to it later. Now by using sinusoids, complex numbers, and what we just have seen, the Euler's formula, we can introduce complex sinusoids. So in, in this case the function x of n, with a bar is a complex sinusoid. So it can be expressed with this complex exponential that we just introduced. And there are several ways to represent the same function using this Eular's identity. So please go through this equation and make sure that you understand it. We'll normally be working with real signals. That's real sinusoids. And we'll have to go from complex sinusoids, the ones that Fourier Transform work with, to real sinusoids. So in here, we see the equation of a real sinusoid. That we saw before. So, capital A amplitude times the cosine of omega nt plus phi.
Acos(ωnT+φ) As can be expressed with the sum of complex sinewaves, okay? So, complex sinewave, if we sum two of them. Can generate a real sinewave. In fact that seems too complicated and not so intuitive but it's a, it's a very useful mathematical trick that Fourier uses, that in the Fourier transform we need to be able to understand. So that basically says that summing two complex sinewaves, we can cancel the imaginary components of the sinusoids and keep the real part, which is what we are normally going to be interested in. To plot the complex sinewave is not easy. We would need to, to show it in 3D space. And a common alternative is to plot the real and imaginary components as two separate functions. So in here, we see the real and imaginary sinusoids. So the, in blue is the real part, so it's a cosine. And in green, is the imaginary part, so is a sine function. And that's how we're going to be plotting these complex sinewaves. Another concept to be familiar with is, the scalar or dot product, a common algebraic operation between sequences. This is an operation that takes two equal length sequences of numbers. And returns a single value. This operation can be defined either geometrically or algebraically. And, algebraically, it's the sum of the products of the corresponding entries of the two sequences of numbers, as is shown here. So we have the sequence x, sequence y. And we just sum over the sample to sample product of each of these sequences. And we can show it in an example. So we have an example x of n simple sequence, and y of n, another simple sequence, complex sequences. Their dot product will be the point to point multiplication of these two sequences. However, the second sequence is conjugated. So we see here the minus j of the second sequence because we we conjugated the j of the second sequence. And then if we do the whole operation, we obtain a number. So the scalar product means that we return a single number after doing the operation with two sequences. An important property of the scalar product is that when two sequences are orthogonal. Their scalar product is equal to 0. So here we see this concept. x is orthogonal to y, if and only if the scalar product of x times y is equal to 0. So geometrically the dot product can be understood as the projection of one sequence into another, and maybe this diagram we can see this concept. So we have two sequences, very short sequences. One is composed of the values 2 and 2, and the other is composed of the value 2 and minus 2, which in the two-dimensional space are orthogonal. I mean, we see them one being perpendicular to the other. So, and we can prove that. By doing the dot product of x times y and so if we do this operation as shown here, we can prove that is equal to 0. So the dot product of these two sequences is 0. And this is a basic operation that is performed by the Discrete Fourier Transform. Another mathematical concept, that will appear in our signal analysis operations, is the one of even and odd functions. So function is even if the negative part of the function, so you would say f of minus n. Is equal to f of n. So, that is what we call a symmetric function. An odd function is when f of minus n is equal to the minus f of n. And this is what we call, an antisymmetric signal. So the case of the two functions that we have been talking about, cosines and sines, very much exemplify these two types of of properties. A cosine is an even function because it's symmetric around the origin, about the point 0. And the sine is an odd function, because is antisymmetric. Around 0, we have this antisymmetry, okay? So this is going to be also relevant in some of the things we will be talking about. The last concept we want to mention is one of convolution of sequences. This is a mathematical operation of two sequences, producing a third sequence that can be viewed as a modified version of one of the original sequences. Here we see, the equation of convolution. I don't have time to go into detail, but please try to understand it. And also we can see it graphically if we have these two sequences x sub 1 x sub 2 that have different shapes, the resulting sequence the, the convolve result, is a much smoother function. And it's a quite kind of a combination of these two sequences. So convolution is, is similar to cross correlation. It's a common operation used to implement filtering of sounds. And it's also useful to understand Several of the properties of the Fourier transform. So the concepts I highlighted in this lecture are extensively covered in many text books. Most of the references I use come from Wikipedia and from the website of Julius Smith. On the mathematics of Discrete Fourier Transform reference that I very much recommend that you go through. So if you want to have more information in Wikipedia, I have highlighted some of the relevant entries and the, the website of Julius for the book. And again the standard attribution of all the content that I am using in this course. And this all for this lecture. We have identified the basic mathematic concepts that will be very much needed throughout the course. Please make sure that you get a grasp of them before we start Fourier topics. Thanks for your attention.