Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
adud
rapportstagem2
Commits
a5e5f630
Commit
a5e5f630
authored
Jun 18, 2021
by
Antonin Dudermel
Browse files
small typos
parent
8c789ab2
Changes
2
Hide whitespace changes
Inline
Sidebyside
report/intro.tex
View file @
a5e5f630
...
...
@@ 18,20 +18,22 @@ samples). Given a sampling frequency \(\fq\), sound processing manipulates
discretized sound signals living in
\(
\Real
^
\Rel
\)
, denoted
\(
s
(
t
)
\)
in this
report. The mathematical abstraction that manipulates signals is called
\emph
{
processor
}
. In sound processing, it is a function
\(
f:
(
\Real
^
\Rel
)
^
p
\to
(
\Real
^
\Rel
)
^
q
\)
that takes input signals
\(
f:
\left
(
\Real
^
\Rel
\right
)
^
p
\to
\left
(
\Real
^
\Rel
\right
)
^
q
\)
that takes input signals
\(
x
_
i
(
t
)
, i < p
\)
and outputs signals
\(
y
_
0
(
t
)
,
\dots
y
_{
q

1
}
(
t
=
f
(
x
_
0
(
t
)
,
\dots
x
_{
p

1
}
(
t
)))
\)
. As convention,
\(
y
_
0
(
t
)
,
\dots
y
_{
q

1
}
(
t
)
=
f
(
x
_
0
(
t
)
,
\dots
x
_{
p

1
}
(
t
)))
\)
. As convention,
\(
x
(
t
)
\)
will be used for input signals and
\(
y
(
t
)
\)
for output
signals.
\footnote
{
All notations are gathered in the appendix
\ref
{
sec:notations
}}
\flushleft
\begin{flushleft}
\begin{minipage}
{
.48
\linewidth
}
\subsection
{
The Faust Programming Language
}
\end{minipage}
\hspace
{
\stretch
{
1
}}
\begin{minipage}
{
.2
\linewidth
}
\includegraphics
[scale=0.5]
{
../pictures/LOGO
_
FAUST
_
COMPLET
_
BLEU.png
}
\end{minipage}
\\
\end{flushleft}
Faust
\cite
{
faustprogramming
}
(Functional Audio Stream) is a compiled
domainspecific language describing sound processors. Being purely functional,
it does not manipulates samples as values in arrays, but works at high level on
...
...
@@ 40,7 +42,7 @@ with simple primitives (such as \lstinline{+, *, sin}\dots) that are patched
together using a blockdiagram algebra (
\lstinline
{
:
}
for composition,
\lstinline
{
,
}
for parallel evaluation
\dots
). The example on
\figref
{
fig:plussimple
}
describes a simple stereotomono converter. The two
input
s
signals are added (primitive
\lstinline
{
+
}
), then the sum is divided by 2
input signals are added (primitive
\lstinline
{
+
}
), then the sum is divided by 2
(written
\lstinline
{
/(2)
}
in Faust). These two basic processors are composed
with a
\lstinline
{
:
}
. Figure
\ref
{
fig:plussimple
}
also shows a graphical
representation (made by the compiler) of the signal processor described by the
...
...
@@ 88,7 +90,6 @@ C++/Rust/D/WebAssembly/LLVM\dots code implementing this formula.
% \lstinputlisting{../code/rewsumlessgolf.dsp}\lstinputlisting{../code/rewsumalt.dsp}}
% {shared addition}{0.48}{../code/rewsumlessgolfblock.png}
% {unshared one}{0.48}{../code/rewsumaltblock.png}
A very important constructor in Faust blockdiagram algebra is
\lstinline
{
~
}
. It
allows to recursively define a signal
\(
s
(
t
)
\)
using the signal
\(
s
(
t

1
)
\)
\ie
{}
\(
s
(
t
)
\)
delayed by one sample. If we want to implement the ramp signal
...
...
@@ 104,7 +105,7 @@ which can be written in Faust as shown in \figref{fig:ramp}.
{\(
s
(
t
)
=
1
+
s
(
t

1
)
\)}{
../code/ramp.dsp
}
This constructor is very important for Faust expressiveness but it is at the
source of many problems, as it creates loops in the signal graph.
source of many problems, as it creates loops in the signal graph.
\\
\subsection
{
The FAST
\cite
{
fastproject
}
Project: Faust on FPGA
}
\label
{
sec:fastproject
}
...
...
@@ 135,7 +136,7 @@ dedicated to audio processing, for instance in an active noise cancellation
headphone, samples are processed one after the other, which leads to latency
within
\(
\SI
{
10
}{
\micro\second
}\)
. This has however an obvious
drawback. Computers are generalpurpose machines, whereas ASICs are
applicationspecific circuit, and circuit are not reprogrammable and very costly
applicationspecific circuit
s
, and circuit
s
are not reprogrammable and very costly
to produce. A tradeoff between those two worlds can be found in
FieldProgrammable Gate Arrays (FPGA). An FPGA is an integrated circuit designed
to emulate arbitrary digital circuits using a circuit description written in
...
...
@@ 167,7 +168,7 @@ applications, such as live artificial reverberation or active noise control.
\label
{
sec:floatingpointvs
}
As stated above, a Faust program represent processors
\ie
{}
sequences of Real
As stated above, a Faust program represent processors
\ie
sequences of Real
numbers. Yet the compiler must output C++ code for which there are no Real
numbers representation, so it has to use an approximation of the reals, for
instance the floatingpoint numbers.
...
...
@@ 175,36 +176,36 @@ instance the floatingpoint numbers.
Since their standardisation in 1985
\cite
{
2019ieee7542019
}
the floatingpoint
formats have become the most frequent arithmetic formats for representing reals
in computer programs
\cite
{
goldberg1991whatevery
}
. Roughly speaking, a
floatingpoint number is a pair
\(
M, E
\)
called mantissa and exponent
,
floatingpoint number is a pair
\(
(
M, E
)
\)
called mantissa and exponent
representing the number
\(
M
\times
2
^
E
\)
. Floatingpoint numbers are indeed a
wonderful tool for computer arithmetic. They are not only a versatile and
wellstructured way of representing the real numbers but also a way to do

