-
Notifications
You must be signed in to change notification settings - Fork 0
/
Walter Smuts - Pitch Correction of Digital Audio.tex
393 lines (325 loc) · 9.98 KB
/
Walter Smuts - Pitch Correction of Digital Audio.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
\documentclass[12pt]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PACKAGES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{color}
% REMEMBER TO ADD OFFSET FOR BINDING!!!!
\usepackage[a4paper,width=170mm,top=25mm,bottom=25mm,bindingoffset=0.4cm]{geometry}
\usepackage{fancyhdr}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{changepage}
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage{ifthen}
\usepackage{etoolbox}
\usepackage{wrapfig}
\usepackage{musicography}
\usepackage{graphbox}
\usepackage{tabu}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xfrac}
\usepackage[english]{babel}
\usepackage{listings}
\usepackage[T1]{fontenc}
\usepackage[multiple]{footmisc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPECIFIC INFO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Pitch Correction}
\author{Walter Smuts}
\newcounter{quoteCounter}
\setcounter{quoteCounter}{1}
\newcommand\addQuote{
\begin{center}
\ifnum\thequoteCounter=1
In the beginning the Universe was created.\\
This has made a lot of people very angry and has\\
been widely regarded as a bad move.\\
\vspace{1cm}
- Douglas Adams
\fi
\ifnum\thequoteCounter=2
Always remember that you are absolutely unique.\\
Just like everyone else.\\
\vspace{1cm}
- Margaret Mead
\fi
\ifnum\thequoteCounter=3
Talking about music\\
is like dancing about architecture.\\
\vspace{1cm}
— Steve Martin
\fi
\ifnum\thequoteCounter=4
Wagner’s music is better than it sounds.\\
\vspace{1cm}
— Mark Twain
\fi
\ifnum\thequoteCounter=5
A gentleman is someone who can\\
play the accordion,
but doesn't.\\
\vspace{1cm}
— Tom Waits
\fi
\ifnum\thequoteCounter=6
I'd agree with you, but then\\
we'd both be wrong.\\
\vspace{1cm}
- Russell Lynes
\fi
\stepcounter{quoteCounter}
\ifnum\thequoteCounter=7
\setcounter{quoteCounter}{1}
\fi
\end{center}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Listing Matlab Style %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\octavelisting}[1]{
\begin{center}
\begin{minipage}[c]{\textwidth}
\lstinputlisting[language=Octave, caption=#1.m , label={lst:#1}]{octaveSnips/#1.m}
\end{minipage}
\end{center}
}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codedarkgray}{rgb}{0.2,0.2,0.2}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{codeorange}{rgb}{1.0,0.49,0.0}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{octave}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{codeorange},
numberstyle=\bf\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\footnotesize\fontfamily{fvm}\selectfont,
breakatwhitespace=false,
identifierstyle=\color{codedarkgray},
breaklines=true,
captionpos=b,
keepspaces=true,
frame=single,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=octave}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION HEADING STYLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chapter style
\titleformat{\chapter}
{\normalfont \LARGE \bfseries}
{}
{0em}
{\MakeUppercase}
[\titlerule \ifthenelse{\equal{\thechapter}{0}}{}{ \small\it \chaptertitlename \space \thechapter}]
% Chapter spacing
\titlespacing*{\chapter}
{0pt}
{15pt}
{25pt}
\patchcmd{\thebibliography}{\chapter*{\bibname}}
{\cleardoublepage\MakeUppercase
{\vspace*{1cm}\hspace{-7mm} \normalfont \LARGE \bfseries References}
\vspace{2.5mm}
\titlerule\thispagestyle{plain}
}
{}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PAGE STYLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page layout
\pagestyle{fancy}
% Front page offset
\makeatletter
\if@twoside
\newcommand{\frontpageoffset}{-1.5cm}
\else
\newcommand{\frontpageoffset}{0cm}
\fi
\makeatother
% Offset to force numbers to margins
\newcommand{\numberoffset}{\hspace{-1cm}}
% Assuming odd pages are right and even are left pages
% Chapter Pages
\fancypagestyle{plain}{
\fancyhead{}
\makeatletter
\if@twoside
\fancyhf{}
\fancyfoot[LE,RO]{\thepage\numberoffset}
\fi
\makeatother
\renewcommand{\headrulewidth}{0pt}
}
% Redefine clear double page to leave an empty page
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\begin{center}
\it \addQuote
\end{center}
\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%% PAGE HEADERS AND FOOTERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% General Header
\fancyhead{}
\fancyhead[LE,RO]{\nouppercase\leftmark}
\fancyhead[LO,RE]{\TITLE}
% General Footer
\fancyfoot{}
\makeatletter
\if@twoside
\fancyfoot[LE]{\numberoffset\thepage}
\fancyfoot[RO]{\thepage\numberoffset}
\else
\fancyfoot[C]{\thepage}
\fi
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% START OF DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Save title
\makeatletter
\let\TITLE\@title
\makeatother
% First page
\begin{titlepage}
\begin{adjustwidth*}{}{\frontpageoffset} % For centering front page
\begin{center}
\vspace*{4cm}
{\Huge\textbf\thetitle}
{\it of digital audio}
\vspace{0.8cm}
\includegraphics[width=0.4\textwidth]{UCT.jpg}
\vspace{0.8cm}
by \theauthor
\vspace{0.8cm}
Prepared for Associate Professor Fred Nicolls\\
Department of Electrical Engineering\\
University of Cape Town\\
South Africa\\
\vspace{2cm}
\today
\end{center}
\end{adjustwidth*}
\end{titlepage}
\cleardoublepage
% Reset page numbering and use roman numerals
\pagenumbering{roman}
\setcounter{page}{1}
\null
\vfill
\section*{\center Abstract}
\thispagestyle{plain}
This thesis investigates the design, implementation and testing of a pitch
correction system in the context of digital audio. A modular design is proposed
which contains a frequency detection module and a frequency scaling module.
Testing metrics are designed to evaluate the performance of the system as a whole
as well as individual modules separately. The algorithms implemented and tested
for the frequency detection module are the zero-crossing method and
autocorrelation method. For the frequency scaling module a simple overlap and add
method was tested a swell as the phase vocoder approach. The combination that
produces the best results is the phase vocoder and zero crossing method
combination. This approach achieves a pitch improvement factor of 4.38 and a
similarity of 44\% to the original signal.
\vfill
\vfill
\newpage
\null
\vfill
\section*{\center Declaration}
\thispagestyle{plain}
I declare that:
\vspace{3mm}
\hrule
\begin{enumerate}
\item
I know that plagiarism is wrong. Plagiarism is to use another’s work and
pretend that it is one’s own.
\item
I have used the IEEE convention for citation and referencing. Each contribution
to, and quotation in, this report from the work(s) of other people has been
attributed, and has been cited and referenced.
\item
This report is my own work.
\item
I have not allowed, and will not allow, anyone to copy my work with the
intention of passing it off as his or her own work.
\end{enumerate}
\begin{tabular}{ l l }
Name: & Walter Smuts\\
Date: & \today
\end{tabular}
\vspace{3mm}
\hrule
\vspace{3mm}
\includegraphics[width=2cm]{Signature.png}
\par {\it Signature}
\vfill
\vfill
{\small\tableofcontents}
\thispagestyle{plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% START OF CHAPTERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Introduction}
% Reset page numbering and to Arabic numbers
\setcounter{page}{1}
\pagenumbering{arabic}
\input{Chapters/Introduction}
\chapter{Literature Review}
\input{Chapters/Literature-Review}
\chapter{Implementation}
\input{Chapters/Implementation}
\chapter{Results}
\input{Chapters/Results}
\chapter{Conclusions}
\input{Chapters/Conclusions}
{\footnotesize\bibliography{references}{}}
\bibliographystyle{ieeetr}
\addcontentsline{toc}{chapter}{References}
\chapter*{Appendix}
\setcounter{section}{0}
\renewcommand\thesection{\Alph{section})}
\addcontentsline{toc}{chapter}{Appendix}
\pagestyle{plain}
\section{Imperfect Tuning System Proof}
\input{Chapters/Imperfect-Tuning-System-Proof}
\newpage
\section{Full AutoTalent Flow Diagram}
\vfill
\includegraphics[width=\textwidth, trim={20cm 1cm 20cm 3.5cm},clip]
{AutoTalentFlowDiagram}
\vfill
\newpage
\section{Simple Overlap and Add Octave Code}
All the code for the whole system is available on
GitHub\footnote{\url{https://github.com/WalterSmuts/Pitch-Correction-Octave-Scripts}}
\octavelisting{getScaledSampleOLA}
\octavelisting{getSamplePointsOLA}
\octavelisting{getSegmentedSample}
\octavelisting{overlapAndAdd}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END OF DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%