0:01

Hello, welcome back to the course in Audio Signal Processing for Music Applications.

Â In the previous demo classes of this week, we have analyzed some sounds.

Â We analyzed some electronic periodic signals and we analyzed some real sounds.

Â And we used Audacity and Sonic Visualizer specially to look

Â at the spectrum of these sounds.

Â And now in this lecture, I want to continue that and try to use

Â the tools that we have developed for this particular paths, so the SMS tools.

Â And do the DFT analysis to see if we can understand some sound.

Â 0:45

So let's first open, with Audacity, a file so

Â we can see the overall view of the sound, okay.

Â So let's take the violin sound, okay, so

Â this is a note of a violin it's quite stable.

Â So we can see that it's the length of two seconds but

Â instead of using Audacity let's analyze it with the interface of SMS tools.

Â 1:29

and this will open up the interface, okay.

Â This is the interface of the sms tools

Â where it has all these different models that we're going to be talking about.

Â And now let's go to open up the violin sound and

Â using the DFT module, so we can hear the violin.

Â [SOUND] Okay, so we hear this note of the violin and

Â in the parameters, well let's choose a size,

Â a portion of a sound to analyze and for example, let's use 512.

Â We have to use a power of two for

Â the FFT size because the FFT algorithm requires that.

Â And we don't have to use the window size of the same length, but for

Â now let's do that.

Â And now we have to choose where we take these 512 samples,

Â let's say we choose the middle of the sound so

Â let's take in second one and we compute it, okay.

Â So this is the analysis results, so

Â these are the 512 samples starting with the second one.

Â And then we have computed the DFT of that using the FFT algorithm.

Â And we are displaying half of the spectrum,

Â we are displaying the positive side because it's symmetric.

Â So therefore the negative side is not

Â required because it has the same information.

Â So we're just plotting the positive side both for

Â the magnitude and the phase spectrum.

Â 3:16

In the x axis we are plotting frequency in hertz and

Â so we are plotting from zero to half the sampling rate, okay?

Â So the sampling rate was 44,100, so here we are plotting up to 22,050, okay.

Â And the amplitude in the magnitude spectrum is in decibels as we explain,

Â so we are showing it in DD and the maximum amplitude is minus 20.

Â So here we don't have a complete the signal only reach point 4 so

Â that corresponds to minus 20 decibels and it goes down to minus 120.

Â And the phase we're plotting it using the unwrapping function.

Â So instead of limiting the phase from zero to two pi,

Â we let it unwrap so that we see a match smoother shape and

Â that's going to be quite good, quite useful.

Â And then finally out of this we compute the inverse and

Â we compute another time domain signal.

Â It's not the same than the input signal because we

Â have applied a window in the input signal and this is what we are seeing here.

Â This is the windowed version that is the one

Â that is basically captured in the spectrum.

Â 4:41

Okay, now let's try to see if we can understand something on the sound, and

Â typically the magnitude spectrum is the most useful one.

Â Here, well, we see things but maybe we don't see what we would like

Â to see which kind of visualize the harmonics of that.

Â So this might be because this is not enough samples, we don't

Â have enough information to visualize and separate all these frequencies.

Â We need a bigger frequency analysis, so

Â instead of 512 let's take the next power of tool,

Â so the next FFT size, 1,024 and let's compute it.

Â 5:33

the previous one that, of course, we have taken more samples.

Â And the magnitude spectrum gives us some more information, for

Â example, here, we see clearly these peaks and this corresponds

Â to the harmonics of the sound, so that's a quite useful information.

Â Okay, now maybe in order to see what can

Â we understand about the sound let's look at another portion of the sound.

Â Of course as we saw the sound is quite stable but

Â if we go into the beginning, if we zoom into the very beginning

Â of the sound there is a region of the attack that's a little bit different.

Â So let's see we can capture that difference, so let's go back to our

Â interface and let's do the same analysis but instead of doing

Â the analysis at time one, let's do it at time zero so we compute from time zero.

Â 6:46

