I'd like to write and draw something like the below picture in LaTeX. I know how to write an ordinary text with formulas in LaTeX, but not that much professional to have something like this. Please give some hints or references to how to do that.
[Tex/LaTex] Drawing a person in LaTeX
tikz-pgf
Related Solutions
Using the package Tikz/PGF you will draw this filter banks with a simple codification. Tikz is very powerfull LaTeX package for drawing. The website TeXample contains a great compilation of examples using this package, sure it will help you. Filter Banks are as Block Diagrams, see the section Block Diagrams at TeXample for help.
For example, this code produces a simple block diagrams:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\begin{tikzpicture}[auto,>=latex']
\tikzstyle{block} = [draw, shape=rectangle, minimum height=3em, minimum width=3em, node distance=2cm, line width=1pt]
\tikzstyle{sum} = [draw, shape=circle, node distance=1.5cm, line width=1pt, minimum width=1.25em]
\tikzstyle{branch}=[fill,shape=circle,minimum size=4pt,inner sep=0pt]
%Creating Blocks and Connection Nodes
\node at (-2.5,0) (input) {$x[n]$};
\node [block] (h1) {$h_1[n]$};
\node [block, right of=h1] (h2) {$h_2[n]$};
\node [sum, right of=h2] (sum) {};
\node at (sum) (plus) {{\footnotesize$+$}};
\node at (5,0) (output) {$y[n]$};
\path (h1) -- coordinate (med) (h2);
\path (input) -- coordinate(branch1) (h1);
\node [block, below of=med] (h3) {$h_3[n]$};
%Conecting Blocks
\begin{scope}[line width=1pt]
\draw[->] (input) -- (h1);
\draw[->] (h1) -- (h2);
\draw[->] (h2) -- (sum);
\draw[->] (sum) -- (output);
\draw[->] (branch1) node[branch] {} |- (h3);
\draw[->] (h3) -| (sum);
\end{scope}
\end{tikzpicture}
\end{document}
In the document preamble add \usepackage{tikz}
, I know that the code seems a little difficult but it is.
The operating principle of the package is: drawn nodes over a grid, and every node can contain a figure or simply it work as a connection node. The package manual is a very good documentation about it, see for help.
The trick of my solution is to use a scope
with rotate=45
and then to make all links with |-
. I also define three commands to factorize code.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\newcommand\reflexive[2]{% node, label
\draw[->] (#1.100) to[reflexive] node[trans,above=-2mm] {#2} (#1.80);
}
\newcommand\link[3]{% start node, end node, label
\draw[edge] (#1) -- (#1 |- #2);
\node[trans] at (#1 |- #2) {#3} (1);
\draw[edge] (#1 |- #2) -- (#2);
}
\newcommand\linkwithdots[4]{% start node, end node, dots node, label
\coordinate (dots1) at (#1 |- #3);
\draw (#1) -- ([yshift=5mm]dots1);
\draw[dotted] ([yshift=5mm]dots1) -- ([yshift=-5mm]dots1);
\draw[edge] ([yshift=-5mm]dots1) -- (#1 |- #2);
\node[trans] at (#1 |- #2) {#4} (1);
\coordinate (dots2) at (#3 |- #2);
\draw (#1 |- #2) -- ([xshift=-5mm]dots2);
\draw[dotted] ([xshift=-5mm]dots2) -- ([xshift=5mm]dots2);
\draw[edge] ([xshift=5mm]dots2) -- (#2);
}
\begin{document}
\begin{tikzpicture}
\tikzset{
>=stealth',
node distance=1.5cm,
state/.style={minimum size=30pt,font=\small,circle,draw},
dots/.style={state,draw=none},
edge/.style={->},
trans/.style={font=\footnotesize,above=2mm},
reflexive/.style={out=120,in=60,looseness=5,relative},
}
\node [state] (0) {$0$};
\node [state] (1) [right of = 0] {$1$};
\node [state] (2) [right of = 1] {$2$};
\node [dots] (d1) [right of = 2] {$\cdots$};
\node [state] (km1) [right of = d1] {$k-1$};
\node [state] (k) [right of = km1] {$k$};
\node [state] (kp1) [right of = k] {$k+1$};
\node [dots] (d2) [right of = kp1] {$\cdots$};
\node [state] (mmk) [right of = d2] {$m-k$};
\node [dots] (d3) [right of = mmk] {$\cdots$};
\node [state] (mm2) [right of = d3] {$m-2$};
\node [state] (mm1) [right of = mm2] {$m-1$};
\begin{scope}[rotate=45]
\reflexive{0}{$\mu_0$}
\reflexive{1}{$\mu_0$}
\reflexive{2}{$\mu_0$}
\link{0}{1}{$\mu_1$}
\link{0}{2}{$\mu_1$}
\link{1}{2}{$\mu_1$}
\linkwithdots{0}{km1}{d1}{$\mu_{k-1}$}
\linkwithdots{1}{km1}{d1}{$\mu_{k-2}$}
\linkwithdots{2}{km1}{d1}{$\mu_{k-3}$}
\end{scope}
\end{tikzpicture}
\end{document}
Now, you have just to complete with some links...
Best Answer
OK, I had some time to play around with Bezier curves, so I had to share it here: