% Some basic examples for signal flow diagrams.
%
% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
% Version: 0.1
% Date: 2007/01/05
\documentclass{article}
\usepackage{signalflowdiagram}

\begin{document}

%
% Basic definitions of the symbols used in a signal flow diagram
%

% - input terminal
\begin{signalflow}{Input terminal}
   \node[input]      (in)                 {$x(t)$};
   \node[coordinate] (c)  [right from=in] {};
   % signal path
   \path[r>] (in) -- (c);
\end{signalflow}

% - output terminal
\begin{signalflow}{Output terminal}
   \node[output]     (out)                {$y(t)$};
   \node[coordinate] (c)  [left from=out] {};
   % signal path
   \path[r>] (c) -- (out);
\end{signalflow}

% - branching node
\begin{signalflow}{Branching node}
   \node[input]  (in)                          {$x(t)$};
   \node[node]   (nd)    [right from=in]       {};
   \node[output] (out1)  [above right from=nd] {$x(t)$};
   \node[output] (out2)  [below right from=nd] {$x(t)$};
   % signal paths
   \path[r>] (in) -- (nd);
   \path[r>] (nd) |- (out1);
   \path[r>] (nd) |- (out2);
\end{signalflow}

% - multiplier
\begin{signalflow}{Multiplier}
   \node[input]      (in)                     {$x(t)$};
   \node[multiplier] (mul)   [right from=in]  {\nodepart{above}{$\alpha$}};
   \node[output]     (out)   [right from=mul] {$\alpha x(t)$};
   % signal paths
   \path[r>] (in)  -- (mul);
   \path[r>] (mul) -- (out);
\end{signalflow}

% - adder
\begin{signalflow}{Adder}
   \node[adder]  (add)                       {};
   \node[input]  (in1) [above left from=add] {$x_1(t)$};
   \node[input]  (in2) [below left from=add] {$x_2(t)$};
   \node[output] (out) [right from=add]      {$x_1(t)+x_2(t)$};
   % signal paths
   \path[r>] (in1) -| (add);
   \path[r>] (in2) -| (add);
   \path[r>] (add) -- (out);
\end{signalflow}

% - modulator
\begin{signalflow}{Modulator}
   \node[modulator] (mul)                       {};
   \node[input]     (in1) [above left from=mul] {$x_1(t)$};
   \node[input]     (in2) [below left from=mul] {$x_2(t)$};
   \node[output]    (out) [right from=mul]      {$x_1(t)x_2(t)$};
   % signal paths
   \path[r>] (in1) -| (mul);
   \path[r>] (in2) -| (mul);
   \path[r>] (mul) -- (out);
\end{signalflow}

% - delay element
\begin{signalflow}{Delay element}
   \node[input]  (in)                   {$x(t)$};
   \node[delay]  (del) [right from=in]  {$T$};
   \node[output] (out) [right from=del] {$x(t-T)$};
   % signal paths
   \path[r>] (in)  -- (del);
   \path[r>] (del) -- (out);
\end{signalflow}

% - filter
\begin{signalflow}{Filter}
   \node[input]  (in)                   {$x(t)$};
   \node[filter] (fil) [right from=in]  {$q(t)$};
   \node[output] (out) [right from=fil] {$x(t)\ast q(t)$};
   % signal paths
   \path[r>] (in)  -- (fil);
   \path[r>] (fil) -- (out);
\end{signalflow}

% - building block
\begin{signalflow}{Building block of a minimum shift keying modulator}
   \node[input] (in)                   {$x(t)$};
   \node[block] (msk) [right from=in]  {Minimum shift keying modulator};
   \node[output](out) [right from=msk] {$z(t)$};
   % signal paths
   \path[r>] (in)  -- (msk);
   \path[r>] (msk) -- (out);
\end{signalflow}

% - MSK symbol encoder
\begin{signalflow}{Minimum shift keying symbol encoder}
   \node[input]      (in)                   {$x(t)$};
   \node[modulator]  (mod) [right from=in]  {};
   \node[multiplier] (mul) [below from=mod] {$\mathrm{j}$};
   \node[delay]      (del) [right from=mod] {$T$};
   \node[node]       (nd)  [right from=del] {};
   \node[output]     (out) [right from=nd]  {$y(t)$};
   % signal paths
   \path[c>] (in)  -- (mod);
   \path[c>] (mod) -- (del);
   \path[c>] (del) -- (nd);
   \path[c>] (nd)  |- (mul);
   \path[c>] (mul) -- (mod);
   \path[c>] (nd)  -- (out);
\end{signalflow}


\end{document}
