# create theoretical AR1 spectrum, using rho of 0.8
rho=0.8
freq=seq(0,.5,by=0.005)
Nyq=max(freq)
AR1 = (1-(rho^2)) / ( 1 - (2*rho*cos(pi*freq/Nyq)) + (rho^2) )
plot(freq,AR1,type="l")
# make noise surrogates from the theoretical AR1 spectrum
makeNoise(AR1)
Run the code above in your browser using DataLab