Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mso.anu.edu.au/~fbriggs/WAARNEEM/build_data.4.sm
Дата изменения: Thu Oct 4 12:57:24 2001
Дата индексирования: Sat Dec 22 06:08:59 2007
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п п р п р п р п р п р п р п р п р п р п р п р п р п р п
define N 1024
set x=1,$N
# dummy call to get ws dimensioned right
get_hist x v ws -.5 .5 .02
set ws=ws*0
erase
window 1 1 1 1

set y=x*0
limits 0 $N -.7 0.7
box
ptype 1 1
# generate a lot of points to uniformly cover -0.5 to 0.5
# -and- at the same time do averages of 10 samples => pseudo-gaussian
do i=1,10 {
set t=random($N)-0.5
set y=y+t
# keep plotting the uniform points
points x t
get_hist t v w -.5 .5 .02
set ws=ws+w
}
echo * Uniformly Distributed between -0.5 and 0.5 *
toplabel * Uniformly Distributed between -0.5 and 0.5 *
# use call to "cursor" in order to pause
# cursor
# prepare and plot the pseudo gaussian points
set y[0]=0
set y[$($N-1)]=0
set y=.03*cos(6.2832*x*11/$N)+y/10
set s=0.03*cos(6.2832*x*11/$N)
lweight 3
ctype red
connect x y
ctype default
lweight 1
define ave (sum(y)/$N)
define rms (sqrt(sum(y*y)/$N))
define err ($rms/sqrt($N))
echo rms=sigma= $rms
echo average= $ave +- $err
echo
echo * red: averages of 10 random points *

# print noise_file { y }

# cursor

erase
ctype default
limits x y
box
connect x y
# set s=abs(x-450)<40?.06:0
ctype red
# cursor
lweight 3
# connect x s
lweight 1
set ynew=y
ctype 0
cursor

limits x ynew
connect x ynew
ctype green
connect x s
ctype 0
box
smooth ynew ysmo 50
ctype red
connect x ysmo
ctype 0
stats ysmo ave sig kur
cursor

set yi=ynew*0
set ynew=ynew*-1.0**int(x)
fft 1 ynew yi re im
set a=sqrt(re*re+im*im)
limits x a
erase
box
connect x a
stats a ave sig kur
echo ...
echo stats a ave sig kur
echo ave=$ave sigma=$sig
echo ...
echo vecminmax a mn mx
vecminmax a mn mx
echo min=$mn max=$mx
echo
# print data.4 {ynew}
cursor
erase
set x=1,1024
set x=x-513
limits -50 50 a
box
connect x a