\documentclass[border=10pt]{standalone}  
\usepackage{tikz}
\usepackage[european,siunitx,rotatelabels]{circuitikzgit}
\usetikzlibrary{arrows,calc,positioning}

\newcommand{\divider}[1] 
{  % #1 = name 
\begin{scope}[transform shape]
\draw[thick] (#1)node[](a){} +(-12pt,-12pt) rectangle +(12pt,12pt);
\draw (a)+(12pt, 12pt)--+(-12pt,-12pt);
\draw (a)+(-5pt,6pt) node[](){\footnotesize -45};
\draw (a)+(4pt,-7pt) node[](){\footnotesize +45};
\end{scope}
}


\newlength{\ResUp} \newlength{\ResDown}
\newlength{\ResLeft} \newlength{\ResRight}
\newlength{\ResRadius} \newlength{\ResMiddle}

\makeatletter
%%%% new anchors: "out A" and "out B"
\expandafter\def\csname pgf@anchor@rectangle@out A\endcsname{% output A: below .east
    \pgf@process{\southwest}%
    \pgf@ya=0.25\pgf@y%
    \pgf@process{\northeast}%
    \pgf@y=0.75\pgf@y%
    \advance\pgf@y by\pgf@ya    }% end of out A
\expandafter\def\csname pgf@anchor@rectangle@out B\endcsname{% output B: above .east
    \pgf@process{\southwest}%
    \pgf@ya=0.75\pgf@y%
    \pgf@process{\northeast}%
    \pgf@y=0.25\pgf@y%
    \advance\pgf@y by\pgf@ya    } % end of out B
\expandafter\def\csname pgf@anchor@rectangle@DUT\endcsname{% output DUT: above .east
    \pgf@process{\southwest}%
    \pgf@ya=0.1\pgf@y%
    \pgf@process{\northeast}%
    \pgf@y=0.9\pgf@y%
    \advance\pgf@y by\pgf@ya    } % end of DUT
\expandafter\def\csname pgf@anchor@rectangle@ret p\endcsname{% output ret p: above .east
    \pgf@process{\northeast}%
    \pgf@ya=0.9\pgf@y%
    \pgf@process{\southwest}%
    \pgf@y=0.1\pgf@y%
    \advance\pgf@y by\pgf@ya    } % end of ret p
\expandafter\def\csname pgf@anchor@rectangle@ret n\endcsname{% output ret n: above .east
    \pgf@process{\northeast}%
    \pgf@ya=0.7\pgf@y%
    \pgf@process{\southwest}%
    \pgf@y=0.3\pgf@y%
    \advance\pgf@y by\pgf@ya    } % end of ret n
\expandafter\def\csname pgf@anchor@rectangle@ret c\endcsname{% output ret c: above .east
    \pgf@process{\northeast}%
    \pgf@ya=0.8\pgf@y%
    \pgf@process{\southwest}%
    \pgf@y=0.2\pgf@y%
    \advance\pgf@y by\pgf@ya    } % end of ret c


\def\TikzBipolePath#1#2{\pgf@circ@bipole@path{#1}{#2}}
\def\CircDirection{\pgf@circ@direction}
%\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
\let\ResLen=\pgf@circ@Rlen
\makeatother

\newcommand{\Compass}% define anchors for compass points
{\anchor{north east}{\northeast}
\anchor{south west}{\southwest}
\anchor{north}{\pgfextracty{\ResUp}{\northeast}\pgfpoint{0cm}{\ResUp}}
\anchor{north west}{\pgfextracty{\ResUp}{\northeast}\pgfextractx{\ResLeft}{\southwest}\pgfpoint{\ResLeft}{\ResUp}}
\anchor{west}{\pgfextractx{\ResLeft}{\sosuthwest}\pgfpoint{\ResLeft}{0cm}}
\anchor{south}{\pgfextracty{\ResDown}{\southwest}\pgfpoint{0cm}{\ResDown}}
\anchor{south east}{\pgfextracty{\ResDown}{\southwest}\pgfextractx{\ResRight}{\northeast}\pgfpoint{\ResRight}{\ResDown}}
\anchor{east}{\pgfextractx{\ResRight}{\northeast}\pgfpoint{\ResRight}{0cm}}}

% ***************************** ADC *********************************
% extra anchors out,in1,in2,vref

\ctikzset{bipoles/ADC/width/.initial=1}
\ctikzset{bipoles/ADC/height/.initial=.5}
\ctikzset{bipoles/ADC/middle/.initial=-.25}
\ctikzset{bipoles/ADC/part/.initial={}}

\def\drawADC{% used by both bipole and node
  \ResRight=\ctikzvalof{bipoles/ADC/width}\ResLen
  \ResRight=0.5\ResRight
  \ResLeft=-\ResRight
  \ResUp=\ctikzvalof{bipoles/ADC/height}\ResLen
  \ResUp=0.5\ResUp
  \ResDown=-\ResUp
  \ResMiddle=\ctikzvalof{bipoles/ADC/middle}\ResLen
  \pgfpathmoveto{\pgfpoint{\ResLeft}{0pt}}
  \pgfpathlineto{\pgfpoint{\ResMiddle}{\ResUp}}
  \pgfpathlineto{\pgfpoint{\ResRight}{\ResUp}}
  \pgfpathlineto{\pgfpoint{\ResRight}{\ResDown}}
  \pgfpathlineto{\pgfpoint{\ResMiddle}{\ResDown}}
  \pgfpathlineto{\pgfpoint{\ResLeft}{0pt}}
  \pgfpathclose
  \pgfusepath{draw}
  \pgftext{\texttt{\ctikzvalof{bipoles/ADC/part}}}
}

\pgfcircdeclarebipole{}% no extra anchors for bipole version
  {\ctikzvalof{bipoles/ADC/height}}
  {ADC}
  {\ctikzvalof{bipoles/ADC/height}}
  {\ctikzvalof{bipoles/ADC/width}}
  {\pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}\drawADC}

\def\ADCpath#1{\TikzBipolePath{ADC}{#1}}
\tikzset{ADC/.style = {\circuitikzbasekey, /tikz/to path=\ADCpath, l_=#1}}

\pgfdeclareshape{dADC}{%
\anchor{center}{\pgfpointorigin}    % within the node, (0,0) is the center

\anchor{text}   % this is used to center the text in the node
    {\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}

\savedmacro{\resize}{   % called automatically
  \ResRight=\ctikzvalof{bipoles/ADC/width}\ResLen
  \ResRight=0.5\ResRight
  \ResLeft=-\ResRight
  \ResUp=\ctikzvalof{bipoles/ADC/height}\ResLen
  \ResUp=0.5\ResUp
  \ResDown=-\ResUp
  \ResMiddle=\ctikzvalof{bipoles/ADC/middle}\ResLen
  \ResRadius=\ResMiddle% location of in1 and in2
  \advance\ResRadius by \ResLeft
  \ResRadius=0.5\ResRadius
}% while these can be used for savedanchors, they will be fogotten by anchors

\savedanchor{\northeast}{\pgfpoint{\ResRight}{\ResUp}}
\savedanchor{\southwest}{\pgfpoint{\ResLeft}{\ResDown}}

\savedanchor\InOne{\pgfpoint{\ResRadius}{0.5\ResUp}}
\savedanchor\InTwo{\pgfpoint{\ResRadius}{0.5\ResDown}}
\savedanchor\Out{\pgfpoint{\ResRight}{0pt}}
\savedanchor\Vref{\pgfpoint{0pt}{\ResDown}}

\Compass% standard anchors

\anchor{in1}{\InOne}
\anchor{in2}{\InTwo}
\anchor{out}{\Out}
\anchor{vref}{\Vref}

\foregroundpath{
  \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
  \drawADC}
}


\tikzset%
{
splitter/.style = {rectangle, draw, semithick, minimum height=15mm, minimum width=15mm,
                            append after command={\pgfextra{\let\LN\tikzlastnode
     \draw[thick] (\LN.west) -- ([xshift=-4mm] \LN.center)
                             -- ([xshift=-8mm] \LN.out A)
                             -- (\LN.out A)
  ([xshift=-4mm] \LN.center) -- ([xshift=-8mm] \LN.out B)
                             -- (\LN.out B);
    \node[above left=0.35cm and 0cm,font=\footnotesize] at (\LN.east) {\SI{-1}{\decibel}};
    \node[below left=0.35cm and 0cm,font=\footnotesize] at (\LN.east) {\SI{-25}{\decibel}};
                                                }}
                        },
         splitter/.default = {}
}

\tikzset%
{
synthesizer/.style ={rectangle, draw, semithick, minimum height=20mm, minimum width=25mm,
                            append after command={\pgfextra{\let\LN\tikzlastnode
    \node[draw, right=0.15cm,font=\footnotesize, anchor=west](pll) at (\LN.west) {PLL};
    \node[oscillator,box,left=0.15cm,anchor=east](osc) at ( \LN.east){};
    \node[anchor=north] at(\LN.north){#1};
\draw[-latex] (pll.east)--(osc.west);
\draw[-latex] (osc.south)--++(0,-0.2cm)-|(pll.south);
                                                }}
                        },
         synthesizer/.default = {}
}

\tikzset%
{
RLB/.style ={rectangle, draw, semithick, minimum height=25mm, minimum width=30mm,
                            append after command={\pgfextra{\let\LN\tikzlastnode
	\draw(\LN.south) to[short,-*]++(0,0.5)--++(0.8,0) to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] ++(0,1) |- (\LN.DUT);
	\draw(\LN.south) ++(0,0.5) to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] ++(0,1) -- (\LN.south|-\LN.ret n) to[short,-*]++(-0.8,0)
 		++(0,-1) node[ground,/tikz/circuitikz/bipoles/length=1cm]{} to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] ++(0,1) |- (\LN.ret n);
	\draw (\LN.south|-\LN.DUT)++(0.8,0) to[short, *-] (\LN.ret p);

                                                }}
                        },
         RLB/.default = {}
}

\tikzset%
{
RLBinv/.style ={rectangle, draw, semithick, minimum height=25mm, minimum width=30mm,yscale=-1,
                            append after command={\pgfextra{\let\LN\tikzlastnode
	\draw(\LN.south) to[short,-*]++(0,-0.5)--++(0.8,0) to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] ++(0,-1) |- (\LN.DUT);
	\draw(\LN.south) ++(0,-0.5) to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] ++(0,-1) -- (\LN.south|-\LN.ret n) to[short,-*]++(-0.8,0)
 		++(0,1) node[ground,/tikz/circuitikz/bipoles/length=1cm,yscale=-1]{} to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] ++(0,-1) |- (\LN.ret n);
	\draw (\LN.south|-\LN.DUT)++(0.8,0) to[short, *-] (\LN.ret p);

                                                }}
                        },
         RLBinv/.default = {}
}

\begin{document}  

\begin{circuitikz}
% SI5351
\node[synthesizer={Si5351C},label={[align=center]LF Source\\CLK Distributor\\2.LO}] (Si5351) at (-3,0) {};
\node[anchor=east] (refin) at (-5, 0.8){\SI{10}{\mega\hertz} in};
\node[anchor=east] (refout) at (-5, 0.4){\SI{10}{\mega\hertz} out};
\draw[-latex](refin.east)--(refin.east-|Si5351.west);
\draw[latex-](refout.east)--(refout.east-|Si5351.west);
\draw (-6,-0.8)  to [PZ,l_=$\SI{26}{\mega\hertz}$,/tikz/circuitikz/bipoles/length=1cm,n=crystal] (-5,-0.8);
\draw(crystal.east)--(crystal.east-|Si5351.west);
\draw(crystal.west)--++(-0.5, 0) |-(Si5351.west);

% HF Source
\node[synthesizer={MAX2871},label={[align=center]HF Source}] (HFSource) at (1,0) {};
\draw[-latex] (Si5351.east) -- (HFSource.west) node[midway,above,font=\footnotesize]{\SI{100}{\mega\hertz}} ;
% Filter bank
\draw (HFSource.east) -- ++(0.5,0)
    node[rotary switch <->=4 in 60 wiper 60, anchor=in](swfiltin){};
\node[above=1.5cm, rotate=90,font=\footnotesize] at (swfiltin){RFSW6024};
\draw (8,0) -- ++(-0.5,0)
   node[rotary switch <->=4 in 60 wiper 60, anchor=in, xscale = -1](swfiltout){};
\node[above right=0.6cm and 0.5cm, rotate=90,font=\footnotesize] at (swfiltout){RFSW6024};
\draw (swfiltin.out 1) |- (4, 1.5) to[lowpass, l=\SI{900}{\mega\hertz}, font=\footnotesize] ++(2,0) -| (swfiltout.out 1);
\draw (swfiltin.out 2) |- (4, 0) to[lowpass, l=\SI{1800}{\mega\hertz}, font=\footnotesize] ++(2,0) -| (swfiltout.out 2);
\draw (swfiltin.out 3) |- (4, -1.5) to[lowpass, l=\SI{3500}{\mega\hertz}, font=\footnotesize] ++(2,0) -| (swfiltout.out 3);
\draw (swfiltin.out 4) |- ++(0,-1.5) -| (swfiltout.out 4);

\draw (swfiltout.in) -- ++(0.5,0)
   node[rotary switch <->=2 in 30 wiper -30, anchor=out 2, xscale = -1](bandselect){};
\node[above right=0.2cm and 0.3cm, rotate=90,font=\footnotesize] at (bandselect){QPC6324};
\draw (Si5351.east)++(0,0.5)-|++(1,2) to[lowpass, l=\SI{40}{\mega\hertz}, font=\footnotesize] ++(4,0) -|(bandselect.out 1)  node[midway,above, anchor=south east,font=\footnotesize]{\SIrange{1}{25}{\mega\hertz}} ;

%Attenuation and amplifier and splitter
\draw (bandselect.in) to[vpiattenuator,label={RFSA3714}, font=\footnotesize] ++(2,0) to[amp, font=\footnotesize, label={TRF37A73},n=amp]++(2,0) node[splitter, label={},anchor=west](s){};
% Port select switch
\draw (s.out A)--++(2,0)node[rotary switch <->=2 in 30 wiper 30, anchor=in](portselect){};
\draw (portselect.out 1)--++(0.5,0)node[rotary switch <->=2 in 30 wiper -30, anchor=out 2, xscale=-1](port1switch){};
\draw (portselect.out 2)--++(0.5,0)node[rotary switch <->=2 in 30 wiper -30, anchor=out 1, xscale=-1](port2switch){};
\draw (port1switch.out 1) to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}]++(0,1) node[ground,yscale=-1]{};
\draw (port2switch.out 2) ++(0,-1) node[ground]{} to[R,/tikz/circuitikz/bipoles/length=1cm,l=\SI{50}{\ohm}] (port2switch.out 2);
\node[right=1cm of portselect]{3x QPC6324};

% Port1 signal flow
\draw (port1switch.in) -| ++(2,2) node[RLB, anchor=south](rlb1){};
\draw[latex-latex](rlb1.DUT)--++(1,0)node[anchor=west]{Port 1};
\node[mixer, box,left = 3cm of rlb1.ret c] (mix11){};
\node[anchor=south, font=\footnotesize] at (mix11.north){ADL5801};
\draw[-latex](rlb1.ret p)--(rlb1.ret p-|mix11.east);
\draw[-latex](rlb1.ret n)--(rlb1.ret n-|mix11.east);
\draw(mix11.west)++(-1,0) to[lowpass, l_=\SI{70}{\mega\hertz}, font=\footnotesize]++(-1,0);
\draw[-latex]([yshift=-2mm]mix11.west)--++(-1,0);
\draw[-latex]([yshift=2mm]mix11.west)--++(-1,0);

\node[mixer, box,left = 3cm of mix11](mix12){};
\node[anchor=south, font=\footnotesize] at (mix12.north){LT5560};
\draw(mix12.west)++(-2.5,0) to[lowpass, l_=\SI{300}{\kilo\hertz}, font=\footnotesize, n=lowpass1]++(-1,0);
\draw[-latex]([yshift=-2mm]mix12.west)--++(-1,0);
\draw[-latex]([yshift=2mm]mix12.west)--++(-1,0);
\draw[latex-]([yshift=-2mm]mix12.east)--++(1,0);
\draw[latex-]([yshift=2mm]mix12.east)--++(1,0);

\draw(mix12.west)++(-1,0) to[amp, l_={THS4521}, font=\footnotesize, n=amp1]++(-1,0);

\node[dADC,left=5.5cm of mix12,xscale=-1] (ADC1) {};
\node[font=\footnotesize] at (ADC1){ADC};
\node[anchor=south, font=\footnotesize] at (ADC1.north){MCP33131D-10};
\draw[latex-](ADC1.in1)--(ADC1.in1-|lowpass1.east);
\draw[latex-](ADC1.in2)--(ADC1.in2-|lowpass1.east);
\draw[latex-](ADC1.in1-|lowpass1.west)--([xshift=0.3cm]ADC1.in1-|amp1.east);
\draw[latex-](ADC1.in2-|lowpass1.west)--([xshift=0.3cm]ADC1.in2-|amp1.east);

% Reference signal flow
\node[mixer, box,below left = 9cm and 5cm of rlb1.ret c] (mixr1){};
\node[anchor=south, font=\footnotesize] at (mixr1.north){ADL5801};
\draw(mixr1.west)++(-1,0) to[lowpass, l_=\SI{70}{\mega\hertz}, font=\footnotesize]++(-1,0);
\draw[-latex]([yshift=-2mm]mixr1.west)--++(-1,0);
\draw[-latex]([yshift=2mm]mixr1.west)--++(-1,0);

\node[mixer, box,left = 3cm of mixr1](mixr2){};
\node[anchor=south, font=\footnotesize] at (mixr2.north){LT5560};
\draw(mixr2.west)++(-2.5,0) to[lowpass, l_=\SI{300}{\kilo\hertz}, font=\footnotesize, n=lowpass2]++(-1,0);
\draw[-latex]([yshift=-2mm]mixr2.west)--++(-1,0);
\draw[-latex]([yshift=2mm]mixr2.west)--++(-1,0);
\draw[latex-]([yshift=-2mm]mixr2.east)--++(1,0);
\draw[latex-]([yshift=2mm]mixr2.east)--++(1,0);

