0:00

Welcome again to the course on audio signal processing for music applications.

Â In this lecture, I start with our most fundamental topic,

Â the Discrete Fourier Transform.

Â If you can follow and

Â understand this topic, you should have no problem in following the whole course.

Â I divided the topic into two lectures, so this is the first one.

Â 0:47

our series of samples of a sound.

Â That is multiplied by a complex exponential.

Â That's our complex sinusoid.

Â And we multiply sample by sample.

Â So we have one sample of our sound, and

Â we multiplied by one sample of the complex sinusoid.

Â And then, we sum over capital N,

Â which is the number of samples we compute.

Â 1:45

Okay? So, N is our discrete time index,

Â k is our discrete frequency index.

Â And then if we want to understand these frequencies as radiant frequencies,

Â we have to multiply k by 2pi and

Â divide it by N, which is our exponent in the complex exponential.

Â And then if we want to convert these to frequency in hertz,

Â if we have the k index divided by capital N and we multiply by the sampling rate,

Â we obtain the frequency in Hz.

Â Okay. So, let's see an example.

Â 2:28

Our X of N is this top plot,

Â which is, in this case, a series of samples of a noble sound.

Â And then, when we compute the DFT, we obtain this complex function,

Â capital X, that can be expressed in polar coordinates,

Â can be expressed with a magnitude and a phase.

Â But let's first hear the sound.

Â [SOUND] Okay.

Â So this is the oboe sound.

Â And the spectrum, we can see the magnitude and the phase.

Â And in the magnitude we can identify the harmonics of this sound.

Â So these peaks that we see, basically reflect

Â the harmonics of this oboe sound, which is clearly a very harmonic sound.

Â And in the phase spectrum, we can see basically the phase,

Â how these sinusoids are placed within the sort of

Â the cycle length and with respect, in radiance,

Â with respect to the duration of these series of samples.

Â 3:41

As we said, in the DFT equation, the input signal

Â X is multiplied by a series of complex exponentials, complex sine waves.

Â These sine waves are the basis functions of the DFT,

Â the components that we will identify and measure in the input signal.

Â 3:59

One of these complex sine waves is s of k, in which we're using a reverse identity.

Â We can express it as a complex exponential,

Â e to the minus j 2 pi k n divided by capital N.

Â And this is equal to the cosine of the same value

Â minus j sine of this same frequency, so the real and

Â imaginary part of this complex exponential.

Â 4:29

If we have a DFT of size n = 4,

Â we will have n samples in the input signal.

Â And therefore in the sine waves.

Â And we'll have four frequencies.

Â That's going to be also the output of the DFT.

Â Therefore, we will have four sine waves of length 4.

Â One will be at frequency 0, s sub 0,

Â which will be basically the frequency equal to 0 and it will be all equal 1.

Â Then s sub 1 will be the frequency 1.

Â And that will be one cycle of a complex sine wave.

Â S2 will be frequency K equal 2.

Â And S sub three will be K equal 3.

Â So our signal of size N equal 4 will be projected

Â into these four sine waves, which each one being of size 4.

Â 5:39

So here we have the eight complex sine waves,

Â starting with s sub 0 with this component of being a constant.

Â S sub 1, which will have this one period of a sine and of a cosine.

Â And we will keep increasing the number of periods.

Â But as you can see, there is kind of some symmetry, and

Â the frequency doesn't go up to eight periods.

Â But it really goes back to the one period.

Â We'll talk about that.

Â These are basically the eight complex sine waves that

Â are used when we take a DFT of size 8.

Â 6:28

Okay, so the DFT equation can also be expressed by this

Â equation which emphasizes the idea of scalar product

Â in which we are doing the scalar product of x of n,

Â our input signal by the n complex exponentials.

Â 6:49

And if we put an example of, we take again size N equal 4, and

Â we take a signal of being of these four samples, 1 minus 1, 1 minus 1.

Â And we do the scalar product of this signal by every one

Â of the four sine waves that we had computed in the previous slides,

Â we will compute the DFT result.

Â So, when we do the scalar product of x by s sub 0, the result will be zero.

Â That will mean that this particular signal

Â has no frequency, zero is not present.

Â 7:36

And then, if we change to s sub 1 and we do the scalar product,

Â we get the same result, zero.

Â Which, again, means that this frequency is not present in this x signal.

Â But when we change to s sub 2, and we do the scalar product, the result is 4.

Â Which means that basically this x signal is this sinusoid.

Â It's completely present in this sinusoid, and

Â we get the result of 4 which is the sum of all the samples.

Â And then, by S sub 3, again is equal to zero.

Â So that means that we have computed the DFT of X sub N,

Â and we have obtained that is equal to 4 for

Â K equal to 2, and is equal to zero for the rest.

Â Meaning that we have the presence of the frequency, K equal to 2.

Â Let's do that with bigger signal.

Â So, this is an example of the scalar operation

Â of a simple signal that has all 1's.

Â It has 8 samples,

Â the first four are 1s and the last four are minus 1s.

Â So this would be like a rectangular kind of signal.

Â If we compute the DFT, or the scalar product between this x signal and

Â the eight complex sine waves that we had seen in the previous slides,

Â the result will be this one.

Â We'll get the magnitude and the phase, so it's going to be a complex

Â spectrum, and we can display it as polar coordinates.

Â And here we can see that in this signal there is some frequencies present.

Â The frequency k equals 0 is not present.

Â Frequency k equals 1 is very much present, but

Â it also present k equals 3, and it's also present k equal 5.

Â And again, is also present k equals 7.

Â And the phases mean how this sine waves are located in,

Â sort of in the time location.

Â 10:04

So this is the DFT operation, and

Â basically this is going to to be the core of all the things we will be doing.

Â You can find more information on the DFT in

Â Wikipedia and, of course, in the website of Julius Smith.

Â And from now on, on all our lectures we'll use some sounds.

Â So all will come from Freesound, and they can be obtained from this link.

Â And again, the standard Creative Commons and

Â 10:45

So we have shown and explained the DFT equation.

Â I hope you realize that is not such a complex thing.

Â But even if you feel it is complex, its use in audio signal processing is huge.

Â So it is worth spending some time with it.

Â We will continue with the DFT in the second part of the lecture.

Â So thank you for your attention, and I see you next class.

Â