5

I am trying to draw the following block diagram using pgf/TikZ. Actually I am struck at getting the two inputs to the first block horizontal.

block diagram

What is the best way to draw the above diagram using pgf/TikZ.

6

One possibility:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[box/.style={draw,rounded corners,text width=2.5cm,align=center}]
\node[box] (a) {Psychoacustic Model};
\node[left=of a.170,font=\bfseries] (aux1) {Reference};
\node[left=of a.190,font=\bfseries] (aux2) {Degraded};
\node[box,right=of a] (b) {Cognitive Model};
\node[right=of b,font=\bfseries] (c) {Score};
\draw[->] (aux1) -- (a.170);
\draw[->] (aux2) -- (a.190);
\draw[->] (a) -- (b);
\draw[->] (b) -- (c);
\end{tikzpicture}

\end{document}

enter image description here

  • What am I supposed to change in this code if I need to change relative vertical distance between the two inputs? what does a.170 or a.190 actually mean – NAASI Jul 12 '17 at 20:43
  • a.170 and a.180 mean the angle from the center line of the a node. To increase the vertical distance, you could try, a.160 and a.200. To decrease the vertical distance, you could try, a.175 and a.185. a.180 is the west direction. – Shailesh Kumar Dec 30 '17 at 7:19

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.