Noisy, analogue waveform in TikZ

You can use \draw plot for plotting functions. For the noise, you can use the rand function.

In general, plotting is more comfortable using the PGFPlots package, which builds on PGF/TikZ:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}[samples=200, domain=0:5*360]
        \begin{axis}[
            width=10cm, height=4cm,
            enlarge x limits=false,
            xtick=\empty,
            axis lines*=middle,
            hide y axis
        ]
        \addplot [no markers, smooth] {sin(x)+rand*2};
        \end{axis}
    \end{tikzpicture}
\end{document}

With PSTricks.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-node}
\psset{plotpoints=200,linejoin=1}
\pstVerb{realtime srand}

\begin{document}
\psLoop{10}{%
\begin{pspicture}[showgrid=false](-4,-2)(4.5,2.5)
    \psaxes[labels=none,ticks=none,linecolor=gray]{->}(0,0)(-4,-2)(4,2)[$t$,0][$v$,90]
    \psplot[linecolor=red]{-3.8}{3.8}{x 5 mul RadtoDeg sin Rand 4 mul 1 sub mul 1.8 mul}
\end{pspicture}}
\end{document}

enter image description here

Attention

Note that Rand no longer produces a random real number between 0 and 0.5 inclusive. Its definition had been tacitly changed. Now it produces a random real number between 0 and 1 inclusive. It is not documented, nor announced, but it is still fun!

The code given above has not been updated yet so it will produce different output. I have no time to update it right now. Sorry for this inconvenience.


This is a derived example from the »PGF/TikZ« user guide.

\documentclass{article}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}[
    declare function={
      excitation(\t,\w) = sin(\t*\w);
      noise = rnd - 0.5;
      source(\t) = excitation(\t,20) + noise;
      filter(\t) = 1 - abs(sin(mod(\t, 50)));
      speech(\t) = 1 + source(\t)*filter(\t);
    }
  ]
    \draw[help lines] (0,1) -- (3,1);
    \draw[blue, thick, x=0.0085cm, y=1cm] (0,1) -- plot [domain=0:360, samples=144, smooth] (\x,{speech(\x)});
  \end{tikzpicture}
\end{document}

Customization is left to you.


enter image description here