1

How can I create the following diagram?

Enter image description here

Additionally, I want under the "Channel" box a flash to show channel interference/noise to clarify that Y is corrupted by noise.

wayne
  • 613
  • 2
    I realize it's hard to search for things like this, but here are a couple of (slightly more complex) examples that might get you started: https://tex.stackexchange.com/questions/163481/specific-box-diagram-with-multiple-arrows https://tex.stackexchange.com/questions/167278/how-to-position-in-tikz-relatively – Torbjørn T. Jan 29 '22 at 14:05

2 Answers2

5

With tikz:

Edit: ok., with added red lightning: One more edit: now is added text to lightning. Since this text is unknow, correct one is left to you ...

enter image description here

\documentclass[tikz, border=3mm]{standalone}
\usepackage{marvosym}
\usetikzlibrary{arrows.meta,
                chains,   % new
                positioning,
                quotes,
                }

\begin{document} \begin{tikzpicture}[ node distance = 7mm and 18mm, % <--- start chain = going right, box/.style = {draw, thick, minimum height=9mm, minimum width =18mm, on chain}, every edge/.style = {draw, -Straight Barb, semithick}, every edge quotes/.append style = {font=\footnotesize, align=center}, ] \coordinate[on chain] (in); \node (n1) [box] {Encoder}; \node (n2) [box, label={[font=\Huge, text=red]:\Lightning}] {Channel}; \node[above=of n2, font=\footnotesize] {To je strela!}; % <--- \node (n3) [box] {Decoder}; \coordinate[on chain] (out); % \path (in) edge ["Message\ $\mathcal{K}$"] (n1) (n1) edge ["Codeword\ $X_{\mathcal{K}}$"] (n2) (n2) edge ["Output\ $Y$"] (n3) (n3) edge ["Estimate\ $\widehat{\mathcal{K}}$"] (out); \end{tikzpicture} \end{document}

Zarko
  • 296,517
  • Thank you very much. Can you please add a flash under the noise box to denote interference in the channel? – wayne Jan 29 '22 at 15:17
  • @wayne, how should looks "flash"? – Zarko Jan 29 '22 at 15:24
  • Something like the red flash on the following page: https://www.cs.cmu.edu/~guyb/realworld/reedsolomon/reed_solomon_codes.html – wayne Jan 29 '22 at 15:32
  • @wayne, see edited answer. – Zarko Jan 29 '22 at 15:41
  • You are the best! Thanks! how can I add text above the lightning? – wayne Jan 29 '22 at 15:47
  • @wayne, added. But, your recent request is so simple that you should manage it yourself ;-) . I strongly encourage you to read some introductory text about LaTeX and TikZ. For example "The not so short introduction to LaTeX2e" and "Minimal introduction to TikZ (unofficial)". Both you can find by googling. – Zarko Jan 29 '22 at 16:02
  • I will do. Thanks for the references – wayne Jan 29 '22 at 16:26
4

I propose this solution with basic tools (packages amsmath, eqparbox & stackengine):

\documentclass{article}
\usepackage{eqparbox}
\usepackage[usestackEOL]{stackengine} 
\usepackage{amsmath} 
\usepackage{geometry}

\begin{document}

[ \xrightarrow{\eqparbox{L}{\bfseries\boldmath\Centerstack{Message \ $\mathcal{K}$}}} \eqframebox[C]{\enspace Encoder\enspace } \xrightarrow{\eqparbox{L}{\bfseries\boldmath \Centerstack{Codeword \$\textsf{X}_\mathcal{K}$}}}\eqframebox[C]{Channel} \xrightarrow{\eqparbox{L}{\bfseries\boldmath \Centerstack{Output \ Y}}}\eqframebox[C]{Decoder} \xrightarrow{\eqparbox{L}{\bfseries\boldmath \Centerstack{Estimate \$\hat{\mathcal{K}}$}}}]%

\end{document}

enter image description here

Bernard
  • 271,350