Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский
Scilab Help >> Elementary Functions > Matrix generation > random > noisegen


noise generation (obsolete)


b = noisegen(pas, Tmax, sig)



real scalar, the time increment


real scalar, the final time of the interval of noise generation


real scalar, the standard deviation of the noise


noisegen() is obsolete. It will be removed from Scilab 6.1.x. Please use grand() instead. Examples (clearer, shorter, and more powerful) follow:

100 10-point wide steps with random amplitudes of normal distribution of mean 1 and standard deviation 0.7:

u = grand(1,100,"nor",1,0.7) .*. ones(1,10);
clf, plot(u);

40 15-point wide steps with random amplitudes of uniform distribution in [1 3], with initial level 0.5 and final level hold:

width = 15;
u = grand(1,40, "unf", 1, 3) .*. ones(1,width);
u = [ones(1,8*width)*0.5, u, ones(1,5*width)*u($)];
clf, plot(u);

noisegen() generates a Scilab function b = Noise(t) where Noise(t) is a piecewise constant function (constant on [k*pas, (k+1)*pas]). The value on each constant interval are random values from i.i.d Gaussian variables of standard deviation sig. The function is constant for t <= 0 and t >= Tmax.

Note: Random number generator functions such as rand and grand are another alternative to generate noises from a wide variety of probability distribution (see example 2 below).


Example #1: noisegen()

noisegen(0.5, 30, 1.0);
x = -5:0.01:35;
y = feval(x, Noise);
plot(x, y);

Example #2: rand()

// Plot a zero mean gaussian white noise with the variance 1.
// To use a different variance, multiply rand() by the square root of the variance.
t = 0:.5:30;
sig = 1; // Standard deviation of the white gaussian noise
noise = sig*rand(t, "normal");
plot2d2(t, noise);

See also

  • rand — Random numbers
  • grand — Random numbers


6.1.0 noisegen() is obsolete. It will be removed from Scilab 6.1.x. Please replace it with grand() and .*.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:18 CET 2020