3

Im trying to prepare a research note on the relay communication field, I tried to draw the following diagram in LaTeX (TikZ) but I didn't succeed to draw it good enough...

Can anybody help me to draw the following diagram in LaTeX? The 'H's are bold for example

${\mathbf H}_0$...

enter image description here

5
  • 3
    Take a look a tikz (paws.wcu.edu/tsfoguel/tikzpgfmanual.pdf) and the examples posted on TeXample (texample.net/tikz/examples/tag/diagrams) for examples. – Laura Jun 18 '13 at 6:09
  • 1
    Thank you so much Laura, The book seems to be very helpful. I wish I could read it until tomorrow(my deadline);) – Mamal Jun 18 '13 at 6:20
  • 3
    Maybe draw it using Inkscape and then use the tikz exporter? code.google.com/p/inkscape2tikz/ – rickhg12hs Jun 18 '13 at 6:29
  • 3
    Please include the version you don't like so users here can make it better. Otherwise starting from scratch is really not fun. – percusse Jun 18 '13 at 6:31
  • 2
    ass an addition on @rickhg12hs: you can also draw it using DIA and then export it as tikz... – long tom Jun 18 '13 at 7:11
8

I know I shouldn't do it, but if you promise to start studying TiKZ the day after your deadline ( ;-) ) you can use next code.

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning,arrows}

\newcommand{\antena}{--++(3mm,0)--++(30:5mm)--++(-90:5mm)--++(150:5mm);}
\begin{document}

\begin{tikzpicture}[>=stealth',
box/.style={rectangle,draw,minimum width=3cm,minimum height=2cm},
line/.style={->,shorten >=3mm, shorten <=3mm}]

\node[box] (source) {Source};
\node[box, right=5cm of source] (dest) {Destination};
\node[box, above right=2.5cm and 2.5cm of source, anchor=center] (relay) {Relay};

\draw[line] (source.north) -- node[above,sloped] {First Time Slot} node[below,sloped]{${\mathbf H}_0$} (relay.west); 

\draw[line] ([xshift=5mm]source.east) -- node[below,sloped] {First Time Slot} node[above,sloped]{${\mathbf H}_1$} ([xshift=-5mm]dest.west); 

\draw[line,dashed] (relay.east) -- node[above,sloped] {Second Time Slot} node[below,sloped]{${\mathbf H}_2$} (dest.north); 

\draw (source.20) \antena;
\draw (source.-20) \antena;
\node[right=3mm] at ([yshift=1mm]source.east) {\vdots};

\draw[rotate=180] (dest.160) \antena;
\draw[rotate=180] (dest.-160) \antena;
\node[left=3mm] at ([yshift=1mm]dest.west) {\vdots};

\draw[rotate=-90] (relay.-50) \antena;
\draw[rotate=-90] (relay.230) \antena;
\node[below=3mm] at (relay.south) {\dots};
\end{tikzpicture}
\end{document}

enter image description here

1
  • Thats good...:) thank you so much.... I promiss....:) – Mamal Jun 18 '13 at 8:09
0

Here is a slightly modified version of the above code in which the antennas are upward.

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning,arrows}
\newcommand{\antena}{--++(5mm,0)--++(90:3mm)--++(60:5mm)--++(-180:5mm)--++(-60:5mm);} %
\newcommand{\reverseantena}{--++(-5mm,0)--++(90:3mm)--++(60:5mm)--++(-180:5mm)--++(-60:5mm);} %
\begin{document}
\begin{tikzpicture}[>=stealth',
box/.style={rectangle,draw,minimum width=3cm,minimum height=2cm},
line/.style={->,shorten >=3mm, shorten <=3mm}]
\node[box] (source) {Source};
\node[box, right=5cm of source] (dest) {Destination};
\node[box, above right=2.5cm and 2.5cm of source, anchor=center] (relay) {Relay};
\draw[line] (source.north) -- node[above,sloped] {First Time Slot} node[below,sloped]{${\mathbf H}_0$} ([xshift=-4mm,yshift=-4mm]relay.west);
\draw[line] ([xshift=5mm]source.east) -- node[below,sloped] {First Time Slot} node[above,sloped]{${\mathbf H}_1$} ([xshift=-5mm]dest.west);
\draw[line,dashed, blue] ([xshift=4mm,yshift=-4mm]relay.east) -- node[above,sloped, blue] {Second Time Slot} node[below,sloped]{${\mathbf H}_2$} (dest.north);
\draw (source.20) \antena;
\draw (source.-20) \antena;
\node[right=0mm] at ([yshift=1mm]source.east) {\vdots};
\draw[rotate=0] (dest.160) \reverseantena;
\draw[rotate=0] (dest.-160) \reverseantena;
\node[left=0mm] at ([yshift=1mm]dest.west) {\vdots};
\draw (relay.20) \antena;
\draw (relay.-20) \antena;
\node[right=0mm] at ([yshift=1mm]relay.east) {\vdots};
\draw[rotate=0] (relay.160) \reverseantena;
\draw[rotate=0] (relay.-160) \reverseantena;
\node[left=0mm] at ([yshift=1mm]relay.west) {\vdots};
\end{tikzpicture}
\end{document}

enter image description here

0

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.