This is my first attempt at drawing anything Tikz, so bear with me:
I'm trying to draw a simple flowchart for a DSP algorithm, however i am stuck at properly drawing the loop return that it incorporates. As you can see below in my code example, i was only able to not make the return arrow intersect the blocks in my graph by defining a node to the left of a node in the center and drawing an arrow from bottom to that node and then from that node to the top.
Is there any way to connect the bottom and top nodes with one arrow and make it go through that node (or better yet, automatically make it avoid intersections with the existing blocks)?
As a minor note:
I was not able to get rid of the gap in the start and end points of the arrows, any help with that would also be appreciated.
Also, since i used linebreaks in the box text, the spacing between the boxes was off and i resorted to manually spacing them. Is there a better way to do this?
\documentclass[12pt, a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,calc}
\begin{document}
\tikzstyle{block} = [draw, rectangle,
minimum height=3em, minimum width=20em]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node [input, name=input] {};
\node [block, below of=input, align=left] (reseter)
{$Betrag\ von\ X_{w}^{(i)}(mS, \omega)\ zur\ddot{u}cksetzen:$\\
$\hat{X}_{w}^{(i)}(mS, \omega)=|Y_{w}(mS, \omega)|\cdot
e^{j\angle X_{w}^{(i)}(mS, \omega)}$};
\node [block, below= 1cm of reseter, align=left] (estimator)
{$Signalsch\ddot{a}tzung\ von\ X_{w}^{(i)}(mS, \omega):$\\
$x^{(i+1)}(n) = \frac {\displaystyle \sum \limits_{m=-\infty}^{\infty}
w (mS-n) \cdot \hat x_w^{(i)} (mS,n) }
{\displaystyle \sum \limits_{m=-\infty}^{\infty} w^2 (mS-n)}$};
\node [output, below=1.2cm of estimator] (output){};
\draw [->] (input) -- node {$x^{(i)}(n)$} (reseter);
\draw [->] (reseter) -- node [name=X] {$\hat{X}_{w}^{(i)}(mS, \omega)$} (estimator);
\draw [->] (estimator) -- node {$x^{(i+1)}(n)$} (output);
\node [above = 0.5cm of output] (fbs) {};
\node [below = 0.5cm of input] (fbe) {};
\node [left=5cm of X] (fb) {};
\draw [->] (fbs) -| (fb);
\draw [->] (fb) |- (fbe);
\end{tikzpicture}
\end{document}
\coordinate [left=5cm of X] (fb);
to avoid the gap. Similarly forfbs
andfbe
. Nodes always have some dimension unless you force them not to. Coordinates are automatically points. So they don't add any marginal separation around their contents as nodes do (even when there is no content).\draw [->] (fbs) -| ($(reseter.west)+(-1,0)$) |- (fbe);