And what we're also seeing is that this spectrum is a little bit different, okay.

Â We see, during the attack that maybe the harmonics are not so

Â clear, because at the beginning of the sound,

Â there is more the attack of the bow of the noise.

Â So the harmonics are not so well identified, whether in

Â the middle of the sound, clearly the harmonics are stronger Instead,

Â at the beginning there is more noise.

Â So these irregularities that we see in the time domain wave form are capturing

Â the spectrum by seeing all these more kind of random and

Â irregular shapes we see in this spectrum.

Â 7:41

Now let's go back to the window of the control parameters,

Â let's go back to the middle of the sound.

Â And let's talk about the difference between how many samples we take and

Â the 50 size we compute.

Â We do not have to take the same number of samples of the F50,

Â for example, we can take 801 samples and

Â then zero part to the F50 size and compute the result.

Â So, if we do that, okay, this

Â is similar to the previous analysis we did,

Â 8:26

before in which we took more samples.

Â We took 1,024, and now there is less samples and

Â the spectrum, well they look okay both.

Â Of course in the one that we took more samples of the input signals,

Â we see the harmonics a little bit better than the one

Â that we have computed now with 800 samples.

Â But is as smooth as the previous one, so both are equally smooth,

Â this is because the F50 size in both cases is 1,024.

Â Okay, now let's maybe get rid of the one we just computed and

Â let's compute again the 1,024

Â samples which maybe the most useful one.

Â 9:31

by zooming into the beginning where it seems that

Â the most activity and the most interesting information is.

Â So with these figure interface of Python we can choose a rectangle,

Â so for example in the magnitude spectrum we can just choose the first

Â 5,000 Hertz, okay.

Â And we can see these harmonics,

Â the peaks of the first 5,000 Hertz quite more clearly and

Â we can do the same thing with the phase spectrum.

Â 10:11

Okay, so we'll take the first 5,000 Hertz, and

Â this is the phase of what corresponds to these frequencies, the same frequencies.

Â Okay, now we can start seeing other things of the sound, for

Â example, we can see that these peaks are equally spaced.

Â And we can look at the frequency of them here in the lower

Â right corner it tells us what is the location of the x

Â of the cursor at the x-axis and

Â we see that it is around 240 hertz, okay.

Â Because the dimension is in hertz and

Â if we look at the next one it's around 480 hertz,

Â so in fact these are the harmonics of the sound.

Â The first is the fundamental so the fundamental is around 240 hertz and

Â this is twice the fundamental and these will be all the multiples,

Â the harmonic multiples of the fundamental.

Â Okay, so that's good, so that's a way to identify the fundamental frequency

Â 11:25

of the sum and in the phase spectrum, it's pretty nice.

Â Basically what we are seeing In the corresponding frequency of the harmonics,

Â we are seeing the phase of these harmonics,

Â the phase at time zero, where we have a centered analysis.

Â So if we look here, for example, the corresponding location of the first

Â harmonic, it says that it is around minus two point eight radians.

Â Because the vertical axis is in radians and this is in fact

Â the phase at time zero oft this particular harmonic.

Â And we can go to the next harmonic and measure the phase or to the next harmonic.

Â So visually we can identify the magnitude and phase of the components

Â of this sound, so that's going to be very important and very useful.

Â And clearly with these interface with the SMS tools we can zoom into the sound

Â in ways that the Sonic Mutualizer or the Audacity was not so easy to do.

Â 12:39

So anyway, so that's all I wanted to say.

Â So basically we have gone through

Â the SMS tools, these interface of the DFT in particular.

Â And we have analyze a violin sound which is available in free sound and

Â we have played around a little bit with different parameters of the DFT.

Â 13:04

Okay and that's all for today, with these three demonstration classes

Â we have tried to see the different tools that we can use for

Â analyzing the sound, visualizing the time domain, visualizing the spectrum.

Â But of course there is much more to do, so next week,

Â we will continue and we will go into a little bit more complicated things.

Â So I hope to see you then, byebye.

Â