# White Noise: Simulation and Analysis using Matlab - GaussianWaves (2023)

## Definition

A random process (or signal for display) with a constant power spectral density function (PSD) is a white noise process.

## Power Spectral Density

Power spectral density function(PSD) shows how much energy is contained in each of the spectral components. For example, for a fixed frequency sine wave, the PSD plot will only contain a spectral component present at the specified frequency. PSD is a smooth function, so the frequency components will be reflected in the Y axis when plotted. Therefore, for a sine wave of fixed frequency, the two-sided graph of the PSD will have two components: one at the +ve frequency and one at the -ve frequency of the sine wave. (Learn how to plot PSD/FFTa Python&a Matlab)

## Gaussian and uniform white noise:

A white noise signal (process) consists of a set of independent and identically distributed (i.i.d) random variables. In a discrete sense, the white noise signal is a series of independent samples generated from it.probability distribution🇧🇷 For example, you can generate a white noise signal using a random number generator where all samples follow a certain Gaussian distribution. This is called white gaussian noise (WGN) or white gaussian noise. Similarly, a white noise signal generated by auniform distributionIt's called uniform white noise.

Gaussian noise and uniform noise are often used in system modeling. In modeling/simulation, white noise can be generated using an appropriate random generator. White Gaussian noise can be generated usingrancidfunction in Matlab that generates random numbers that follow a Gaussian distribution. Similarly,randThe function can be used to generate uniform white noise in Matlab that follows a uniform distribution. When using random number generators, it generates a series of random numbers from the given distribution. Let's take the example of generating a white Gaussian noise of length 10 usingrancidfunction in Matlab – with mean zero and standard deviation=1.

>> mu=0;sigma=1;>> noise= sigma *randn(1,10)+munoise = -1.5121 0.7321 -0.1621 0.4651 1.4284 1.0955 -0.5586 1 .4362 -0.8026 0.0949

## What is i.i.d?

This simply generates 10 random numbers from the standard normal distribution. As we know, a target process is seen as a random process made up of several random variables that follow the same Probability Distribution Function (PDF). The above 10 random numbers are generated from the same PDF (Standard Normal Distribution). This condition is called the "identically distributed" condition. The individual samples given above are "independent" of each other. Furthermore, each sample can be viewed as the realization of a random variable. In effect, we generate a random process made up of realizations of 10 random variables. Therefore, the process above is composed of "independent identically distributed" (i.i.d) random variables.

## Strictly and weakly defined white noise:

Since the white noise process is built from i.i.d samples/random variables, all samples follow the same underlying probability distribution function (PDF). Therefore, the joint probability distribution function of the process will not change with any change in time. This is called a stationary process. So this noise is a stationary process. As with a stationary process that can be classified as Strict Sense Stationary (SSS) andLong Sense Stationary Processes (WSS), we can have white noise that is SSS and white noise that is WSS. Consequently, they can be calledstrictlydefinedwhite noise signalmisnapsdefinedwhite noise signal.

## What about the covariance function/matrix?

A white noise signal, denoted by, is defined in a weak sense is a more practical condition. Here, the samples are statistically uncorrelated and identically distributed with some variance equal to🇧🇷 This condition is specified using a covariance function as

(Video) AWGN, WGN, Autocorrelation and PSD Explained using Matlab

Why do we need a covariance function? Because we are dealing with a random process that is made up ofrandom variables (10 variables in the modeling example above). Such a process is seen asmultivariate random vector or multivariate random variable.

For multivariate random variables, the covariance function specified how each of thethe variables in the given random process behave with respect to each other. The covariance function generalizes the notion of variance to multiple dimensions.

The above equation, when represented in matrix form, gives the covariance matrix of the white noise random process. Since the random variables in this process are not statistically correlated, the covariance function only contains values ​​along the diagonal.

The above matrix indicates that there is only one autocorrelation function for each random variable. Cross-correlation values ​​are zero (samples/variables are not statistically correlated with each other). The elements on the diagonal are equal to the variance and all other elements in the matrix are zero. The established autocorrelation function of the weakly defined white noise is given by This indicates that the autocorrelation function of the weakly defined white noise process is zero everywhere except the delay.

(Video) Sine-Gaussian Signals

Related Topic:Building the autocorrelation matrix in Matlab

## Frequency domain characteristics:

Teorema de Wiener-Khintchineclaims that forLong Sense Stationary Process (WSS), the power spectral density functionof a random process can be obtained using the Fourier transform of the autocorrelation function of the random process. In the continuous time domain, this is represented as

For the weakly defined white noise process, we find that the mean is a constant and its covariance does not change with time. This is a sufficient condition for a WSS process. Then we can apply the Weiner-Khintchine Theorem. Therefore, the power spectral density of the weakly defined white noise process is constant (flat) over the entire frequency spectrum (Figure 1). The value of the constant is equal to the variance or power of the noise signal.

## Testing the characteristics of white Gaussian noise in Matlab:

Generates a Gaussian white noise signal of lengthusing the randn function in Matlab and graph it. Suppose the pdf is a Gaussian pdf with meanand standard deviation🇧🇷 Then, the variance of the Gaussian probability density function is🇧🇷 The theoretical PDF of the Gaussian random variable is given by

(Video) Ming Yuan: "Low Rank Tensor Methods in High Dimensional Data Analysis (Part 2/2)"

More simulation techniques available in the following ebooks
Digital modulations using Matlab
Digital modulations using Python
Wireless communication systems in Matlab

