/
03-05-ACA-Input-Features.tex
438 lines (404 loc) · 20 KB
/
03-05-ACA-Input-Features.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
% move all configuration stuff into includes file so we can focus on the content
\input{include}
\newcommand{\listspectralfeature}[2]{
\vspace{-6mm}
\begin{footnotesize}
\begin{equation*}
\input{eq/Llf_Spectral#1}
\end{equation*}
\end{footnotesize}
\only<1>{
{\flushright\includeaudio{sax_example}}
\vspace{-9mm}
\figwithref{FeatureSpectral#1}{matlab source: \href{https://github.com/alexanderlerch/ACA-Plots/blob/master/matlab/plotFeatures.m}{plotFeatures.m}}
\inserticon{audio}
}
\only<2>{
%\vspace{10mm}
\textbf{common variants}:
{#2}
}
}
\subtitle{module 3.5: instantaneous features}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% generate title page
\input{include/titlepage}
\section[overview]{lecture overview}
\begin{frame}{introduction}{overview}
\begin{block}{corresponding textbook section}
%\href{http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6331120}{Chapter 3~---~Instantaneous Features}: pp.~31--35
section~3.5
\end{block}
\begin{itemize}
\item \textbf{lecture content}
\begin{itemize}
\item introduction to the concept of features
\item timbre
\item spectral shape instantaneous features
\end{itemize}
\bigskip
\item<2-> \textbf{learning objectives}
\begin{itemize}
\item describe the process of feature extraction
\item list possible pre-processing option and explain potential use cases
\item describe the general impact of spectral shape on timbre perception
\item summarize features, describe their computation, and discuss their meaning
\end{itemize}
\end{itemize}
\inserticon{directions}
\end{frame}
\section[intro]{introduction}
\begin{frame}{instantaneous features}{introduction}
remember the flow chart of a general ACA system:
\vspace{-3mm}
\begin{figure}
\input{pict/introduction_ACASystem_2}
\end{figure}
\vspace{-2mm}
\pause
\textbf{feature}:
\begin{itemize}
\item<2-> \textit{terminology}:
\begin{itemize}
\item audio descriptor
\item instantaneous/short-term/\color<3->{highlight}{low-level feature}
\end{itemize}
\item<2-> \textit{characteristics}:
\begin{itemize}
\item not necessarily musically, perceptually, or semantically meaningful
\item low-level: usually one value per block
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{instantaneous features}{feature}
\toremember{}
\begin{block}{a feature \ldots}
\begin{itemize}
\item is task-specific, i.e.\ holds descriptive power relevant to the task,
\bigskip
\item may be custom-designed, chosen from a set of established features, or learned from data,
\bigskip
\item can be a representation of any data (audio, meta data, other features, ...),
\bigskip
\item is not necessarily musically, perceptually, or semantically meaningful or interpretable
\bigskip
\item also: non-redundant, invariant to irrelevancies
\end{itemize}
\end{block}
\end{frame}
\begin{frame}{instantaneous features}{feature example}
waveform envelope of three different signals
\figwithmatlab{Waveform}
\vspace{-2mm}
\begin{columns}
\column{.16\textwidth}
\column{.25\textwidth}\centering
\hspace{8mm}\includeaudio{excerpt_speech}
\column{.25\textwidth}\centering
\includeaudio{excerpt_stringquartet}
\column{.25\textwidth}\centering
\hspace{-10mm}\includeaudio{excerpt_pop}
\column{.09\textwidth}
\end{columns}
\bigskip
\begin{itemize}
\item<2-> envelopes of waveforms can have distinct shape
\item<2->[$\Rightarrow$] a feature describing envelope shape could help to distinguish these signal types
\end{itemize}
\inserticon{audio}
\end{frame}
\begin{frame}{instantaneous features}{feature extraction}
\vspace{-5mm}
\begin{columns}
\column{.6\linewidth}
\flushright{\includeaudio{sax_example}}
\vspace{-5mm}
\figwithmatlab{FeatureExtraction}
%\begin{figure}
%\vspace{-8mm}
%%\includegraphics[height=10mm,width=.7\columnwidth]{waveform}\\ \vspace{-3mm}
%\includegraphics[scale=.08]{FeatureExtraction}
%
%\end{figure}
\column{.4\linewidth}
\begin{itemize}
\item repeat for every block
\item repeat for every feature: \textit{Spectral Centroid}, \textit{RMS}, \textit{MFCCs}, \ldots
\bigskip
\item[$\Rightarrow$] feature matrix per audio input
\end{itemize}
\end{columns}
\inserticon{audio}
\end{frame}
\section{timbre}
\begin{frame}{timbre}{introduction 1/2}
\vspace{-3mm}
\begin{block}{\textbf{definition (American Standards Association)}}
...that attribute of sensation in terms of which a listener can judge that two sounds having the same loudness and pitch are dissimilar
\end{block}
\bigskip
\question{What is the problem with this definition?}
Bregman:\footfullcite{bregman_auditory_1994}
\begin{enumerate}
\item implies that timbre \textit{only} exists for sounds with pitch!
\item only says that timbre \textit{is not} loudness and pitch
\end{enumerate}
\pause
\begin{itemize}
\item[$\rightarrow$] [timbre is] "\textit{...the psychoacoustician's multidimensional waste-basket category for everything that cannot be labeled pitch or loudness.}"\footfullcite{mcadams_hearing_1979}
\end{itemize}
\end{frame}
\begin{frame}{timbre}{introduction 2/2}
timbre is
\begin{itemize}
\item a function of \textbf{temporal envelope}
\begin{itemize}
\item attack time characteristics
\item amplitude modulations
\item \ldots
\end{itemize}
\item<2-> a function of \color<4->{highlight}{\textbf{spectral distribution}}
\begin{itemize}
\item spectral envelope
\item number of partials
\item energy distribution of partials
\item \ldots
\end{itemize}
\end{itemize}
\begin{itemize}
\item<3->[] when dealing with complex mixtures of sound, it is very difficult (maybe impossible?) to extract detailed temporal information for individual tones
\item<4->[$\Rightarrow$] timbre features typically focus on the \textbf{spectral shape}
\end{itemize}
\end{frame}
\section[spectral features]{spectral shape features}
\begin{frame}{spectral shape features}{spectral centroid}
\listspectralfeature{Centroid}{\begin{itemize} \item power spectrum \item logarithmic frequency scale
\[
v_\mathrm{SC,log}(n) = \frac{\sum\limits_{k = k(f_{\mathrm{min}})}^{\mathcal{K}/2-1}{\log_2\left(\frac{f(k)}{f_{\mathrm{ref}}}\right)\cdot |X(k,n)|^2}}{\sum\limits_{k = k(f_{\mathrm{min}})}^{N/2-1}{|X(k,n)|^2}}
\]
\end{itemize}}
\end{frame}
\begin{frame}{spectral shape features}{spectral spread}
\listspectralfeature{Spread}{\begin{itemize} \item same variants as with \textit{Spectral Centroid}, e.g.\ logarithmic:
\begin{footnotesize}\[
v_\mathrm{SS,log}(n) = \sqrt{\frac{\sum\limits_{k = k(f_{\mathrm{min}})}^{\nicefrac{\mathcal{K}}{2}-1}{\left(\log_2\left(\frac{f(k)}{\unit[1000]{Hz}}\right)-v_{\mathrm{SC}}(n)\right)^2\cdot |X(k,n)|^2}}{\sum\limits_{k = k(f_{\mathrm{min}})}^{\nicefrac{\mathcal{K}}{2}-1}{|X(k,n)|^2}}}
\]\end{footnotesize}
\end{itemize}}
\end{frame}
\begin{frame}{spectral shape features}{spectral rolloff}
\listspectralfeature{Rolloff}{\begin{itemize} \item scaled to frequency \item power spectrum \end{itemize}}
\end{frame}
\begin{frame}{spectral shape features}{spectral decrease}
\listspectralfeature{Decrease}{\begin{itemize} \item restricted frequency range:
\[
v_{\mathrm{SD}}(n) = \frac{\sum\limits_{k = k_{\mathrm{l}}}^{k_{\mathrm{u}}}\frac{1}{k}\cdot \big(|X(k,n)|-|X(k_{\mathrm{l}}-1,n)|\big)}{\sum\limits_{k = k_{\mathrm{l}}}^{k_{\mathrm{u}}}{|X(k,n)|}}
\] \end{itemize}}
\end{frame}
\begin{frame}{spectral shape features}{spectral flux}
\listspectralfeature{Flux}{
\begin{footnotesize}
\begin{eqnarray*}
v_{\mathrm{SF}}(n, \beta) &=& \frac{\sqrt[\beta]{\sum\limits_{k = 0}^{\mathcal{K}/2-1}{\left(|X(k,n)|-|X(k,n-1)|\right)^\beta}}}{\nicefrac{\mathcal{K}}{2}}\\
v_{\mathrm{SF}, \sigma}(n) &=& \sqrt{{\frac{2}{\mathcal{K}}}\sum\limits_{k = 0}^{\mathcal{K}/2-1}{\left(\Delta X(k,n)-\mu_{\Delta X}\right)^2}}\\
v_\mathrm{SF, log}(n) &=& {{\frac{2}{\mathcal{K}}}\sum\limits_{k = 0}^{\mathcal{K}/2-1}{\log_2\left(\frac{|X(k,n)|}{|X(k,n-1)|}\right)}}
\end{eqnarray*}
\end{footnotesize}
}
\end{frame}
%\begin{frame}{spectral shape features}{spectral slope}
%\listspectralfeature{Slope}{}
%\end{frame}
%\begin{frame}{spectral shape features}{spectral skewness}
%\listspectralfeature{Skewness}{}
%\end{frame}
%\begin{frame}{spectral shape features}{spectral kurtosis}
%\listspectralfeature{Kurtosis}{}
%\end{frame}
\section[MFCCs]{Mel Frequency Cepstral Coefficients}
\begin{frame}{fundamentals}{cepstrum 1/3}
\textbf{signal model}: \\
convolution of \textit{excitation signal} and \textit{transfer function}
\begin{equation*}\label{eq:speech}
x(i) = e(i)\ast h(i)
\end{equation*}
\pause
\begin{equation*}
X(\jom) = E(\jom)\cdot H(\jom)
\end{equation*}
\pause
\begin{eqnarray*}
\log\big(X(\jom)\big) &=& \log\big(E(\jom)\cdot H(\jom)\big)\nonumber\\
&=& \log\big(E(\jom)\big) \mathbf{+} \log\big(H(\jom)\big)
\end{eqnarray*}
\end{frame}
\begin{frame}{fundamentals}{cepstrum 2/3}
\vspace{-6mm}
\begin{footnotesize}
\begin{eqnarray*}
\only<1-3>{ c_x(i) &=& \mathfrak{F}^{-1}\left\{\log\left(X(\jom)\right)\right\}\nonumber\\
\pause
&=& \mathfrak{F}^{-1}\left\{\log\left(E(\jom)\right) + \log\left(H(\jom)\right)\right\}\nonumber\\
\pause
&=& \mathfrak{F}^{-1}\left\{\log\left(E(\jom)\right)\right\} + \mathfrak{F}^{-1}\left\{\log\left(H(\jom)\right)\right\} \\
\pause
} \hat{c}_x(i_{\mathrm{s}}(n)\ldots i_{\mathrm{e}}(n)) &=& \sum\limits_{k=0}^{\nicefrac{\mathcal{K}}{2}-1}{\log\left(|X(k,n)|\right)\e^{\mathrm{j}ki\Delta\Omega}}
\end{eqnarray*}
\end{footnotesize}
\only<4->{\vspace{-3mm}
\figwithmatlab{F0Cepstrum}
}
\end{frame}
\begin{frame}{fundamentals}{cepstrum 3/3}
\begin{itemize}
\item \textbf{summary}:
\begin{itemize}
\item cepstrum 'replaces' time domain convolution operation with addition
\item result is the \textit{unfiltered} excitation signal \textit{plus} the filter IR (both logarithmic)
\item can be used for, e.g., \textit{spectral envelope extraction} or \textit{pitch detection}
\bigskip
\item<2> more naming silliness:\\
cepstrum, quefrency, liftering, \ldots
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{spectral shape features}{mel frequency cepstral coefficients 1/4}
\begin{itemize}
\item typical processing steps for the mel frequency cepstral coefficients (MFCCs):
\begin{enumerate}
\item compute magnitude spectrum
\item convert linear frequency scale to logarithmic
\item group bins into bands
\item apply logarithm to all bands
\item compute (inverse) cosine transform (DCT)
\end{enumerate}
\end{itemize}
\bigskip
\begin{equation*}
v^j_{\mathrm{MFCC}}(n) = \sum\limits_{k' = 1}^{\mathcal{K}'}{\log\big( |X'(k',n)|\big)\cdot \cos\left( j\cdot\left(k'-\frac{1}{2} \right)\frac{\pi}{\mathcal{K}'} \right)}
\end{equation*}
\end{frame}
\begin{frame}{spectral shape features}{mel frequency cepstral coefficients 2/4}
\figwithmatlab{MfccFilterbank}
\begin{itemize}
\item constant Q filter spacing for higher frequencies (mel scale)
\item FFT values are weighted and summed over bins for each band
\end{itemize}
\end{frame}
\begin{frame}{spectral shape features}{mel frequency cepstral coefficients 3/4}
\begin{columns}
\column{.6\linewidth}
mel-warped cosine bases for DCT
\column{.4\linewidth}
\vspace{-11mm}
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{MfccMelDct}
\label{fig:MfccMelDct}
\end{figure}
\end{columns}
\end{frame}
\begin{frame}{spectral shape features}{mel frequency cepstral coefficients 4/4}
\vspace{-6mm}
\begin{footnotesize}
\begin{table}
\centering
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc}%{l|c|c|c} %{c|p{12mm}p{12mm}p{12mm}p{12mm}p{12mm}p{12mm}p{12mm}}
\\ \hline
\bf{\emph{Property}} & \bf{\emph{DM}} & \bf{\emph{HTK}} & \bf{\emph{SAT}}\\
\hline
\bf{Num.\ filters} & 20 & 24 & 40\\
\bf{Mel scale} & lin/log & log & lin/log\\
\bf{Freq.\ range} & $[100; 4000]$ & $[100; 4000]$ & $[200; 6400]$\\
\bf{Normalization} & Equal height & Equal height & Equal area\\
\end{tabular*}
\end{table}
\end{footnotesize}
\vspace{-5mm}
\figwithref{FeatureSpectralMfccs}{matlab source: \href{https://github.com/alexanderlerch/ACA-Plots/blob/master/matlab/plotFeatures.m}{plotFeatures.m}}
\end{frame}
\section[tonalness]{tonalness features}
\begin{frame}{tonalness features}{spectral crest factor}
\listspectralfeature{CrestFactor}{\begin{itemize} \item normalization \item power spectrum \item measure \textit{per band} instead of whole spectrum \end{itemize}}
\end{frame}
\begin{frame}{tonalness features}{spectral flatness}
\listspectralfeature{Flatness}{\begin{itemize} \item power vs.\ magnitude spectrum \item smoothed spectrum (avoid spurious 0-bins) \item measure \textit{per band} instead of whole spectrum \end{itemize}}
\end{frame}
\begin{frame}{tonalness features}{spectral tonal power ratio}
\listspectralfeature{TonalPowerRatio}{\begin{itemize} \item definition of tonal/non-tonal components \begin{itemize}\item local maxima\item peak salience\item in periodic (harmonic) pattern \item \ldots\end{itemize}\end{itemize}}
\end{frame}
\begin{frame}{tonalness features}{maximum of ACF}
\vspace{-6mm}
\begin{equation*}
\input{eq/Llf_MaxAcf}
\end{equation*}
{\flushright\includeaudio{sax_example}}
\vspace{-9mm}
\inserticon{audio}
\figwithref{FeatureTimeMaxAcf}{matlab source: \href{https://github.com/alexanderlerch/ACA-Plots/blob/master/matlab/plotFeatures.m}{matlab/displayFeatures.m}}
\end{frame}
%\begin{frame}{tonalness features}{maximum of ACF 2/2}
%\question{maximum detection: how to avoid main lobe maxima?}
%
%\begin{itemize}
%\item minimum lag
%\item magnitude threshold
%\item search only after first local minimum
%\end{itemize}
%\end{frame}
%Predictivity Ratio
%SpectralPredictivity
\section[technical]{technical properties}
\begin{frame}{technical features}{zero crossing rate}
\vspace{-6mm}
\begin{equation*}\label{eq:zc}
\input{eq/Llf_ZeroCrossingRate}
\end{equation*}
{\flushright\includeaudio{sax_example}}
\vspace{-9mm}
\inserticon{audio}
\figwithref{FeatureTimeZeroCrossingRate}{matlab source: \href{https://github.com/alexanderlerch/ACA-Plots/blob/master/matlab/plotFeatures.m}{matlab/displayFeatures.m}}
\end{frame}
\begin{frame}{technical features}{ACF coefficients}
\vspace{-6mm}
\begin{equation*}
\input{eq/Llf_AcfC} \quad \text{with}\enspace \eta = 1,2,3,\ldots
\end{equation*}
{\flushright\includeaudio{sax_example}}
\vspace{-9mm}
\inserticon{audio}
\figwithref{FeatureTimeAcfCoeff}{matlab source: \href{https://github.com/alexanderlerch/ACA-Plots/blob/master/matlab/plotFeatures.m}{matlab/displayFeatures.m}}
\end{frame}
\section{summary}
\begin{frame}{summary}{lecture content}
\vspace{-3mm}
\begin{itemize}
\item \textbf{feature}
\begin{itemize}
\item descriptor with condensed relevant information
\item not necessarily interpretable by humans
\end{itemize}
\bigskip
\item \textbf{feature extraction}
\begin{itemize}
\item usually extracted per short block of samples
\item many features can be extracted from audio data, resulting in feature matrix
\end{itemize}
\bigskip
\item \textbf{timbre}
\begin{itemize}
\item mostly dependent on both spectral shape and time domain envelope characteristics
\item multi-dimensional perceptual property not as clearly defined as pitch or loudness
\end{itemize}
\bigskip
\item \textbf{instantaneous spectral shape features}
\begin{itemize}
\item established set of baseline features
\item often extracted from the magnitude spectrum, describing timbre
\item condensing various properties of the spectral shape into single values
\item there exist multiple variants of ``the same'' feature
\end{itemize}
\end{itemize}
\inserticon{summary}
\end{frame}
\end{document}