Distribution of $e$ if $g=\tilde{g}+e$, $g=|f|$, $f \sim \mathcal{N}(0,1)$ and $\tilde{g}$ is the quantization of $g$ Let $f \sim \mathcal{N}(0,1)$ be a normal random variable with zero mean and unit variance.  Let $g=|f|$.
Let $\tilde{g}$ be the quantization of $g$. We suppose that there are $n$ possible levels of $\tilde{g}$, denoted as: $\tilde{g}_1, \ldots, \tilde{g}_n$. These levels are fixed beforehand.
The quantization is performed as the following: if $\tilde{g}_{i} \le g < \tilde{g}_{i+1}$, then the quantized level of $g$ is $\tilde{g}_{i}$. Note that if $g \ge \tilde{g}_{n}$, the quantization is $\tilde{g}_{n}$, and if $g < \tilde{g}_{1}$, then the quantization level is $0$.
We can represent $g$ as $g=\tilde{g}+e$, where $e$ can be seen as the quantization error.
My question: what is the distribution of $e$ in this case ?  
 A: The density of $g$ is indeed $2\phi(x)1(x\geqslant 0)$. Let us agree that $\tilde{g}_0=0$ and that $\tilde{g}_{n+1}=+\infty$. The density of $e$ can then simply be obtained by the law of total probability. For $y\geqslant 0$:
\begin{align*}
 f_e(y)dy & = \text{Prob}[y\leqslant e<y+dy]\\
  & = \sum_{i=0}^n \text{Prob}[y\leqslant e <y+dy, \tilde{g}_i\leqslant g < \tilde{g}_{i+1}]\\
  & = \sum_{i=0}^n \text{Prob}[\tilde{g}_{i} + y \leqslant g < \tilde{g}_{i} +y+dy] \ 1(0\leqslant y < \tilde{g}_{i+1} - \tilde{g}_i)\\
  & = \sum_{i=0}^n 2\phi(\tilde{g}_{i} + y) dy \ 1(0\leqslant y < \tilde{g}_{i+1} - \tilde{g}_i)\,.\\
\end{align*}
So,
$$
  f_e(y) = \sum_{i=0}^n 2\phi(\tilde{g}_{i} + y) \ 1(0\leqslant y < \tilde{g}_{i+1} - \tilde{g}_i)\,.
$$
A: So e is the difference of two (dependent) random variables, meaning $f_E(e) = \int_{-\infty}^{\infty} f_{G \tilde{G}}(g, g - e) dg $. The distribution of g is simply $2 \phi(x) \mathbb{1}(x > 0) $ where $\phi$ is the standard normal p.d.f. It gets a little more complicated from there, especially as $g$ and $\tilde{g}$ are dependent, but I figured I'd get it started.