albei
t from a few elementary rules
whose infringement can be
catastrophic
\cite
{
muller2010handbookfloatingpoint
}
 very quick and dirty
brainless DoWhatIMean arithmetic, allowing the programmer to focus on
something else and thus devising more
complex programs. This has however a cost
: on many specific cases, the result
of the floatingpoint computation is either
embarrassingly
overaccurate
\footnote
{
24 bits are used in highquality audio in
DVD and
BlueRays, where 16 bits are sufficient for Compact Discs.
}
(even with
a dirty
implementation) or mostly scrambled (either by using inaccurate inputs
ore due
to approximation errors) and then the machine spent precious time and
energy
computing noise.
There are nonetheless other formats
for representing numbers that were used
before floatingpoi
nt numbers
: the fixedpoint numbers. The idea is the same as
wellstructured way of representing the real numbers but also a way to do
very
quick brainless DoWhatIMean arithmetic (excep
t from a few elementary rules
whose infringement can be
catastrophic
\cite
{
muller2010handbookfloatingpoint
}
),
allowing the programmer to focus on something else and thus devising more
complex programs. This has however a cost
: on many specific cases, the result
of the floatingpoint computation is either
embarrassingly
overaccurate
\footnote
{
24 bits are used in highquality audio in
DVD and
BlueRays, where 16 bits are sufficient for Compact Discs.
}
(even with
a dirty
implementation) or mostly scrambled (either by using inaccurate inputs
ore due
to approximation errors) and then the machine spent precious time and
energy
computing noise.
There are nonetheless other formats
that were used before floatingpoint to
represe
nt numbers: the fixedpoint numbers. The idea is the same as
floatingpoint numbers, but the exponent is no more part of the representation
but rather hardcoded in the program. The main advantage is that fixedpoint
numbers in the same format behave almost exactly like integers. They require
therefore less resources (time, power, silicon) than floats. However,
fixedpoint
numbers being far less versatile than floats, the programmer often
have multiple
fixedpoint formats in the same program, and must handle by hand
in software the
conversion between multiple formats. This makes the code harder
to read. The
user must also be cautions when choosing a format, as it can result
to
overaccurate useless computations, completely scrambled values (just like in
therefore less resources (time, power, silicon) than floats. However,
fixedpoint
numbers being far less versatile than floats, the programmer often
have multiple
fixedpoint formats in the same program, and must handle by hand
in software the
conversion between multiple formats. This makes the code harder
to read. The
user must also be cautions when choosing a format, as it can result
to
overaccurate useless computations, completely scrambled values (just like in
floats), or overflows (just like ints).
Besides, from the hardware point of view, there is often no other choice but
using a versatile format
: the CPU designer does not know in advance what kind
using a versatile format: the CPU designer does not know in advance what kind
of program will be executed on its architecture, and it is unthinkable to design
one operator per fixedpoint format, mainly because there is an infinite number
of them and because of silicon scarcity on the chip. This is yet not a problem
...
...
@@ 212,7 +213,7 @@ on an FPGA: behaving mostly as a reprogrammable circuit, one can afford to
implement very specific operators on very specific formats (e.g. a division by 3
taking as an input an unsigned int over 5 bits and outputting a fixedpoint
number an unit in last position (ulp) of
\(
2
^{

8
}\)
\cite
{
ugurdag2017hardwaredivision
}
) without the risk of silicon waste
: if
\cite
{
ugurdag2017hardwaredivision
}
) without the risk of silicon waste: if
another very specific arithmetic operator is needed for another very specific
application, the FPGA can be reprogrammed for this task.
...
...
@@ 272,7 +273,7 @@ equation becomes
\end{figure}
The range is now
\(
\left
[
2
^
\msb
,
2
^
\msb

2
^{
\lsb
}
\right
]
\)
, but the smallest
representable number (and then the smallest difference
\ie
{}
the ulp) remains
representable number (and then the smallest difference
\ie
the ulp) remains
\(
2
^{
\lsb
}\)
in absolute value. Very common signed fixedpoint formats are
\(
\sfix
(
0
,
16
)
\)
and
\(
\sfix
(
0
,
24
)
\)
. They are used by AnalogtoDigital and
DigitaltoAnalog Converters (ADC and DAC) as they represent numbers between 1
...
...
report/report.tex
View file @
a5e5f630
...
...
@@ 3,12 +3,12 @@
\usepackage
{
geometry
}
\geometry
{
left=20mm,right=20mm,top=10mm
}
\geometry
{
left=20mm,right=20mm,top=10mm, bottom=8mm, heightrounded,
includefoot
}
\usepackage
[english]
{
babel
}
\usepackage
[T1]
{
fontenc
}
\usepackage
[utf8]
{
inputenc
}
%\usepackage{xcolor}
\usepackage
{
algorithm
}
...
...
@@ 17,9 +17,11 @@
\lstset
{
language=c,
basicstyle=
\ttfamily
,
%linewidth=.5\textwidth,
%numbers=left,
%numberstyle=\small
literate=
{
~
}{{
\raisebox
{
.25em
}{
\textasciitilde
}}}{
1
}
% literate={~}{\char `~}{0},
% linewidth=.5\textwidth,
% numbers=left,
% numberstyle=\small
}
...
...
@@ 106,7 +108,7 @@
% \renewcommand{\processdelayedfloats}{}
% \renewcommand{\doublefig}[9][]{}
\newcommand
{
\ie
}{
\emph
{
i.e.
}}
\newcommand
{
\ie
}{
\emph
{
i.e.
\
}}
\DeclareMathOperator
{
\sfix
}{
sfix
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment