3

I would like to add lines outside 2 short lines as input to the T^-1 box, see the attached figure.enter image description here

The code is listed below:

\documentclass[tikz,border=2mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{chains,fit,positioning,shapes.multipart}
\begin{document}
% Version 3t
\begin{tikzpicture}[
 node distance = 20mm and 5mm,
 start chain = going right,
  block/.style = {draw, minimum height=20mm, minimum width=5mm,
                 font=\boldmath,on chain},
  block4/.style={block,rectangle split,rectangle split parts=4}]
% upper blocks
\node (ht1)   [block,draw=none]
{\hphantom{$\boldmath(H)^+$}};
\node (f1)    [block,right=6mm of ht1]     {$T^{-1}_{1}$};
\node (y1)    [block,right=39mm of ht1]     {$T_1$};
\node (adc1)  [block4] {ADC\nodepart{two}ADC\nodepart{three}ADC\nodepart{four}ADC};
% lower blocks
\node (ht2)   [block,draw=none,below=of ht1]
{\hphantom{$\boldmath(H)^+$}};
\node (f2)    [block,right=6mm of ht2]     {$T^{-1}_L$};
\node (y2)    [block,right=39mm of ht2]     {$T_L$};
\node (adc2)  [block4] {ADC\nodepart{two}ADC\nodepart{three}ADC\nodepart{four}ADC};
% common input nodes
\node (in2)   [draw,inner sep=0pt, fit=(ht1)  (ht2),label=center:$\boldmath H^+$] {};
% top blocks
    \node (cpu) [above=15mm of in2]     {CPU};
    \node (rf)  [above=15mm of y1]      {RF-chain};

% Math symbols
    %\node at (42mm,15mm) (g1) {$\boldmath Y_1$};

    \node (Y) at (53mm,18mm) {$\boldmath y_1$};
    \draw [->] (Y) -- (53mm,10mm);

    \node (Y2) at (53mm,-23mm) {$\boldmath y_L$    
};
    \draw [->] (Y2) -- (53mm,-30mm);

    \node (Z) at (41mm,6mm) {$\boldmath z_1$};
    \node (Z2) at (41mm,-34mm) {$\boldmath z_L$};

    \node (x) at (-12mm,11mm) {$\boldmath \hat{x}$};

\draw[densely dotted] ([xshift=29mm] cpu.north -| in2.east) coordinate (in3)
                    -- (in3 |- in2.south);
% lines between blocks
    \foreach \y in {-0.75, -0.25, 0.25, 0.75}
{
% 8 input lines
    \draw [->]  ([yshift=\y cm +2 cm] in2.west)--++(180:1cm);
    \draw [->]  ([yshift=\y cm -2 cm] in2.west)--++(180:1cm);
}
% 2 lines between other blocks
    \foreach \j in {1,2}
{
        \foreach \y/\anchor  in {-0.25/two east, 0.25/three east, 0.75/four east, -0.75/text east}
        {
            \foreach \i [remember=\i as \lasti (initially y\j)] in {adc\j}
    \draw [<-] ([yshift= \y cm ]\lasti.east)--([yshift=\y cm]\i.west);
    \draw (-1,-2.0) circle [radius=0.7pt,yshift=-0 cm -\y cm];
    \draw (3.95,-2.0) circle [radius=0.7pt,yshift=-0 cm -\y cm];
    %\draw (0,-1) -- (4,-1);
    %\draw ([yshift= 0.5 cm -\y cm] adc\j.east)--++(0:1+1.5*\y)   node[antenna] {};
    \draw ([yshift=-0 cm -\y cm] adc\j.east)--++([xshift=1.5cm] 0:1+1.5*\y)   node[antenna] {};
    }

    \foreach \y  in {-0.25, 0.25}
        {
            \foreach \i [remember=\i as \lasti (initially f\j)] in { y\j}
    \draw [<-] ([yshift= \y cm ]\lasti.east)--([yshift=\y cm]\i.west);
    }

    \foreach \y  in {-0.25, 0.25, 0.75, -0.75}
        {
            \foreach \i [remember=\i as \lasti (initially ht\j)] in { f\j}
    \draw [<-] ([yshift= \y cm ]\lasti.east)--([yshift=\y cm]\i.west);
    }
}
\end{tikzpicture}
\end{document}
3

Here is one way, using the calc library. The coordinate ($(a.south east)!0.2!(a.north east)$) is 20% of the way along the line from the lower right corner of the node a to the upper right corner. The + indicates that the coordinate +(1cm,0) is relative to the previous coordinate, so one cm to the right.

I used a shorter example to focus on the method itself.

enter image description here

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node [draw,minimum height=3cm] (a) {};
\draw [<-] ($(a.south east)!0.2!(a.north east)$) -- +(1cm,0) node[right]{0};
\draw [<-] ($(a.south east)!0.8!(a.north east)$) -- +(1cm,0) node[right]{0};
\end{tikzpicture}
\end{document}

And for good measure, a method that doesn't use the calc library, but relies on defining two helper coordinates:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node [draw,minimum height=3cm] (a) {};
\path (a.south east) -- (a.north east)
      coordinate [pos=0.2] (p1)
      coordinate [pos=0.8] (p2);
\draw [<-] (p1) -- +(1cm,0) node[right]{0};
\draw [<-] (p2) -- +(1cm,0) node[right]{0};
\end{tikzpicture}
\end{document}
  • Just wondering here, what is the difference between the +(coord) and ++(coord) , for some reason I've always used the later – daleif May 29 '16 at 19:19
  • @daleif ++ also changes the reference point, so \draw (0,0) -- +(1,0) -- +(0,1); draws a line from (0,0) to (1,0) to (0,1), but if you use ++ the last point is at (1,1). – Torbjørn T. May 29 '16 at 19:21
  • Ahh that is why I used it, I thought it made more sense – daleif May 29 '16 at 19:30

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.