red and light cyan color.

So the light red is the synthesized harmonics of

the sound of that particular frame.

Of course this is a different FFT size,

the shapes of these lobes is different because the window is different.

This is a window using the synthesis.

So this is the synthesized spectrum and

then we have to subtract these spectrum from the original spectrum.

Strictly speaking, we don't subtract it from the spectrum on the left,

we subtract this from another generated spectrum that has the same parameters so

that we can subtract the two of the same size and the same window size.

And then it will subtract this synthesize sinusoids or

harmonics from the original one.

We get this dark red and dark cyan color.

Okay, and this is the residual spectrum in magnitude and phase representation.

And if we take the inverse of that, we see the residual signal in the tandem and

that's what we see on the top-right plot.

In which we see the original flute sound of course with

the right windowing and the right size that we have in the synthesis.

And we see the residual signal, this dark blue one.

And again, this is not just an error signal,

this in fact is a relevant component,

it's a relevant part of the sound that we want to recover.

So the whole system, if we put together all this analysis in a frame by

frame type of thing and put it together into a whole analysis synthesis system.

We get this block diagram in which we start from the signal x[n],

then we window it, we compute FFT, obtaining the magnitude and

phase spectrum, we detect the peaks.

Hold up those peaks, we find the fundamental frequency, and

once we have this fundamental frequency we can identify the harmonics of that sound.

And we can synthesize those harmonics with the window.

Okay, so we have another spectrum,

Yh, that can be subtracted from the original signal.

But in order to do that,

we need to recompute another spectrum of the original with a window and

a size that is comparable with the size that we use in the synthesis.

So we will choose a window size that normally will be 512 samples,

we'll use a window so that the shape of these X[k]

that we now compute can be easily subtracted From Yh.

So it's just a complex subtraction and we get capital Xr,

which is our residual spectrum, okay?

And then this residual spectrum can be added to the harmonic spectrum.

And then, we can compute the inverse FFT and

do the Overlap-add iterating over the whole sum.

We can see an example of the analysis of a particular sound using the harmonic

class residual model.

So here, we took the flute sound that we have heard before, and

so on top, we see the spectrogram of these flute sound and

superpose we see the harmonics that have been obtained.

So let's listen to these harmonic synthesis.

[SOUND] Okay, and then these harmonics are subtracted

from this background spectrogram and we obtain these

lower sort of a plot which are the spectrogram of the residual component.

So let's just now listen to this residual that has been obtained.

[NOISE] Okay, it's soft but it's clearly very relevant.

It's basically the breath noise of the instrument which is

an important part of the characteristics of the sound.

But this residual component is a complete sound.