El Vikipedio

[edit] Summary
Signal avec un bruit gaussien ; moyenne m = 5, écart type σ = 1
Signal with a gaussian noise; average m = 5, standard deviation σ = 1
Auteur/author : Christophe Dang Ngoc Chan (cdang)
réalisé avec/made with Scilab
clear;clf;
n=50; // moitié du nombre de points aléatoires
// Gaussienne normée *3 centrée sur 5, écart type 1
deff('[y]=gauss(x)','y=3/(2*%pi)*exp(-0.5*(x-5)^2)')
// nombres aléatoires, loi uniforme
x1=rand(n,1);
x2=rand(n,1);
x=[2:0.1:8]';
// méthode de Box-Muller
// on peut aussi faire directement
// y1=rand(2*n,1,'normal')
for i=1:n
y1(i)=sqrt(-2*log(x1(i)))*cos(2*%pi*x2(i))+5;
y1(i+n)=sqrt(-2*log(x1(i)))*sin(2*%pi*x2(i))+5;
end
// histogramme
subplot(2,1,1)
histplot(20,y1)
fplot2d(x,gauss,style=2)
xtitle('Répartition des valeurs du signal','intensité', 'probabilité')
// signal
subplot(2,1,2)
plot(y1)
xtitle('Signal','temps', 'intensité')
[edit] Licensing
|
I, the author of this work, hereby publish it under the following license:
|
Ligiloj al la dosiero
La jenaj paĝoj ligas al ĉi tiu dosiero: