diff --git a/notes/sections/6.md b/notes/sections/6.md index db2337b..351627f 100644 --- a/notes/sections/6.md +++ b/notes/sections/6.md @@ -4,7 +4,7 @@ The diffraction of a plane wave thorough a round slit must be simulated by generating $N =$ 50'000 points according to the intensity distribution -$I(\theta)$ on a screen at a great distance $L$ from the slit iself: +$I(\theta)$ on a screen at a great distance $L$ from the slit itself: $$ I(\theta) = \frac{E^2}{2} \left( \frac{2 \pi a^2 \cos{\theta}}{L} @@ -21,7 +21,7 @@ where: - $L$ default set $L = \SI{1}{m}$. \begin{figure} -\hypertarget{fig:fenditure}{% +\hypertarget{fig:slit}{% \centering \begin{tikzpicture} \definecolor{cyclamen}{RGB}{146, 24, 43} @@ -46,7 +46,7 @@ where: \node [cyclamen] at (5.5,-0.4) {$\theta$}; \node [rotate=-90] at (10.2,0) {screen}; \end{tikzpicture} -\caption{Fraunhofer diffraction.}\label{fig:fenditure} +\caption{Fraunhofer diffraction.} } \end{figure} @@ -85,30 +85,47 @@ omitted: &\thus \theta = \text{acos} (1 -x) \end{align*} -The sample was stored and plotted in a histogram with a customizable number $n$ -of bins default set $n = 150$. In \textcolor{red}{fig} an example is shown. +The sample was binned and stored in a histogram with a customizable number $n$ +of bins default set $n = 150$. In @fig:original an example is shown. -\textcolor{red}{missing plot.} +![Example of sorted points according to + $I(\theta)$.](images/6_original.pdf){#fig:original} ## Gaussian noise convolution -The sample must then be smeared with a gaussian noise with the aim to recover +The sample must then be smeared with a Gaussian noise with the aim to recover the original sample afterwards, implementing a deconvolution routine. For this purpose, a 'kernel' histogram with a odd number $m$ of bins and the same bin width of the previous one, but a smaller number of them ($m < n$), was -filled with $m$ points according to a gaussian distribution with mean $\mu$, +filled with $m$ points according to a Gaussian distribution with mean $\mu$, corresponding to the central bin, and variance $\sigma$. Then, the original histogram was convolved with the kernel in order to obtain -the smeared signal. The procedure is summed up in \textcolor{red}{fig}. +the smeared signal. The result is shown in @fig:convolved. -\textcolor{red}{missing plots.} +![Same sample of @fig:original convolved with the + kernel.](images/6_convolved.pdf){#fig:convolved} -The third histogram was obtained by keeping the same edges of the original -signal and a number of bins n +m -1 (?). -The convolution was obtained by permorming the dot product between the invere -kernel and the clean signal for each relative position of the two histograms. -For a better understaing, see \textcolor{red}{fig}. +The convolution was implemented as follow. Consider the definition of +convolution of two functions $f(x)$ and $g(x)$: + +$$ + f*g (x) = \int \limits_{- \infty}^{+ \infty} dy f(y) g(x - y) +$$ + +Since a histogram is made of discrete values, a discrete convolution of the +signal $s$ and the kernel $k$ must be computed. Hence, the procedure boils +down to a dot product between $s$ and the reverse histogram of $k$ for each +relative position of the two histograms. Namely, if $c_i$ is the $i^{\text{th}}$ +bin of the convoluted histogram: + +$$ + c_i = \sum_j k_j s_{i - j} +$$ + +where $j$ runs over the bins of the kernel. +For a better understanding, see @fig:dot_conv. Thus, the third histogram was +obtained with $n + m - 1$ bins, a number greater than the initial one. \begin{figure} \hypertarget{fig:dot_conv}{% @@ -116,43 +133,43 @@ For a better understaing, see \textcolor{red}{fig}. \begin{tikzpicture} \definecolor{cyclamen}{RGB}{146, 24, 43} % original histogram - \draw [thick, cyclamen, fill=cyclamen!15!white] (0.0,0) rectangle (0.5,2.5); - \draw [thick, cyclamen, fill=cyclamen!15!white] (0.5,0) rectangle (1.0,2.8); - \draw [thick, cyclamen, fill=cyclamen!15!white] (1.0,0) rectangle (1.5,2.3); - \draw [thick, cyclamen, fill=cyclamen!15!white] (1.5,0) rectangle (2.0,1.8); - \draw [thick, cyclamen, fill=cyclamen!15!white] (2.0,0) rectangle (2.5,1.4); - \draw [thick, cyclamen, fill=cyclamen!15!white] (2.5,0) rectangle (3.0,1.0); - \draw [thick, cyclamen, fill=cyclamen!15!white] (3.0,0) rectangle (3.5,1.0); - \draw [thick, cyclamen, fill=cyclamen!15!white] (3.5,0) rectangle (4.0,0.6); - \draw [thick, cyclamen, fill=cyclamen!15!white] (4.0,0) rectangle (4.5,0.4); - \draw [thick, cyclamen, fill=cyclamen!15!white] (4.5,0) rectangle (5.0,0.2); - \draw [thick, cyclamen, fill=cyclamen!15!white] (5.0,0) rectangle (5.5,0.2); + \draw [thick, cyclamen, fill=cyclamen!05!white] (0.0,0) rectangle (0.5,2.5); + \draw [thick, cyclamen, fill=cyclamen!05!white] (0.5,0) rectangle (1.0,2.8); + \draw [thick, cyclamen, fill=cyclamen!25!white] (1.0,0) rectangle (1.5,2.3); + \draw [thick, cyclamen, fill=cyclamen!25!white] (1.5,0) rectangle (2.0,1.8); + \draw [thick, cyclamen, fill=cyclamen!25!white] (2.0,0) rectangle (2.5,1.4); + \draw [thick, cyclamen, fill=cyclamen!25!white] (2.5,0) rectangle (3.0,1.0); + \draw [thick, cyclamen, fill=cyclamen!25!white] (3.0,0) rectangle (3.5,1.0); + \draw [thick, cyclamen, fill=cyclamen!05!white] (3.5,0) rectangle (4.0,0.6); + \draw [thick, cyclamen, fill=cyclamen!05!white] (4.0,0) rectangle (4.5,0.4); + \draw [thick, cyclamen, fill=cyclamen!05!white] (4.5,0) rectangle (5.0,0.2); + \draw [thick, cyclamen, fill=cyclamen!05!white] (5.0,0) rectangle (5.5,0.2); \draw [thick, cyclamen] (6.0,0) -- (6.0,0.2); \draw [thick, cyclamen] (6.5,0) -- (6.5,0.2); \draw [thick, <->] (0,3.3) -- (0,0) -- (7,0); % kernel histogram - \draw [thick, cyclamen, fill=cyclamen!15!white] (1.0,-1) rectangle (1.5,-1.2); - \draw [thick, cyclamen, fill=cyclamen!15!white] (1.5,-1) rectangle (2.0,-1.4); - \draw [thick, cyclamen, fill=cyclamen!15!white] (2.0,-1) rectangle (2.5,-1.8); - \draw [thick, cyclamen, fill=cyclamen!15!white] (2.5,-1) rectangle (3.0,-1.4); - \draw [thick, cyclamen, fill=cyclamen!15!white] (3.0,-1) rectangle (3.5,-1.2); + \draw [thick, cyclamen, fill=cyclamen!25!white] (1.0,-1) rectangle (1.5,-1.2); + \draw [thick, cyclamen, fill=cyclamen!25!white] (1.5,-1) rectangle (2.0,-1.6); + \draw [thick, cyclamen, fill=cyclamen!25!white] (2.0,-1) rectangle (2.5,-1.8); + \draw [thick, cyclamen, fill=cyclamen!25!white] (2.5,-1) rectangle (3.0,-1.6); + \draw [thick, cyclamen, fill=cyclamen!25!white] (3.0,-1) rectangle (3.5,-1.2); \draw [thick, <->] (1,-2) -- (1,-1) -- (4,-1); % arrows - \draw [thick, <->] (1.25,-0.2) -- (1.25,-0.8); - \draw [thick, <->] (1.75,-0.2) -- (1.75,-0.8); - \draw [thick, <->] (2.25,-0.2) -- (2.25,-0.8); - \draw [thick, <->] (2.75,-0.2) -- (2.75,-0.8); - \draw [thick, <->] (3.25,-0.2) -- (3.25,-0.8); - \draw [thick, ->] (2.25,-2.0) -- (2.25,-4.2); + \draw [thick, cyclamen, <->] (1.25,-0.2) -- (1.25,-0.8); + \draw [thick, cyclamen, <->] (1.75,-0.2) -- (1.75,-0.8); + \draw [thick, cyclamen, <->] (2.25,-0.2) -- (2.25,-0.8); + \draw [thick, cyclamen, <->] (2.75,-0.2) -- (2.75,-0.8); + \draw [thick, cyclamen, <->] (3.25,-0.2) -- (3.25,-0.8); + \draw [thick, cyclamen, ->] (2.25,-2.0) -- (2.25,-4.2); % smeared histogram \begin{scope}[shift={(0,-1)}] - \draw [thick, cyclamen, fill=cyclamen!15!white] (-1.0,-4.5) rectangle (-0.5,-4.3); - \draw [thick, cyclamen, fill=cyclamen!15!white] (-0.5,-4.5) rectangle ( 0.0,-4.2); - \draw [thick, cyclamen, fill=cyclamen!15!white] ( 0.0,-4.5) rectangle ( 0.5,-2.0); - \draw [thick, cyclamen, fill=cyclamen!15!white] ( 0.5,-4.5) rectangle ( 1.0,-1.6); - \draw [thick, cyclamen, fill=cyclamen!15!white] ( 1.0,-4.5) rectangle ( 1.5,-2.3); - \draw [thick, cyclamen, fill=cyclamen!15!white] ( 1.5,-4.5) rectangle ( 2.0,-2.9); - \draw [thick, cyclamen, fill=cyclamen!15!white] ( 2.0,-4.5) rectangle ( 2.5,-3.4); + \draw [thick, cyclamen, fill=cyclamen!05!white] (-1.0,-4.5) rectangle (-0.5,-4.3); + \draw [thick, cyclamen, fill=cyclamen!05!white] (-0.5,-4.5) rectangle ( 0.0,-4.2); + \draw [thick, cyclamen, fill=cyclamen!05!white] ( 0.0,-4.5) rectangle ( 0.5,-2.0); + \draw [thick, cyclamen, fill=cyclamen!05!white] ( 0.5,-4.5) rectangle ( 1.0,-1.6); + \draw [thick, cyclamen, fill=cyclamen!05!white] ( 1.0,-4.5) rectangle ( 1.5,-2.3); + \draw [thick, cyclamen, fill=cyclamen!05!white] ( 1.5,-4.5) rectangle ( 2.0,-2.9); + \draw [thick, cyclamen, fill=cyclamen!25!white] ( 2.0,-4.5) rectangle ( 2.5,-3.4); \draw [thick, cyclamen] (3.0,-4.5) -- (3.0,-4.3); \draw [thick, cyclamen] (3.5,-4.5) -- (3.5,-4.3); \draw [thick, cyclamen] (4.0,-4.5) -- (4.0,-4.3); @@ -165,9 +182,18 @@ For a better understaing, see \textcolor{red}{fig}. \draw [thick, cyclamen] (7.5,-4.5) -- (7.5,-4.3); \draw [thick, <->] (-1,-2.5) -- (-1,-4.5) -- (8,-4.5); \end{scope} + % nodes + \node [above] at (2.25,-5.5) {$c_i$}; + \node [above] at (3.25,0) {$s_i$}; + \node [above] at (1.95,0) {$s_{i-3}$}; + \node [below] at (1.75,-1) {$k_3$}; \end{tikzpicture} \caption{Dot product as a step of the convolution between the original signal - (above) and the kernel (below). The final result is the lower + (above) and the kernel (center). The final result is the lower fledging histogram.}\label{fig:dot_conv} } \end{figure} + +\textcolor{red}{Missing various $\sigma$ comparison.} + +## Unfolding