Plot Large scale and Small scale fading with Tikz

The below figure shows large scale and small scale fading concepts in communication. \documentclass[borders=1mm]{standalone}

\usepackage[usenames,dvipsnames]{xcolor}

\usepackage{tikz}
\usetikzlibrary{calc,shapes}

\makeatletter
\pgfmathdeclarefunction{invgauss}{2}{%
\pgfmathln{#1}% <- might need parsing
\pgfmathmultiply@{\pgfmathresult}{-2}%
\pgfmathsqrt@{\pgfmathresult}%
\pgfmathmultiply{6.28318531}{#2}% <- might need parsing
\pgfmathdeg@{\pgfmathresult}%
\pgfmathcos@{\pgfmathresult}%
}

\pgfmathdeclarefunction{randnormal}{0}{%
\pgfmathrnd@
\ifdim\pgfmathresult pt=0.0pt\relax%
\def\pgfmathresult{0.00001}%
\fi%
\let\@tmp=\pgfmathresult%
\pgfmathrnd@%
\ifdim\pgfmathresult pt=0.0pt\relax%
\def\pgfmathresult{0.00001}%
\fi
\pgfmathinvgauss@{\pgfmathresult}{\@tmp}%
}
\makeatother

\begin{document}
\begin{tikzpicture}

\draw[-latex](0,0)--++(6.75,0);
\draw[-latex](0,0)--++(0,5.5);

\draw[domain=0:6.25,smooth,variable=\x,Blue] plot ({\x},{-0.8*\x+5});
\draw[domain=0:6.25,smooth,variable=\x,Green] plot ({\x},{(-0.8*\x+5)+0.6*randnormal});

\end{tikzpicture}
\end{document}

This is the output: How can I add small scale effect to my plot with Tikz?

This is a solution using pgfplots.

• I used sin(150*x)+cos(110*x)+cos(220*x) as the large scale effect function.
• For small scale effect, rnd*sin(5000*x) function is used. rnd returns a random value between 0 and 1. Code:

\documentclass[border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

\begin{document}

\begin{tikzpicture}
\begin{axis}