I am trying to create an Encoder block diagram. enter image description here

Can someone provide me the starting point? Regards


TikZ solution:

enter image description here

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows.meta, calc, chains, positioning}
\newcommand\ppbb{path picture bounding box}

\tikzset{suppress join/.code={\def\tikz@after@path{}}}

            > = Triangle,
node distance = 7mm,
  start chain = going right,
box/.style = {draw, minimum size=7mm, on chain, join=by ->},
dot/.style = {circle, draw, fill, minimum size=1mm, inner sep=0mm,
              on chain, join=by -, node contents={}},
sum/.style = {circle, draw, minimum size=6mm,
              path picture={\draw[thick,shorten <=1.5mm,shorten >=1.5mm,-]
                                (\ppbb.north) edge (\ppbb.south)
                                (\ppbb.west)  edge (\ppbb.east);
                            },% end of path picture /node content/
              node contents={}},
\coordinate[on chain, label=left:{$X[n]$}] (in);
\node (n1) [dot];
\node (n2) [box] {$z^{-1}$};
\node (n3) [dot];
\node (n4) [box] {$z^{-1}$};
\node (n5) [dot];
\node (n6) [box,suppress join] {$\&$};
\coordinate[on chain, join=by ->,label=right:{$Y[n]$}] (out);
\node (s1) [sum,above=of n2.north -| n3];
\node (s2) [sum,above=of n2.north -| n5];
\node (s3) [sum,below=of n2.south -| n3];
\node (s4) [sum,below=of n2.south -| n5];
\draw[->]   (n1)  |-  (s1);
\draw[->]   (s1) edge (s2)
            (s2)  -|  node[right] {$Y_1[n]$} (n6)
            (n3) edge (s1)
            (n5) edge (s2);
\draw[->]   (n1)  |-  (s3);
\draw[->]   (s3) edge (s4)
            (s4) -| node[right] {$Y_2[n]$} (n6)
            (n3) edge (s3)
            (n5) edge (s4);

Here is a short code with pstricks. It can be compiled with pdflatex, provided you launch the compiler with --enable-write18 switch for MiKTeX, -shell-escape for TeX Live and MacTeX.


\usepackage{pst-node, auto-pst-pdf}


   $ \def\pscolhookii{\hskip-.4cm}
      \begin{psmatrix}[rowsep=1cm, colsep=1.2cm, emnode=p]%[, rowsep=0.8cm]
    %% nodes
    & & & \circlenode{+A}{+} & & \circlenode{+C}{+} & \\
      X[n] & & \fbox{$Z⁻¹$\strut} & & \fbox{$Z⁻¹$\strut} & & \fbox{\&\rule[-2.5ex]{0pt}{6ex}} & [name=Y]Y_{\text{out}} \\
      & & & & & \circlenode{+B}{+} &
        %%lines and arrows
      \psset{arrowinset=0.15, nodesep=0pt, linewidth=0.6pt}
     \ncline[arrows=->]{2,1}{2,3} \ncline{2,3}{2,5}
     \ncangle[angleA=-90, angleB=180]{+A}{+B}
     \ncbar[arrows=<->, armA=7cm, angleA=180, angleB=180]{+B}{+A}
      \ncline{2,7}{1,7} \ncline{2,7}{3,7}
     \psset{arrows=->, nodesepB =-0.4pt}
     \ncline{+C} {1,7}\ncline{+B}{3,7}


enter image description here

  • (+1) for the effort. little modification is needed though. The sum in the bottom sums two inputs. – CroCo Jul 16 '17 at 23:13
  • @Croco: Oh! yes. I hadn't noticed this detail. With a second arrow tip I guess? – Bernard Jul 16 '17 at 23:20
  • The Yout.2 is the output of two inputs (i.e. Yout.2 = input1 + input2). The output of the second Z^{-1} (i.e. in the center and say it is A) is added to X[n] (i.e. Yout.2 = X[n] + A ). Also the case for the right top sum needs to acquire input from Z{-1} (i.e. A). – CroCo Jul 16 '17 at 23:24
  • @Croco: I've modifrd the code. Is it what you want now? – Bernard Jul 16 '17 at 23:40
  • Not me but the OP wants that. Also, there should be no connection from the bottom to the top left sum. :) – CroCo Jul 16 '17 at 23:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.