16
$\begingroup$

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

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Dilip Sarwate Jun 21 '13 at 16:05
  • 2
    $\begingroup$ @DilipSarwate: To me,"band-limited white noise" is an oxymoron! :-) $\endgroup$ – Peter K. Jun 21 '13 at 23:54
  • $\begingroup$ @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). $\endgroup$ – Dilip Sarwate Jun 22 '13 at 1:59
  • 1
    $\begingroup$ @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. $\endgroup$ – Peter K. Jun 22 '13 at 2:39
  • 1
    $\begingroup$ @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. $\endgroup$ – Dilip Sarwate Jun 22 '13 at 3:04
18
$\begingroup$

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);
$\endgroup$
  • $\begingroup$ 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... $\endgroup$ – Spacey Jun 20 '13 at 2:04
  • 8
    $\begingroup$ 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. $\endgroup$ – Jason R Jun 20 '13 at 4:05
  • $\begingroup$ 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). $\endgroup$ – Jason R Jun 20 '13 at 4:06
  • 1
    $\begingroup$ facepalm. Of course. $\endgroup$ – Spacey Jun 20 '13 at 15:20
  • 3
    $\begingroup$ Yet this method won't generate White noise. No need to apply a filter, every discrete sampled noise is band limited to begin with. $\endgroup$ – Royi Jun 21 '13 at 15:02
9
$\begingroup$

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.

$\endgroup$
  • 2
    $\begingroup$ 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. $\endgroup$ – Jason R Jun 20 '13 at 14:39
  • $\begingroup$ @Matt Nice addition! $\endgroup$ – Spacey Jun 20 '13 at 15:13
4
$\begingroup$

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

$\endgroup$
0
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.