MATLAB: Zero-mean Gaussian white-noise process with known power spectral density (PSD)

accelerometergaussianMATLABpower spectral densitypsdwhite noise

Hello everybody
How can I generate zero-mean Gaussian white-noise process with known power spectral density (PSD)which is a constant ? (I want to add this noise to some acceleration data to model an accelerometer sensor)
Thanks in advance.

Best Answer

Just use randn() and multiply by the square root of the variance.
The theoretical PSD of WGN is \sigma^2 (\Delta t) where \sigma^2 is the variance and \Delta t is the sampling interval.
For example:
sigma2 = 2;
x = sqrt(sigma2)*randn(100,1);