# How to Generate Band Limited Gaussian White Noise?

In some papers, I read that the additive noise is band limited Gaussian white.
How can I simulate this type of noise use Matlab?

• In continuous-time systems, the concept of band-limited white noise, whether Gaussian or not, is well-defined and well understood. For discrete-time systems, the issue is more complicated and you need to consider what the band limitation is and how it compares to the Nyquist frequency. – Dilip Sarwate Jun 21 '13 at 16:05
• @DilipSarwate: To me,"band-limited white noise" is an oxymoron! :-) – Peter K. Jun 21 '13 at 23:54
• @PeterK. The notion of bandlimited white noise is used primarily in bandpass systems where the characteristics of noise outside the passband are irrelevant while within the passband, the noise is indistinguishable from white noise that has been passed through an ideal bandpass filter that passes precisely the frequency band that is the passband. It is no more an oxymoron than white noise (without any pejorative comments about band-limitations). See also, DRazick's comment (which is spot on) following Jason R's answer (which I disagree with). – Dilip Sarwate Jun 22 '13 at 1:59
• @DilipSarwate: Thanks for the explanation. I get it, but I still think it's a very poor choice of terminology. To me "band-pass filtered white noise" is more accurate, but I suppose it ends up at the same place. – Peter K. Jun 22 '13 at 2:39
• @PeterK. Unfortunately, "band-pass filtered white noise" generally means the process described in JasonR's answer. Start with white noise and filter it through a filter with transfer function $H(f)$ to get a process with PSD proportional to $|H(f)|^2$. Band-limited white noise is the same except that we insist that$H(f)$ must be the transfer function of an ideal bandpass filter. The key point with white noise is that we can't put the signal where the noise a'i'nt which applies to band-limited white noise too as long as we are constrained to have our signals stay in band. – Dilip Sarwate Jun 22 '13 at 3:04

You would generate bandlimited Gaussian noise by first generating white noise, then filtering it to the bandwidth that you desire. As an example:

% design FIR filter to filter noise to half of Nyquist rate
b = fir1(64, 0.5);
% generate Gaussian (normally-distributed) white noise
n = randn(1e4, 1);
% apply to filter to yield bandlimited noise
nb = filter(b,1,n);

• I have always wondered this, but if something like this is done, then what is so Gaussian about it anymore? I dont think the PDF is at all at this point... – Spacey Jun 20 '13 at 2:04
• One of the special features of Gaussian random variables is that the sum of two independent Gaussian RVs is also Gaussian distributed. Since the input noise is white, you can look at each sample at the filter output as a sum of many independent Gaussian random variables (where the variance of each RV depends upon the input noise variance and the values of the corresponding filter tap). Therefore, the samples at the filter output are also Gaussian distributed. However, the noise is obviously no longer white, as there is correlation between successive samples at the filter output. – Jason R Jun 20 '13 at 4:05
• This property is described in more detail at Wikipedia. Note that the property still holds even if the input noise is colored (see the "Correlated random variables" section). – Jason R Jun 20 '13 at 4:06
• facepalm. Of course. – Spacey Jun 20 '13 at 15:20
• Yet this method won't generate White noise. No need to apply a filter, every discrete sampled noise is band limited to begin with. – Royi Jun 21 '13 at 15:02

Just as a small addition to Jason's answer: usually you need to generate bandlimited noise with a given variance $\sigma^2$. You can add this code to the code given in Jason's answer:

var = 3.0;  % just an example
scale = sqrt(var)/std(nb);
nb = scale*nb;  % nb has variance 'var'


Note that you have to do the scaling after filtering, because in general the filter changes the noise variance.

• Good point. If you scale the filter coefficients such that $\sum_{n=0}^{N} |h[n]|^2 = 1$, then the filter will not affect the noise variance. – Jason R Jun 20 '13 at 14:39
• @Matt Nice addition! – Spacey Jun 20 '13 at 15:13

Every time you generate discrete noise samples (Using MATLAB's randn / rand for instance) you actually generate a band limited noise.

All you need to do is the adjustment of the variance of the discrete samples to the variance of the "Continuous" noise those samples are allegedly taken from.

Given a continuous White Noise (Wide Sense) with variance $\sigma^{2}_{cn} \delta (t)$ and you want sample it at rate of $f_{s}$ you should generate discrete noise samples with variance of $f_{s} \sigma^{2}_{cn}$.

This result is valid assuming before sampling the continuous noise you applied an ideal LPF filter with bandwidth of $f_{s} / 2$.

Full description is given here:
How to simulate AWGN in communication systems for specific bandwidth

i realize this question popped up in current view because @Drazick modified his/her 2013 answer.

if you generate a good uniform p.d.f. pseudo-random number $x$ (say using rand() or frand(), if it's a good version) that ranges from 0 to 1 (that is $0 \le x < 1$), then if you do that 12 times, add up all 12 of the supposedly independent and uncorrelated values, and subtract 6.0 from that sum, you will have something that is very close to a unit-variance and zero-mean gaussian random number. if the uniform p.d.f. pseudo-random numbers are "good" (that is they exhibit independence from each other), this sum will be as "white" as you can get a discrete-time signal to be.

"white noise" is, of course a misnomer, even for analog signals. a "power signal" with flat spectrum all the way to infinity also has infinite power. the virtually-gaussian and "white" signal generated as described has a finite power (which is the variance and is 1) and finite bandwidth which, expressed as one-sided, is Nyquist. (so the 'power spectral density" or power per unit frequency is 1/Nyquist.) scale it and offset it however you please.

i s'pose i can edit this later and add some C-like pseudo-code to show this explicitly.

Why can one not use the approach mentioned in this post?

It starts with the desired frequencies and works backwards to build the signal, instead of filtering. It uses python code, but also links to the original Matlab code.

Are there any drawbacks to doing it that way?