Module 3 - Short-term analysis
Speech Processing>Module 3>Digital Speech Signals>Videos.Short-term analysis
Short-term analysis
speech.zone
단기 분석(Short-term analysis)은 시간 영역(time domain)에서 벗어나 빈도 영역( frequency domain)과 같은 다른 영역으로 이동하는 첫 번째 단계입니다.
여기 음성 단어(spoken word)가 있습니다.분명히 그 속성은 시간에 따라 달라집니다.
진폭(amplitude)이 달라집니다.
예를 들어, 어떤 부분은 유성음(voicing)이고, 다른 부분은 그렇지 않거나 이 부분은 무성음(unvoicing)입니다.
총 지속 시간(total duration)을 측정하는 것 외에 전체 발화의 다른 속성을 분석하는 것은 의미가 없습니다.
예를 들어, F0은 시간에 따라 변하는 것이 아니라 유성음 영역에만 존재하고 무성음 부분에는 존재하지도 않습니다.
단기 분석은 첫 번째 단계이므로 일반적으로 파형(waveform)에 대해 아무것도 모르는 상태에서 수행해야 합니다.
예를 들어 자동 음성 인식(ASR)에서는 어떤 단어가 발화되었는지 알기 전에 분석이 이루어집니다.
따라서 음성을 언어적으로 의미 있는 단위로 세분화한 다음, 예를 들어 이 유성 마찰음(voiced fricative), 이 유성 마찰음, 이 무성 마찰음(unvoiced fricative) 등 특정 분석을 수행할 수 없습니다.
그 대신 신호의 내용에 대한 지식이 전혀 필요하지 않은 범용 방법을 사용해야 합니다.
이를 위해 신호를 균일한 영역(uniform regions)으로 나누고 각각을 개별적으로 분석할 것입니다.
이러한 영역을 '프레임'이라고 하며 프레임에는 고정된 지속 시간이 있으며, 이 지속 시간은 우리가 선택해야 하는 것입니다.
전체 발화를 가져와서 그 중 일부 짧은 영역을 확대하여 분석을 수행하는 것입니다.
그런 다음 시간을 앞으로 이동하여 해당 영역을 분석하고, 다시 앞으로 이동하여 해당 영역을 분석하는 식으로 발화의 시작부터 끝까지 몇 가지 고정된 단계로 작업합니다.
가장 먼저 결정해야 할 것은 한 번에 분석할 파형의 양입니다.
눈앞의 파형은 분명히 그 특성이 크게 다르므로 그보다 더 짧은 영역이 필요합니다.
먼저 윈도우 함수(window function)를 선택한 다음 파형에 이 윈도우 함수를 곱하여 파형의 프레임을 정의하겠습니다.
여기서 제가 선택한 창은 가장 간단한 창으로, 분석하고자 하는 프레임 내를 제외한 모든 곳에서 0이고 값이 1인 직사각형 창입니다.
이 두 가지를 샘플별로 곱하면 전체 발화에서 "잘라낸" 파형의 프레임을 얻을 수 있습니다.
이렇게 잘라낸 파형 조각을 프레임이라고 합니다.
그런 다음 시간을 조금 앞당겨 분석을 위해 또 다른 프레임을 잘라낼 것입니다.
그 과정은 다음과 같습니다:
파형 프레임 잘라내기: 후속 분석을 위한 준비가 완료되었습니다.
시간을 일정량 앞으로 이동하고 다른 프레임을 잘라내는 등의 방법으로 이 파형에서 잘라낸 프레임 시퀀스를 얻습니다.
파형에서 윈도우 함수(window function)를 슬라이드하면 간단히 수행됩니다.
파형의 한 프레임을 자세히 살펴봅시다.
가능한 가장 단순한 직사각형 창을 사용했기 때문에 실수로 신호에 원본에는 없는 무언가를 도입했습니다.
바로 신호 가장자리의 갑작스러운 변화입니다.
이는 원래 신호의 일부가 아닌 프로세싱 과정에서 도입된 '아티팩트 artifact'를 의미합니다.
이 신호를 분석하면 음성뿐만 아니라 이러한 아티팩트도 분석하게 됩니다.
따라서 일반적으로 이러한 아티팩트가 나쁘기 때문에 직사각형 창 함수를 사용하지 않고 테이퍼드 창을 사용합니다.
프레임을 잘라내면 이렇게 보이지는 않지만 가장자리로 갈수록 가늘어지는 창 함수를 사용하여 잘라냅니다.
페이드 인과 페이드 아웃이라고 생각하면 됩니다.
이렇게 하면 다음과 같은 파형 프레임을 얻을 수 있습니다. 가장자리에서 갑작스러운 불연속성이 없습니다.
다음은 테이퍼 창을 사용하여 긴 파형에서 프레임을 추출하는 전체 프로세스입니다.
음성의 일반적인 값은 프레임 지속 시간 25ms와 그보다 짧은 프레임 시프트인데, 이는 테이퍼드 윈도우(tapered windows)을 사용하기 때문입니다.
파형 손실을 방지하려면 분석 프레임을 겹쳐야 합니다.
따라서 한 프레임, 그 다음 프레임, 그 다음 프레임을 추출하여 각 프레임의 지속 시간은 25밀리초이고 각 프레임의 시간은 이전 프레임보다 10밀리초 더 길어지게 합니다.
전체 발화를 프레임 시퀀스로 변환한 것입니다.
이 표현(프레임 시퀀스)은 F0를 추정하거나 자동 음성 인식을 위한 특징을 추출하는 등 음성 신호에 대해 수행할 수 있는 거의 모든 후속 분석의 기초가 됩니다.
이제 음성 발화를 일련의 프레임으로 분류했으므로 실제로 몇 가지 분석을 수행할 준비가 되었습니다.
가장 중요한 첫 번째 목적지는 주파수 영역으로, 시간 영역에서 직접 분석할 때의 많은 한계를 벗어날 수 있습니다.
이제 주파수 영역에 도달하기 위해 푸리에 분석을 사용할 것이며 실제로 두 단계로 나누어 소개할 것입니다.
먼저 직렬 확장(Series Expansion)이라는 다소 추상적인 개념을 살펴본 다음 이를 이용해 푸리에 분석 자체를 설명하겠습니다.
Short-term analysis is the first step that takes us out of the time domain and into some other domain, such as the frequency domain.
Here's a spoken word.
Clearly, its properties vary over time.
The amplitude varies.
Or, for example, some parts are voiced: this is voiced, this is voiced.
But other parts are not: this part's unvoiced.
Apart from measuring the total duration, it makes no sense to analyse any other properties of a whole utterance.
For example, F0 doesn't just vary over time, it only exists in the voiced regions and doesn't even exist in the unvoiced parts.
Because short-term analysis is the first step, in general we need to perform it without knowing anything about the waveform.
For example, in Automatic Speech Recognition, the analysis takes place before we know what words have been spoken.
So we can't do the following: we can't segment the speech into linguistically-meaningful units and then perform some specific analysis, for example, on this voiced fricative, or this vowel, or this unvoiced fricative.
Rather, we need to use a general-purpose method, which doesn't require any knowledge of the contents of the signal.
To do that, we're going to just divide the signal into uniform regions and analyse each one separately.
These regions are called frames and they have a fixed duration, and that duration is something we have to choose.
Here's the plan: we'll take our whole utterance and we'll zoom into some shorter region of that and perform some analysis.
Then we shift forward in time, analyse that region, then move forward again, analyse that region, and so on, working from the start of the utterance to the end in some fixed steps.
The first thing to decide is how much waveform to analyse at any one time.
The waveform in front of you clearly substantially varies its properties, so we need a shorter region than that.
We'll define a frame of the waveform first by choosing a window function and then multiplying the waveform by this window function.
My window here is the simplest possible one: a rectangular window that is zero everywhere except within the frame I wish to analyse, where it's got a value of one.
We multiply the two, sample by sample, and obtain a frame of waveform that's - if you like - "cut out" of the whole utterance.
This cut-out fragment of waveform is called a frame.
We're then going to move forward a little bit in time and cut out another frame for analysis.
So here's the process:
Cut out of frame of waveform: that's ready for some subsequent analysis.
Move forward some fixed amount in time, cut out another frame, and so on to get a sequence of frames cut out of this waveform.
That's done simply by sliding the window function across the waveform.
Let's take a closer look at one frame of the waveform.
Because I've used the simplest possible rectangular window, we've accidentally introduced something into the signal that wasn't there in the original.
That's the sudden changes at the edge of the signal.
These are artefacts: that means something we introduced by our processing, that's not part of the original signal.
If we analysed this signal we'd not only be analysing the speech but also those artefacts.
So we don't generally use rectangular window functions because these artefacts are bad, but rather we use tapered windows.
When we cut out a frame, it doesn't look like this, but it's cut out with a window function that tapers towards the edges.
Think of that as a fade-in and a fade-out.
That gives us a frame of waveform that looks like this: it doesn't have those sudden discontinuities at the edges.
Here's the complete process of extracting frames from a longer waveform using a tapered window.
Typical values for speech will be a frame duration of 25 ms and a frame shift off something less than that, and that's because we're using these tapered windows.
To avoid losing any waveform, we need to overlap the analysis frames.
So, we'll extract one frame, then the next, and the next, each one having a duration of 25 ms and each one being 10 ms further on in time than the previous one.
We've converted our complete utterance into a sequence of frames.
This representation - the sequence of frames - is the basis for almost every possible subsequent analysis that we might perform on a speech signal, whether that's estimating F0 or extracting features for Automatic Speech Recognition.
With a speech utterance broken down now into a sequence of frames, we're ready to actually do some analysis.
Our first, and most important, destination is the frequency domain, which escapes many of the limitations of doing analysis directly in the time domain.
Now, to get to the frequency domain, we're going to use Fourier analysis and that will be introduced actually in two stages.
First we'll have the rather abstract concept of Series Expansion, and then we'll use that to explain Fourier analysis itself.