Clear all; click; close all;L=100000; %Sample length for random signalmu=0;sigma=2;X=sigma*randn(L,1)+mu;figure();subplot(2,1,1)plot(X);title(['White noise : \mu_x=',num2str(mu),' \sigma^2=',num2str(sigma^2)])xlabel('Samples')ylabel('Sample values')grid on;

plot the histogramof the generated noise signal and verify the histogram by plotting against the theoretical pdf of the Gaussian random variable.

If you are inclined to program in Python,go here for how to plot a histogram using the Matplotlib package.

subplot(2,1,2)n=100; %number of bins in Histogram[f,x]=hist(X,n);bar(x,f/trapz(x,f)); expect;% pdf theoretical gaussian random variable g=(1/(sqrt(2*pi)*sigma))*exp(-((x-mu).^2)/(2*sigma^2));plot (x,g); Wait; grid on;title('Theoretical PDF and Simulated White Gaussian Noise Histogram');legend('Histogram','Theoretical PDF');xlabel('Bins');ylabel('PDF f_x(x)');

calculate theautomatic correlation functionof white noise. The computed autocorrelation function should scale appropriately. If he 'xcorr' (Matlab built-in) is used to compute the autocorrelation function, use the 'biased' in the function to size it correctly.

(Video) Laguerre-Gaussian mode sorter (Technical Version)

figure();Rxx=1/L*conv(flipud(X),X);delays=(-L+1):1:(L-1);%Alternate Method%[Rxx,delays] =xcorr(X ,'biased'); %The 'biased' argument is used to scale correctly using 1/L %Normalize autocorrelation with sample length to correctly scale the plot (lags, Rxx); title('White noise autocorrelation function');xlabel('Lags')ylabel('Correlation')grid on;

## simulating the psd:

Power Spectral Density Simulation(PSD) white noise is a bit tricky. There are two problems here 1) The generated samples are of finite length. This is synonymous with applying truncation to an infinite series of random samples. This implies that the delays are set at a fixed interval. 🇧🇷FFT and Spectral Leakage - An additional resource on this topic can be found here) 2) The random number generators used in the simulations are pseudorandom generators. Due to these two reasons, you will not get a flat psd spectrum by applying the Fourier Transform on the generated autocorrelation values. the random signal.

### Gaussian white noise simulation as a multivariate Gaussian random vector:

To verify the power spectral density of white noise, we will use the approach of viewing the noise as a composite ofGaussian random variables. We want to average the PSD oversuch achievements. Since there areGaussian random variables (individual samples) per run, the covariance matrixwill dimension🇧🇷 The mean vector for this multivariate case will be of dimension.

Cholesky decompositionof the covariance matrix gives the equivalent standard deviation for the multivariate case. The Cholesky decomposition can be viewed as a square root operation. The Matlab function randn is used here to generate the multidimensional Gaussian random process with the given mean matrix and covariance matrix.

%White Gaussian noise process PSD constant check% with arbitrary mean and standard deviation sigmamu=0; Average % of each realization of Noise Processesigma=2; %Sigma of each execution of ProcessL Noise = 1000; %Number of realizations of random signals for the meanN = 1024; %Sample Length for each realization defined as power of 2 for FFT%Random Process Generation - White Gaussian Noise ProcessMU=mu*ones(1,N); %vector mean for all realizations Cxx=(sigma^2)*diag(somes(N,1)); %Covariance Matrix for the Random ProcessR = chol(Cxx); %Cholesky of covariance matrix%Generating a multivariate Gaussian distribution with a given mean vector and %covariance matrix Cxxz = repmat(MU,L,1) + randn(L,N)*R;

Calculate the PSD of the multidimensional process generated above and average it to get a smooth plot.

%By default, the FFT is performed on each column - normal command fft(z)%Find the FFT of the multivariate distribution on each row%Command - fft(z,[],2)Z = 1/sqrt(N)* fft(z,[],2); %Square by Square(N);Pzavg = mean(Z.*set(Z));%Calc Average Power of fftnormFreq=[-N/2:N/2-1]/N;Pzavg=fftshift(Pzavg ) ; %Shifts the zero-frequency component to the center of the spectrum graph(normFreq,10*log10(Pzavg),'r');axis([-0.5 0.5 0 10]); grid on;ylabel('Power Spectral Density (dB/Hz)');xlabel('Normalized Frequency');title('White Noise Power Spectral Density');

The generated noise psd graphic.shows almost fixed power at all frequencies. In other words, for a white noise signal, the PSD is constant (flat) at all frequencies (for🇧🇷 The y-axis of the graph above is expressed in units of dB/Hz. We can see from the graph that constant power = 10log10(p2)=10log10(4)=6dB.

(Video) Understanding Signal Generators

## author books

 Wireless communication systems in Matlab Second edition (PDF)Note: There is a rating built into this post, please visit this post to rate it. Digital Modulations Using Python (PDF eBook)Note: There is a rating built into this post, please visit this post to rate it. Digital modulations using Matlab (PDF eBook)Note: There is a rating built into this post, please visit this post to rate it. The best handpicked books on communication engineeringThe best books on signal processing.

## Videos

1. Non‐Gaussian quantum states of a multimode light field (Nicolas Treps)
(NONGAUSS)
2. All you need is a Normalizing Flow - Uros Seljak
3. The Quantum Fourier Transform Has Low Entanglement -- Chris Chen
(Initiative for the Theoretical Sciences)
4. QPSK Modulation and Demodulation in Matlab AWGN Channel
(Uniformedia)
Top Articles
Latest Posts
Article information

Author: Allyn Kozey

Last Updated: 03/27/2023

Views: 5605

Rating: 4.2 / 5 (63 voted)

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762