%%%%%%%%%%block diagram symbols%%%%%%
\newcommand{\ptran}{            % communication transformer
\put(0,0){\framebox(10,10){}}
\multiput(2,2)(0,6){2}{\line(1,0){2}}
\multiput(4,2)(2,0){2}{\line(0,1){6}}
\multiput(6,2)(0,6){2}{\line(1,0){2}}
}

\newcommand{\fgen}[1]{            % fequency generator
\put(0,0){\framebox(10,10){}}
\put(3.5,6){$\rm G$}
    \ifnum#1=1                    %sine
  \put(3.5,2){$\sim $}
    \else    \ifnum#1=2           %pulse
\multiput(1.5,2)(4,0){2}{\line(1,0){2}}
\multiput(3.5,2)(2,0){2}{\line(0,1){2}}
\put(3.5,4){\line(1,0){2}}
    \else \ifnum#1=3                   %sine variable fraquency
  \put(3.5,2){$\sim $}
  \put(3.5,1.5){\vector(1,1){4}}
    \fi  \fi  \fi
}
\newcommand{\converter}{          %converter
\put(0,0){\framebox(10,10){}}
\put(0,0){\line(1,1){10}}
}
\newcommand{\delay}{            % delay line
\put(0,0){\framebox(10,10){}}
\put(2,7){\line(1,0){6}}
\multiput(2,6)(6,0){2}{\line(0,1){2}}
}

\newcommand{\amplifier}[1]{        %amplifier
    \ifx#1R                    %right
\put(0,0){\line(0,1){6}}
\put(0,0){\line(3,2){4.5}}
\put(0,6){\line(3,-2){4.5}}
    \else  \ifx#1L
\put(0,0){\line(0,1){6}}
\put(0,0){\line(-3,2){4.5}}
\put(0,6){\line(-3,-2){4.5}}
     \fi \fi
}

\newcommand{\filter}[1]{          %frequency filter
\put(0,0){\framebox(10,10){}}
    \ifnum#1=1                   %low pass
  \multiput(3.5,3)(0,3){2}{$\sim $}
  \put(4.5,6){$\prime $}
    \else  \ifnum#1=2            %high pass
  \multiput(3.5,3)(0,3){2}{$\sim $}
  \put(4.5,3){$\prime $}
    \else   \ifnum#1=3           %band pass
  \multiput(3.5,1)(0,3){3}{$\sim $}
  \multiput(4.5,1)(0,6){2}{$\prime $}
    \else   \ifnum#1=4                 %band stop
  \multiput(3.5,1)(0,3){3}{$\sim $}
  \put(4.5,4){$\prime $}
    \fi \fi \fi \fi

}

\newcommand{\compressor}{          %compressor
\put(0,0){\framebox(10,10){}}
\put(6,0){\vector(1,0){0}}
\put(1,2){\line(1,0){8}}
\put(1,8){\line(2,-1){8}}
}
\newcommand{\expander}{          %expander
\put(0,0){\framebox(10,10){}}
\put(6,0){\vector(1,0){0}}
\put(1,2){\line(1,0){8}}
\put(1,4){\line(2,1){8}}
}
\newcommand{\deemphase}{          %deemphase
\put(0,0){\framebox(10,10){}}
\put(6,0){\vector(1,0){0}}
\put(2,3){\oval(11,10)[rt]}
}
\newcommand{\preemphase}{          %preemphase
\put(0,0){\framebox(10,10){}}
\put(6,0){\vector(1,0){0}}
\put(2,8){\oval(11,10)[rb]}
}
\newcommand{\artline}{          %artificial line
\put(0,0){\framebox(10,10){}}
\multiput(3.75,2.5)(0,5){2}{\line(1,0){2.5}}
\put(5,2.5){\line(0,1){5}}
}
\newcommand{\corrector}[1]{          %corrector
\put(0,0){\framebox(10,10){}}
\multiput(1,2)(3,6){2}{\line(1,0){1}}
\put(2,2){\line(1,3){2}}
\multiput(7,2)(1,6){2}{\line(1,0){1}}
\put(8,2){\line(0,1){6}}
    \ifnum#1=1                %amplitude corrector
\put(3.5,1){$\rm A$}
     \else \ifnum#1=2         %phase corrector
\put(3.5,2){$\varphi $}
      \else  \ifnum#1=3       %group delay corrector
\put(3.5,1){$\Delta $}
       \fi \fi \fi
}
\newcommand{\limiter}{          %limiter
\put(0,0){\framebox(10,10){}}
\multiput(3,2)(3,6){2}{\line(1,0){1}}
\put(4,2){\line(1,3){2}}
}

\newcommand{\balance}{          %balance circuit
\put(0,0){\framebox(10,10){}}
\put(3,2){\line(1,0){4}}
\put(5,2){\line(0,1){6}}
}
\newcommand{\termin}[1]{          %terminating set
\put(0,0){\framebox(10,10){}}
\put(2,5){\line(1,0){5}}
\put(5,2){\line(0,1){6}}
\multiput(5,2)(0,6){2}{\line(1,0){3}}
\multiput(-5,5)(15,0){2}{\line(1,0){5}}
\multiput(5,-5)(0,15){2}{\line(0,1){5}}
    \ifnum#1=1
\put(7,3.5){\line(0,1){3}}
      \fi
}
\newcommand{\hybrid}{          %hybrid transformer
\put(0,0){\framebox(10,10){}}
\put(0,5){\line(1,1){5}}
\put(0,5){\line(1,-1){5}}
\put(5,0){\line(1,1){5}}
\put(5,10){\line(1,-1){5}}
\multiput(-5,5)(15,0){2}{\line(1,0){5}}
\multiput(5,-5)(0,15){2}{\line(0,1){5}}
}
\newcommand{\modulator}{          %modulator
\put(0,0){\framebox(20,10){}}
\put(0,0){\line(1,1){10}}
\put(10,10){\line(1,-1){10}}
\multiput(-5,5)(25,0){2}{\line(1,0){5}}
\put(10,-5){\line(0,1){5}}
}
\newcommand{\atenuator}{          %atenuator
\put(0,0){\framebox(10,10){}}
\put(3,4){$\rm dB$}
}
\newcommand{\carrier}[1]{          %carrier frequency
   \ifnum#1=1
\put(0,0){\vector(0,1){10}} %carrier
   \else \ifnum#1=2
\put(0,0){\vector(0,1){4}} %reduced career
\multiput(0,5)(0,2){3}{\line(0,1){1}}
   \else \ifnum#1=3
\put(0,10){\vector(0,1){0}} %supressed career
\multiput(0,0)(0,3){3}{\line(0,1){2}}
   \fi \fi \fi
}
\newcommand{\freq}[1]{          %carrier frequency
   \ifnum#1=1
\put(0,0){\line(0,1){8}}     %group pilot frequency
\put(-1.5,8){$\triangle $}
    \else   \ifnum#1=2
\put(0,0){\line(0,1){10}}     %signalling frequency
\put(0.05,8.3){$\triangleright $}
    \else    \ifnum#1=3
\put(0,0){\line(0,1){8.5}}     %measuring frequency
\put(0,9.25){\circle{1.5} }
     \fi \fi  \fi
}

\newcommand{\pilot}[1]{          %pilot frequency
\put(0,0){\line(0,1){13}}     % 1 - basic group, 2= supergroup
\put(-1.5,13){$\triangle $}   % 3 - master group, 4 = supermaster group
\multiput(-2,8)(0,1){#1}{\line(3,-1){4}}
}
\newcommand{\band}[1]{          %frequency band
   \ifnum#1=1
\put(0,0){\line(1,0){10}} %noninvert band
\put(10,0){\line(0,1){5}}
\put(0,0){\line(2,1){10}}
    \else \ifnum#1=2
\put(0,0){\line(1,0){10}} %-noninvert band
\put(10,0){\line(0,-1){5}}
\put(0,0){\line(2,-1){10}}
    \else \ifnum#1=3
\put(0,0){\line(1,0){10}} %inverted band
\put(0,0){\line(0,1){5}}
\put(10,0){\line(-2,1){10}}
    \else  \ifnum#1=4
\put(0,0){\line(1,0){10}} %-inverted band
\put(0,0){\line(0,-1){5}}
\put(10,0){\line(-2,-1){10}}
     \fi \fi \fi \fi
}
\newcommand{\ltran}[2]{               %direction light transmitter
   \ifx#1R
\put(0,0){\framebox(20,10){}} %right
\put(3.5,4.5){$\bigtriangledown $}
\put(3.5,3.6){\line(1,0){3}}
\multiput(-5,2)(0,6){2}{\line(1,0){10}}
\put(5,2){\line(0,1){6}}
\put(15,5){\line(1,0){10}}
\multiput(8,3)(0,3){2}{\vector(1,0){5}} %optical
    \ifnum#2=1
\put(8,1.5){\line(0,1){6}}              %coherent
     \fi
   \fi  \ifx#1L
\put(0,0){\framebox(20,10){}} %left
\put(13.5,4.5){$\bigtriangledown $}
\put(13.5,3.6){\line(1,0){3}}
\multiput(15,2)(0,6){2}{\line(1,0){10}}
\put(15,2){\line(0,1){6}}
\put(-5,5){\line(1,0){10}}
\multiput(12,3)(0,3){2}{\vector(-1,0){5}} %optical
     \ifnum#2=1
\put(12,1.5){\line(0,1){6}}              %coherent
     \fi
    \fi
}
\newcommand{\lrec}[2]{   %direction light receiver
   \ifx#1R
\put(0,0){\framebox(20,10){}} %right
\put(3.5,4.5){$\bigtriangledown $}
\put(3.5,3.6){\line(1,0){3}}
\multiput(-5,2)(0,6){2}{\line(1,0){10}}
\put(5,2){\line(0,1){6}}
\put(15,5){\line(1,0){10}}
\multiput(13,3)(0,3){2}{\vector(-1,0){5}} %optical
    \ifnum#2=1
\put(13,1.5){\line(0,1){6}}              %coherent
     \fi
   \fi  \ifx#1L
\put(0,0){\framebox(20,10){}} %left
\put(13.5,4.5){$\bigtriangledown $}
\put(13.5,3.6){\line(1,0){3}}
\multiput(15,2)(0,6){2}{\line(1,0){10}}
\put(15,2){\line(0,1){6}}
\put(-5,5){\line(1,0){10}}
\multiput(7,3)(0,3){2}{\vector(1,0){5}} %optical
     \ifnum#2=1
\put(7,1.5){\line(0,1){6}}              %coherent
     \fi
    \fi
}

\newcommand{\fibre}[1]{   %optical fibre
\put(0,0){\line(1,0){20}}   %general
\put(10,0){\circle{10}}
\multiput(7,-2)(2,0){2}{\vector(1,1){4}}
   \ifx#1S
  \put(20,-2.5){\line(1,0){4}}   % single mode
  \put(22,-2.5){\line(0,1){5}}
  \put(20,0){\line(1,0){10}}
   \else  \ifx#1M
  \multiput(20,-2.5)(4,0){2}{\line(1,0){2}}   % multi mode
  \multiput(22,-2.5)(2,0){2}{\line(0,1){5}}
  \put(22,2.5){\line(1,0){2}}
  \put(20,0){\line(1,0){10}}
     \fi \fi

}
\endinput