\draw(mixr2.west)++(-1,0) to[amp, l_={THS4521}, font=\footnotesize, n=amp2]++(-1,0);

\node[dADC,left=5.5cm of mixr2,xscale=-1] (ADC1) {};
\node[font=\footnotesize] at (ADC1){ADC};
\node[anchor=south, font=\footnotesize] at (ADC1.north){MCP33131D-10};
\draw[latex-](ADC1.in1)--(ADC1.in1-|lowpass2.east);
\draw[latex-](ADC1.in2)--(ADC1.in2-|lowpass2.east);
\draw[latex-](ADC1.in1-|lowpass2.west)--([xshift=0.3cm]ADC1.in1-|amp2.east);
\draw[latex-](ADC1.in2-|lowpass2.west)--([xshift=0.3cm]ADC1.in2-|amp2.east);

\draw[-latex] (s.out B)--++(0.25,0)|-(mixr1.east);

% Port2 signal flow
\draw (port2switch.in) -| ++(2,-7) node[RLBinv, anchor=south](rlb1){};
\draw[latex-latex](rlb1.DUT)--++(1,0)node[anchor=west]{Port 2};
\node[mixer, box,left = 5cm of rlb1.ret c] (mix21){};
\node[anchor=north, font=\footnotesize] at (mix21.south){ADL5801};
\draw[-latex](rlb1.ret p)--(rlb1.ret p-|mix21.east);
\draw[-latex](rlb1.ret n)--(rlb1.ret n-|mix21.east);
\draw(mix21.west)++(-1,0) to[lowpass, l=\SI{70}{\mega\hertz}, font=\footnotesize]++(-1,0);
\draw[-latex]([yshift=-2mm]mix21.west)--++(-1,0);
\draw[-latex]([yshift=2mm]mix21.west)--++(-1,0);

\node[mixer, box,left = 3cm of mix21](mix22){};
\node[anchor=north, font=\footnotesize] at (mix22.south){LT5560};
\draw(mix22.west)++(-2.5,0) to[lowpass, l=\SI{300}{\kilo\hertz}, font=\footnotesize,n=lowpass3]++(-1,0);
\draw[-latex]([yshift=-2mm]mix22.west)--++(-1,0);
\draw[-latex]([yshift=2mm]mix22.west)--++(-1,0);
\draw[latex-]([yshift=-2mm]mix22.east)--++(1,0);
\draw[latex-]([yshift=2mm]mix22.east)--++(1,0);

\draw(mix22.west)++(-1,0) to[amp, l={THS4521}, font=\footnotesize, n=amp3]++(-1,0);

\node[dADC,left=5.5cm of mix22,xscale=-1] (ADC1) {};
\node[font=\footnotesize] at (ADC1){ADC};
\node[anchor=north, font=\footnotesize] at (ADC1.south){MCP33131D-10};
\draw[latex-](ADC1.in1)--(ADC1.in1-|lowpass3.east);
\draw[latex-](ADC1.in2)--(ADC1.in2-|lowpass3.east);
\draw[latex-](ADC1.in1-|lowpass3.west)--([xshift=0.3cm]ADC1.in1-|amp3.east);
\draw[latex-](ADC1.in2-|lowpass3.west)--([xshift=0.3cm]ADC1.in2-|amp3.east);

%LO1
\node[synthesizer={MAX2871},label={[align=center]1.LO}] (lo1) at (1,-3) {};
\draw[-latex] (Si5351.east)++(0,-0.5) --++(1,0) |- (lo1.west) node[midway,above,rotate=90,font=\footnotesize]{\SI{100}{\mega\hertz}} ;
\draw[-latex] (lo1.east)--++(0.5,0) |- ([yshift=-1cm]mixr1.south) coordinate(lo1split) to[short,*-](mixr1.south);
\draw[-latex] (lo1split)--(mix21.north);
\draw[-latex] (lo1split)-|(mix11.south);

%LO2 connections
\draw[-latex] (Si5351.east)++(0,0.8) -|++(0.5,3) -| (mix12.south);
\draw[-latex] (Si5351.east)++(0,-0.8) --++(0.5,0) |- ([yshift=-3cm]mixr2.south) coordinate(lo2split) to[short,*-](mixr2.south);
\draw[-latex] (lo2split)--(mix22.north);

\end{circuitikz}
\end{document}
