Include pre-built figures when \overleaftrue is set

This commit is contained in:
Andreas Tsouchlos 2024-01-08 14:00:54 +01:00
parent 3805d927bf
commit 2cab8aa178

View File

@ -27,7 +27,11 @@
\newif\ifoverleaf
%\overleaftrue
%\overleaftrue % When enabled, this option allows the document to be compiled
% on overleaf:
% - common.tex is sourced from a different directory
% - Externalization is disabled
% - Figures are included from pre-build PDFs
%
@ -362,38 +366,43 @@ decoded bits.%
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
grid=both,
xlabel={$E_\text{b} / N_0$ (dB)}, ylabel={},
ymode=log,
xmin=1, xmax=8,
ymax=1, ymin=1e-6,
% ytick={1e-0, 1e-2, 1e-4, 1e-6},
width=\figwidth,
height=\figheight,
legend pos = south west,
]
\addplot+[FERPlot, mark=o, mark options={solid}, scol1]
table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{FER}
\addplot+[BERPlot, mark=*, scol1]
table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{BER}
\addplot+[DFRPlot, mark=square*, scol0]
table [x=SNR, y=DFR, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{DFR}
\end{axis}
\end{tikzpicture}
\ifoverleaf
\includegraphics{figs/letter-figure0.pdf}
\else
\begin{tikzpicture}
\begin{axis}[
grid=both,
xlabel={$E_\text{b} / N_0$ (dB)}, ylabel={},
ymode=log,
xmin=1, xmax=8,
ymax=1, ymin=1e-6,
% ytick={1e-0, 1e-2, 1e-4, 1e-6},
width=\figwidth,
height=\figheight,
legend pos = south west,
]
\addplot+[FERPlot, mark=o, mark options={solid}, scol1]
table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{FER}
\addplot+[BERPlot, mark=*, scol1]
table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{BER}
\addplot+[DFRPlot, mark=square*, scol0]
table [x=SNR, y=DFR, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{DFR}
\end{axis}
\end{tikzpicture}
\fi
\caption{FER, DFR, and BER for $\left( 3, 6 \right)$-regular LDPC code with
$n=204, k=102$ \cite[\text{204.33.484}]{mackay}.
@ -427,93 +436,100 @@ optimization process.%
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[xmin = -1.25, xmax=1.25,
ymin = -1.25, ymax=1.25,
xlabel={$\tilde{x}_1$},
ylabel={$\tilde{x}_2$},
y label style={at={(axis description cs:-0.06,0.5)},anchor=south},
width=\figwidth,
height=\figheight,
grid=major, grid style={dotted},
view={0}{90}]
\addplot3[point meta=\thisrow{grad_norm},
point meta min=1,
point meta max=2.5,
quiver={u=\thisrow{grad_0},
v=\thisrow{grad_1},
scale arrows=.05,
every arrow/.append style={%
line width=.3
+\pgfplotspointmetatransformed/1000,
-{Latex[length=0pt 5,width=0pt 3]}
},
},
quiver/colored = {mapped color},
-stealth,
]
table[col sep=comma] {res/2d_grad_L.csv};
\end{axis}
\begin{axis}[hide axis,
width=\figwidth,
height=\figheight,
xmin=10, xmax=50,
ymin=0, ymax=0.4,
legend style={draw=white!15!black,
legend cell align=left,
empty legend,
at={(0.9775,0.97)},anchor=north east}]
\addlegendimage{mark=none}
\addlegendentry{
$\nabla L\left(\boldsymbol{y}
\mid \tilde{\boldsymbol{x}}\right)$
};
\end{axis}
\end{tikzpicture}
\ifoverleaf
\includegraphics{figs/letter-figure1.pdf}
\else
\begin{tikzpicture}
\begin{axis}[xmin = -1.25, xmax=1.25,
ymin = -1.25, ymax=1.25,
xlabel={$\tilde{x}_1$},
ylabel={$\tilde{x}_2$},
y label style={at={(axis description cs:-0.06,0.5)},anchor=south},
width=\figwidth,
height=\figheight,
grid=major, grid style={dotted},
view={0}{90}]
\addplot3[point meta=\thisrow{grad_norm},
point meta min=1,
point meta max=2.5,
quiver={u=\thisrow{grad_0},
v=\thisrow{grad_1},
scale arrows=.05,
every arrow/.append style={%
line width=.3
+\pgfplotspointmetatransformed/1000,
-{Latex[length=0pt 5,width=0pt 3]}
},
},
quiver/colored = {mapped color},
-stealth,
]
table[col sep=comma] {res/2d_grad_L.csv};
\end{axis}
\begin{axis}[hide axis,
width=\figwidth,
height=\figheight,
xmin=10, xmax=50,
ymin=0, ymax=0.4,
legend style={draw=white!15!black,
legend cell align=left,
empty legend,
at={(0.9775,0.97)},anchor=north east}]
\addlegendimage{mark=none}
\addlegendentry{
$\nabla L\left(\boldsymbol{y}
\mid \tilde{\boldsymbol{x}}\right)$
};
\end{axis}
\end{tikzpicture}
\fi
\vspace{3mm}
\begin{tikzpicture}
\begin{axis}[xmin = -1.25, xmax=1.25,
ymin = -1.25, ymax=1.25,
width=\figwidth,
height=\figheight,
xlabel={$\tilde{x}_1$},
ylabel={$\tilde{x}_2$},
y label style={at={(axis description cs:-0.06,0.5)},anchor=south},
grid=major, grid style={dotted},
view={0}{90}]
\addplot3[point meta=\thisrow{grad_norm},
point meta min=1,
point meta max=7,
quiver={u=\thisrow{grad_0},
v=\thisrow{grad_1},
scale arrows=.03,
every arrow/.append style={%
line width=.5
+\pgfplotspointmetatransformed/1000,
-{Latex[length=0pt 5,width=0pt 3]}
},
},
quiver/colored = {mapped color},
-stealth,
]
table[col sep=comma] {res/2d_grad_h.csv};
\end{axis}
\begin{axis}[hide axis,
width=\figwidth,
height=\figheight,
xmin=10, xmax=50,
ymin=0, ymax=0.4,
legend style={draw=white!15!black,
legend cell align=left,
empty legend,
at={(0.9775,0.97)},anchor=north east}]
\addlegendimage{mark=none}
\addlegendentry{$\nabla h\left(\tilde{\boldsymbol{x}}\right)$};
\end{axis}
\end{tikzpicture}
\ifoverleaf
\includegraphics{figs/letter-figure2.pdf}
\else
\begin{tikzpicture}
\begin{axis}[xmin = -1.25, xmax=1.25,
ymin = -1.25, ymax=1.25,
width=\figwidth,
height=\figheight,
xlabel={$\tilde{x}_1$},
ylabel={$\tilde{x}_2$},
y label style={at={(axis description cs:-0.06,0.5)},anchor=south},
grid=major, grid style={dotted},
view={0}{90}]
\addplot3[point meta=\thisrow{grad_norm},
point meta min=1,
point meta max=7,
quiver={u=\thisrow{grad_0},
v=\thisrow{grad_1},
scale arrows=.03,
every arrow/.append style={%
line width=.5
+\pgfplotspointmetatransformed/1000,
-{Latex[length=0pt 5,width=0pt 3]}
},
},
quiver/colored = {mapped color},
-stealth,
]
table[col sep=comma] {res/2d_grad_h.csv};
\end{axis}
\begin{axis}[hide axis,
width=\figwidth,
height=\figheight,
xmin=10, xmax=50,
ymin=0, ymax=0.4,
legend style={draw=white!15!black,
legend cell align=left,
empty legend,
at={(0.9775,0.97)},anchor=north east}]
\addlegendimage{mark=none}
\addlegendentry{$\nabla h\left(\tilde{\boldsymbol{x}}\right)$};
\end{axis}
\end{tikzpicture}
\fi
\caption{Gradients
$\nabla L\left(\boldsymbol{y} \mid \tilde{\boldsymbol{x}}\right)$
and $\nabla h \left( \tilde{\boldsymbol{x}} \right)$ for a repetition
@ -537,36 +553,40 @@ oscillate after a certain number of iterations.%
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
grid=both,
xlabel={Iterations},
width=\figwidth,
height=\figheight,
xtick={0, 100, ..., 400},
xticklabels={0, 50, ..., 200},
xmin=0, xmax=300,
ymin=-4, ymax=2,
ytick={-4,-3,...,2},
legend pos = south east,
]
\addplot+ [mark=none, line width=1]
table [col sep=comma, x=k, y=comb_r_s_0,
discard if gt={k}{300}]
{res/extreme_components_20433484_combined.csv};
\addplot+ [mark=none, line width=1,
discard if gt={k}{300}]
table [col sep=comma, x=k, y=grad_L_0]
{res/extreme_components_20433484_combined.csv};
\addplot+ [mark=none, line width=1]
table [col sep=comma, x=k, y=grad_h_0,
discard if gt={k}{300}]
{res/extreme_components_20433484_combined.csv};
\addlegendentry{$\left(\tilde{\boldsymbol{x}}\right)_1$}
\addlegendentry{$\left(\nabla L\right)_1$}
\addlegendentry{$\left(\nabla h\right)_1$}
\end{axis}
\end{tikzpicture}
\ifoverleaf
\includegraphics{figs/letter-figure3.pdf}
\else
\begin{tikzpicture}
\begin{axis}[
grid=both,
xlabel={Iterations},
width=\figwidth,
height=\figheight,
xtick={0, 100, ..., 400},
xticklabels={0, 50, ..., 200},
xmin=0, xmax=300,
ymin=-4, ymax=2,
ytick={-4,-3,...,2},
legend pos = south east,
]
\addplot+ [mark=none, line width=1]
table [col sep=comma, x=k, y=comb_r_s_0,
discard if gt={k}{300}]
{res/extreme_components_20433484_combined.csv};
\addplot+ [mark=none, line width=1,
discard if gt={k}{300}]
table [col sep=comma, x=k, y=grad_L_0]
{res/extreme_components_20433484_combined.csv};
\addplot+ [mark=none, line width=1]
table [col sep=comma, x=k, y=grad_h_0,
discard if gt={k}{300}]
{res/extreme_components_20433484_combined.csv};
\addlegendentry{$\left(\tilde{\boldsymbol{x}}\right)_1$}
\addlegendentry{$\left(\nabla L\right)_1$}
\addlegendentry{$\left(\nabla h\right)_1$}
\end{axis}
\end{tikzpicture}
\fi
\caption{Visualization of component $\left(\tilde{\boldsymbol{x}}\right)_1$
for a decoding operation for a (3,6) regular LDPC code with
@ -595,21 +615,25 @@ the probability that a given component was decoded incorrectly.%
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
grid=both,
ylabel=$P(\hat{c}_{i'} \ne c_{i'})$,
xlabel=$i'$,
ymode=log,
ymin=1e-9,ymax=1e-5,
xmin=0,xmax=200,
width=0.95\figwidth,
height=\figheight,
]
\addplot+ [scol0, mark=none, line width=1]
table [col sep=comma, y=p_error]{res/p_error.csv};
\end{axis}
\end{tikzpicture}
\ifoverleaf
\includegraphics{figs/letter-figure4.pdf}
\else
\begin{tikzpicture}
\begin{axis}[
grid=both,
ylabel=$P(\hat{c}_{i'} \ne c_{i'})$,
xlabel=$i'$,
ymode=log,
ymin=1e-9,ymax=1e-5,
xmin=0,xmax=200,
width=0.95\figwidth,
height=\figheight,
]
\addplot+ [scol0, mark=none, line width=1]
table [col sep=comma, y=p_error]{res/p_error.csv};
\end{axis}
\end{tikzpicture}
\fi
\caption{Probability that a component of the estimated codeword
$\hat{\boldsymbol{c}}\in \mathbb{F}_2^n$ is erroneous for a (3,6) regular
@ -683,50 +707,54 @@ Again, these parameters were chosen,%
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
grid=both,
xlabel={$E_\text{b} / N_0$ (dB)},
ymode=log,
xmin=1, xmax=8,
ymax=1, ymin=1e-6,
width=\figwidth,
height=\figheight,
legend columns=2,
legend style={draw=white!15!black,
legend cell align=left,
at={(0.5,-0.44)},anchor=south}
]
\ifoverleaf
\includegraphics{figs/letter-figure5.pdf}
\else
\begin{tikzpicture}
\begin{axis}[
grid=both,
xlabel={$E_\text{b} / N_0$ (dB)},
ymode=log,
xmin=1, xmax=8,
ymax=1, ymin=1e-6,
width=\figwidth,
height=\figheight,
legend columns=2,
legend style={draw=white!15!black,
legend cell align=left,
at={(0.5,-0.44)},anchor=south}
]
\addplot+[FERPlot, mark=o, mark options={solid}, scol1]
table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{FER, prox. dec.};
\addplot+[FERPlot, mark=o, mark options={solid}, scol1]
table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{9}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{FER, prox. dec.};
\addplot+[BERPlot, mark=*, scol1]
table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{BER, prox. dec.};
\addplot+[BERPlot, mark=*, scol1]
table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}]
{res/proximal_ber_fer_dfr_20433484.csv};
\addlegendentry{BER, prox. dec.};
\addplot+[FERPlot, mark=triangle, mark options={solid}, scol2]
table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}]
{res/improved_ber_fer_dfr_20433484.csv};
\addlegendentry{FER, improved};
\addplot+[FERPlot, mark=triangle, mark options={solid}, scol2]
table [x=SNR, y=FER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{7.5}]
{res/improved_ber_fer_dfr_20433484.csv};
\addlegendentry{FER, improved};
\addplot+[BERPlot, mark=triangle*, scol2]
table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{6.5}]
{res/improved_ber_fer_dfr_20433484.csv};
\addlegendentry{BER, improved};
\end{axis}
\end{tikzpicture}
\addplot+[BERPlot, mark=triangle*, scol2]
table [x=SNR, y=BER, col sep=comma,
discard if not={gamma}{0.05},
discard if gt={SNR}{6.5}]
{res/improved_ber_fer_dfr_20433484.csv};
\addlegendentry{BER, improved};
\end{axis}
\end{tikzpicture}
\fi
\caption{FER and BER of proximal decoding \cite{proximal_paper} and the
improved algorithm for a $\left( 3, 6 \right)$-regular LDPC code with