[Tex/LaTex] Wave under exponential decay curves

pgfplots

I am trying to decay this coin wave under the exponential decay curves over time like exactly what is shown in the picture below.
enter image description here
I have done this code but I do not know how to fit the peaks to the curves. Here is my code:

\documentclass{standalone}

\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
    \begin{axis}[
        trig format plots = rad,
        axis lines = middle,
        enlargelimits,
        xlabel={$t$},
        ylabel={$x$},
        xlabel style={right},
        ylabel style={above},
        xtick=\empty,
        ytick={1,0.5,-0.5,-1}, 
        yticklabels={$A$,,,$-A$},
    ]    
    \addplot[very thick,cyan,domain=0:8*pi,samples=200] {cos(x)};
    \addplot[dashed,domain=0:8*pi,samples=200] {exp(-0.2*x)};
    \addplot[dashed,domain=0:8*pi,samples=200] {-exp(-0.2*x)};

    \end{axis}
\end{tikzpicture}
\end{document}

Best Answer

Here is a pure TikZ solution using sin and cos operators (no need to search good samples value).

Note: this is an approximation of the real function!

enter image description here

\documentclass[tikz]{standalone}
\begin{document}
\def\cycles{16}
\pgfmathsetmacro\cyclesminusone{\cycles-1}
\begin{tikzpicture}[x={5cm/\cycles},y=2.5cm,line join=round]
  \draw[-stealth] (-1,0) -- (\cycles+1,0) node[right]{$t$};
  \draw[-stealth] (0,-1.1) -- (0,1.1) node[above]{$x$};
  \draw (0,1) +(.2,0) -- +(-.2,0) node[left]{$A$};
  \draw (0,-1) +(.2,0) -- +(-.2,0) node[left]{$-A$};

  \draw[cyan,very thick] (0,1)
  \foreach \tp in {0,1,...,\cyclesminusone}{
    cos(\tp+.25,0)
    sin(\tp+.5,{-exp(-.2*(\tp+.5))})
    cos(\tp+.75,0)
    sin(\tp+1,{exp(-.2*(\tp+1))})
  };
  \draw[dashed] plot[domain=0:\cycles] (\x,{exp(-.2*\x)});
  \draw[dashed] plot[domain=0:\cycles] (\x,{-exp(-.2*\x)});
\end{tikzpicture}
\end{document}