makeNoise {astrochron} | R Documentation |
Generate noise surrogates from a theoretical power spectrum
Description
Generate noise surrogates from a theoretical power spectrum.
Usage
makeNoise(S,dt=1,mean=0,sdev=1,addPt=F,nsim=1,genplot=T,verbose=T)
Arguments
S |
Vector or 1-D data frame containing the theoretical power, from f(0) to the Nyquist frequency. |
dt |
Sampling interval for surrogate series |
mean |
Mean value for surrogate series |
sdev |
Standard deviation for surrogate series |
addPt |
Did you add a Nyquist frequency? (T or F) |
nsim |
Number of surrogate series to generate |
genplot |
generate summary plots (T or F) |
verbose |
verbose output (T or F) |
Details
These simulations use the random number generator of Matsumoto and Nishimura [1998]. The algorithm of Timmer and Konig (1995) is employed to generate surrogates from any arbitrary theoretical power spectrum. See examples section below.
References
M. Matsumoto, and T. Nishimura, (1998), Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator, ACM Transactions on Modeling and Computer Simulation, 8, 3-30.
J. Timmer and K. Konig (1995), On Generating Power Law Noise, Astronomy and Astrophysics: v. 300, p. 707-710.
Examples
# create theoretical AR1 spectrum, using rho of 0.8
rho=0.8
freq=seq(0,.5,by=0.005)
Nyq=max(freq)
AR1 = (1-(0.8^2)) / ( 1 - (2*0.8*cos(pi*freq/Nyq)) + (0.8^2) )
plot(freq,AR1,type="l")
# make noise surrogates from the theoretical AR1 spectrum
makeNoise(AR1)