% This is part of the TFTB Reference Manual.
% Copyright (C) 1996 CNRS (France) and Rice University (US).
% See the file refguide.tex for copying conditions.


\markright{noisecg}
\section*{\hspace*{-1.6cm} noisecg}

\vspace*{-.4cm}
\hspace*{-1.6cm}\rule[0in]{16.5cm}{.02cm}
\vspace*{.2cm}



{\bf \large \sf Purpose}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
Analytic complex gaussian noise (white or colored).
\end{minipage}
\vspace*{.5cm}


{\bf \large \sf Synopsis}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
noise = noisecg(N)
noise = noisecg(N,a1)
noise = noisecg(N,a1,a2)
\end{verbatim}
\end{minipage}
\vspace*{.5cm}


{\bf \large \sf Description}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
        {\ty noisecg} computes an analytic complex gaussian
        noise of length {\ty N} with mean 0 and variance 1.0. \\

\hspace*{-.5cm}\begin{tabular*}{14cm}{p{1.5cm} p{8.5cm} c} Name &
Description & Default value\\ \hline {\ty N} & length of the output
vector\\ {\ty a1} & first coefficient of the auto-regressive filter used to
color the noise & {\ty 0} \\ {\ty a2} & second coefficient of the
auto-regressive filter used to color the noise & {\ty 0} \\ \hline {\ty
noise} & output vector containing the noise samples\\ \hline
\end{tabular*}
\vspace*{.2cm}

{\ty noise=noisecg(N)} yields a complex white gaussian noise.\\
 
{\ty noise=noisecg(N,a1)} yields a complex colored gaussian noise obtained
by filtering a white gaussian noise through a first order filter whose
impulse response is 
\[H(z)\ =\ \frac{\sqrt{1-a_1^2}}{1-a_1\ z^{-1}}.\]
 
{\ty noise=noisecg(N,a1,a2)} yields a complex colored gaussian noise
obtained by filtering a white gaussian noise through a second order filter whose
impulse response is 
\[H(z)\ =\ \frac{\sqrt{1-a_1^2-a_2^2}}{1-a_1\ z^{-1}-a_2\ z^{-2}}.\]
 
\end{minipage}

\newpage

{\bf \large \sf Example}
\begin{verbatim}
         N=500; noise=noisecg(N);
         [abs(mean(noise)),std(noise).^2]
         ans = 
               0.0152    0.9680

         subplot(211); plot(real(noise)); axis([1 N -3 3]);
         subplot(212); f=linspace(-0.5,0.5,N); 
         plot(f,abs(fftshift(fft(noise))).^2);
\end{verbatim}
\vspace*{.5cm}


{\bf \large \sf See Also}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
rand, randn, noisecu.
\end{verbatim}
\end{minipage}

