Initial import.
[Faustine.git] / dsp_files / make_init-mdoc / tex / make_init.tex
1 %% This documentation was generated with Faust version 0.9.58
2 %% Thu Jun 13 10:45:16 2013
3 %% http://faust.grame.fr
4
5 \documentclass{article}
6
7 \usepackage[utf8]{inputenc}
8 \usepackage{graphicx}
9 \usepackage[usenames]{color}
10 \usepackage{listings}
11 \usepackage{supertabular}
12 \usepackage{amsmath}
13 \usepackage{latexsym, amssymb}
14 \usepackage{breqn}
15
16 % No indent
17 \setlength{\parindent}{0pt}
18
19 % Make LaTeX output a dot when typing an asterisk
20 \DeclareMathSymbol{*}{\mathbin}{symbols}{"01}
21
22 % lstlistings setup
23 \definecolor{yobg}{rgb}{0.9,0.9,1}
24 \definecolor{yotxt}{rgb}{0.01,0.01,0.52} % a dark blue.
25 \definecolor{mylstbg}{rgb}{0.98,0.98,0.98} % a really pale grey.
26 \definecolor{mylstcmt}{rgb}{0.01,0.52,0.01} % a dark green.
27 \definecolor{mylstdoc}{rgb}{0.80,0.30,0.80} % a medium pink.
28
29 \lstset{%
30 language=C++,
31 numbers=left,%none,
32 tabsize=4,
33 frame=single,
34 breaklines=true,
35 numberstyle=\tiny\ttfamily,
36 backgroundcolor=\color{mylstbg},
37 basicstyle=\scriptsize\ttfamily,
38 commentstyle=\slshape\color{mylstcmt}, %\itshape,
39 frameround=tttt,
40 columns=flexible, %fixed,
41 showstringspaces=false,
42 emptylines=2,
43 inputencoding=utf8,
44 extendedchars=true,
45 literate= {á}{{\'a}}1
46 {à}{{\`a}}1
47 {ä}{{\"a}}1
48 {â}{{\^a}}1
49 {é}{{\'e}}1
50 {è}{{\`e}}1
51 {ë}{{\"e}}1
52 {ê}{{\^e}}1
53 {ï}{{\"i}}1
54 {î}{{\^i}}1
55 {ö}{{\"o}}1
56 {ô}{{\^o}}1
57 {è}{{\`e}}1
58 {ù}{{\`u}}1
59 {û}{{\^u}}1
60 {ç}{{\c{c}}}1
61 {Ç}{{\c{C}}}1,
62 emph={component, declare, environment, import, library, process},
63 emph={[2]ffunction, fconstant, fvariable},
64 emph={[3]button, checkbox, vslider, hslider, nentry, vgroup, hgroup, tgroup, vbargraph, hbargraph, attach},
65 emphstyle=\color{yotxt}, %\underline, %\bfseries,
66 morecomment=[s][\color{mylstdoc}]{<mdoc>}{</mdoc>},
67 rulecolor=\color{black}
68 }
69
70 \newcommand{\faustfilename}{/home/wang/Documents/OcamlProjects/interpreter/interpreter11/dsp_files/make_init.dsp}
71 \newcommand{\faustdocdir}{make_init-mdoc}
72 \newcommand{\faustprogname}{make_init}
73 \newcommand{\faustversion}{0.9.58}
74 \newcommand{\faustdocdate}{June 13, 2013}
75
76 \begin{document}
77 \title{make_init}
78 \date{\today}
79 \maketitle
80
81 \bigskip
82 This document provides a mathematical description of the Faust program text stored in the \texttt{\faustfilename} file. See the notice in Section\,\ref{notice} (page\,\pageref{notice}) for details.
83
84
85 \section{Mathematical definition of \texttt{process}}
86 \label{equation}
87
88 The \emph{\faustprogname} program evaluates the signal transformer denoted by \texttt{process}, which is mathematically defined as follows:
89
90 % Set of Faust formulas (corresponding to an <equation> tag).
91 \begin{enumerate}
92
93 \item Output signal $y$ such that
94 \begin{dgroup*}
95 \begin{dmath*}
96 y(t) = r_{1}(t)
97 \end{dmath*}
98 \end{dgroup*}
99
100 \item Input signal (none)
101
102 \item Intermediate signals $r_i$ for $i \in [1,2]$, $q_1$ and $m_1$ such that
103 \begin{dgroup*}
104 \begin{dmath*}
105 r_{2}(t) = 1
106 \end{dmath*}
107 \begin{dmath*}
108 r_{1}(t) = 2.000001 + q_{1}(t)
109 \end{dmath*}
110 \end{dgroup*}
111
112 \begin{displaymath}
113 q_{1}(t) =
114 \left\{\begin{array}{ll}
115 2 & \mbox{if \,} \mathrm{int}\left(m_{1}(t)\right) = 0\\
116 r_{1}(t\!-\!1) & \mbox{if \,} \mathrm{int}\left(m_{1}(t)\right) = 1
117 \end{array}\right.
118 \end{displaymath}
119
120 \begin{displaymath}
121 m_{1}(t) =
122 \left\{\begin{array}{ll}
123 0 & \mbox{, when \,} t = 0\\
124 r_{2}(t\!-\!1) & \mbox{, when \,} t > 0
125 \end{array}\right.
126 \end{displaymath}
127
128 \end{enumerate}
129
130
131 \section{Block diagram of \texttt{process}}
132 \label{diagram}
133
134 The block diagram of \texttt{process} is shown on Figure\,\ref{figure1} (page\,\pageref{figure1}).
135 \begin{figure}[ht!]
136 \centering
137 \includegraphics[width=\textwidth]{../svg/svg-01/process}
138 \caption{Block diagram of \texttt{process}}
139 \label{figure1}
140 \end{figure}
141
142
143 \section{Notice}
144 \label{notice}
145
146
147 \begin{itemize}
148 \item This document was generated using Faust version \faustversion\ on \faustdocdate.
149 \item The value of a Faust program is the result of applying the signal transformer denoted by the expression to which the \texttt{process} identifier is bound to input signals, running at the $f_S$ sampling frequency.
150 \item Faust (\emph{Functional Audio Stream}) is a functional programming language designed for synchronous real-time signal processing and synthesis applications. A Faust program is a set of bindings of identifiers to expressions that denote signal transformers. A signal $s$ in $S$ is a function mapping\footnote{Faust assumes that $\forall \, s \in S, \forall \, t \in \mathbb{Z}, s(t) = 0 \mathrm{\ when\ } t < 0$.} times $t \in \mathbb{Z}$ to values $s(t) \in \mathbb{R}$, while a signal transformer is a function from $S^n$ to $S^m$, where $n,m\in \mathbb{N}$. See the Faust manual for additional information (\textsf{http://faust.grame.fr}).
151 \item Every mathematical formula derived from a Faust expression is assumed, in this document, to having been normalized (in an implementation-depen\-dent manner) by the Faust compiler.
152 \item A block diagram is a graphical representation of the Faust binding of an identifier I to an expression E; each graph is put in a box labeled by I. Subexpressions of E are recursively displayed as long as the whole picture fits in one page.
153 \item $\forall \, x \in \mathbb{R}$,
154 \begin{displaymath}
155 \mathrm{int}(x) =
156 \left\{\begin{array}{cl}
157 \lfloor x \rfloor & \mbox{if \,} x > 0 \\
158 \lceil x \rceil & \mbox{if \,} x < 0 \\
159 0 & \mbox{if \,} x = 0 \\
160 \end{array}\right..
161 \end{displaymath}
162 \item The \texttt{\faustdocdir/} directory may also include the following subdirectories:
163 \begin{itemize}
164 \item \texttt{cpp/} for Faust compiled code;
165 \item \texttt{pdf/} which contains this document;
166 \item \texttt{src/} for all Faust sources used (even libraries);
167 \item \texttt{svg/} for block diagrams, encoded using the Scalable Vector Graphics format (\textsf{http://www.w3.org/Graphics/SVG/});
168 \item \texttt{tex/} for the \LaTeX\ source of this document.
169 \end{itemize}
170 \end{itemize}
171
172
173 \section{Faust code listing}
174 \label{listing}
175
176 This section provides the listing of the Faust code used to generate this document.
177
178 \bigskip\bigskip
179 \begin{lstlisting}[caption=\texttt{make_init.dsp}]
180 rec(a, b, i) = a ~ (i : b);
181
182 vect0 = case {
183 ((y, z)) => vect0(y) : vect0(z);
184 (y) => _ , y : +;
185 };
186
187 init_value = case {
188 ((x,y)) => init_value(x) : vect0(y);
189 (0) => 0;
190 (x) => 0 : vect0(x);
191 };
192
193 make_init(x) = (0, 1 : prefix), init_value(x), _ : select2;
194
195 A = +;
196 B = _;
197 //B = serialize : _, 2 : vectorize;
198 I = make_init((2));
199
200 //process = _,_ : > ;
201
202 //process = (0.000001, 2 : +) : rec(A,B,I);
203
204 process = 0.0000010000000000,2:+:+~((0,1:prefix),(0:_,2:+),_:select2:_);
205 \end{lstlisting}
206
207
208 \end{document}
209