# Phase Congruential White Noise Generator
## 2 White Noise Autocorrelation Matrix
\begin{tabular}{l



double t = 0.0; // the beginning of signal counters for (int i = 0; i < NS; i++) {  s0[i] = PH.PhaseSinNext(t); // counter value  t += PH.dxs; // next counter time }  Console.Write(\"S0 =\");  for (int i = 0; i < NS; i++) {  if (i % 6 == 0) Console.WriteLine();  Console.Write(\"[0.8:F3]\", s0[i]); }  Console.WriteLine(); // autovector matrix z t = 0.0; // next period beginning  double[,] z = new double[NS, NS];  MatrixZ(z, s0, PH, NS, t); // autovector matrix v double[,] v = new double[NS, NS];  MatrixV(v, z, NS);  Console.WriteLine(\"V = \");  for (int i = 0; i < NS; i++) {  Console.Write(\"[0.8:F3]\", v[i, 0]);  Console.Write(\"[0.8:F3]\", v[i, 1]);  Console.Write(\"[0.8:F3]\", v[i, 2]);  Console.Write(\"[0.8:F3]\", v[i, NS - 2]);  Console.WriteLine(\"[0.8:F3]\", v[i, NS - 1]); }  Console.ReadKey(); // result viewing } //------------------------------------------------ static void MatrixV(double[,] v, double[,] z, long ns) {  double dns = (double)ns;  for (int i = 0; i < ns; i++) {  double zE1 = 0.0;  for (int j = 0; j < ns; j++)  zE1 += z[i, j];  zE1 /= dns;  for (int j = 0; j < ns; j++)  v[i, j] = z[i, j] - zE1; } //------------------------------------------------ Function _MatrixZ_ from previous program _P070401_ //------------------------------------------------ } After executing the program _P070402_, the matrix \(V\) of centered autovectors appears on the monitor. To shorten the listing the skipping values have been substituted with a dash. NS = 33 NF = 16 S0 = \(-\)0.371 6.938 \(-\)0.398 2.317 \(-\)0.415 1.159 \(-\)0.540 0.626 \(-\)0.283 0.545 \(-\)0.396 0.479 \(-\)0.117 0.736 0.200 0.980 0.238 0.919 0.215 0.836 \(-\)0.125 0.483 \(-\)0.566 0.146 The matrix \(V\) of centered autvectors allows the calculation of the autocorrelation matrix \(A\) and the matrix \(R\) of the corresponding autocorrelation coefficients by analogy with Formulas (11) and (12) from the program _P070202_. In the following program _P070403_, the corresponding calculations are performed. using nsDeonYuliCongPhase62A; // congruential phase generator namespace P070403  { class cP070403  { static void Main(string[] args)  { const long NS = 33L; // signal counter quantity  const long NF = 16L; // frequency quantity in a counter  Console.WriteLine(\"NS = {0} NF = {1}\", NS, NF);  cDeonYuliCongPhase62A PH =  new cDeonYuliCongPhase62A(NF, NS);  double constA = 0.7; // amplitude of all frequencies  PH.SetAmplitude(constA);  PH.SetACX(5L, 3L, 2L); // congruential parameters  PH.PhaseStart(); // phase generator start  double[] s0 = new double[NS]; // initial signal s0  double t = 0.0; // the beginning of signal counters  for (int i = 0; i < NS; i++)  { s0[i] = PH.PhaseSinNext(t); // counter value  t += PH.dxs; // next counter time  }  t = 0.0; // next signal beginning  double[,] z = new double[NS, NS]; // autovector matrix z  MatrixZ(z, s0, PH, NS, t);  double[,] v = new double[NS, NS]; // autovector matrix v  MatrixV(v, z, NS); // autocorrelation matrix A double[,] a = new double[NS, NS];  MatrixA(a, v, NS);  Console.WriteLine(\"A = \");  for (int i = 0; i < NS; i++)  { Console.Write(\"[0.8:F3]\", a[i, 0]);  Console.Write(\"[0.8:F3]\", a[i, 1]);  Console.Write(\"[0.8:F3]\", a[i, 2]);  Console.Write(\"[-.-. double[,] r = new double[NS, NS]; MatrixR(r, a, v, NS); Console.WriteLine(\"R = \"); for (int i = 0; i < NS; i++) { Console.Write(\"[0,8:F3]\", r[i, 0]);  Console.Write(\"[0,8:F3]\", r[i, 1]);  Console.Write(\"[0,8:F3]\", r[i, 2]);  Console.Write(\" -



The analysis of the results received above shows that even such a limited listing provides evidence that the resulting matrix \(R\) is closer to the statistical independence of white noise \(R=I\) than the same matrix obtained earlier in the program _P070101_ using the standard function _Random.Next()_. At the same time, the main advantage of this outcome is that the developed congruential phase generator in the program _P070403_ creates anew the Fourier frequency spectrum with equal intensities at the stochastic phases.