noisegennoise generationCalling Sequenceb = noisegen(pas, Tmax, sig)Argumentspasreal scalar, the time incrementTmaxreal scalar, the final time of the interval of noise generationsigreal scalar, the standard deviation of the noiseDescriptionnoisegen() 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).
Examples
Example #1: noisegen()
noisegen(0.5, 30, 1.0);
x = -5:0.01:35;
y = feval(x, Noise);
plot(x, y);
Example #2: rand()
t = 0:.5:30;
sig = 1;
noise = sig*rand(t, "normal");
plot2d2(t, noise)
See Also
rand
grand