ziotom78 / corrnoise.jl Goto Github PK
View Code? Open in Web Editor NEWPseudo-random number generators for correlated noise (1/f)
License: Other
Pseudo-random number generators for correlated noise (1/f)
License: Other
The REQUIRE file could not be found.
cc: @ziotom78
Hi,
I create the following function, according to your example:
function estimator(σ_K, slope, f_knee_Hz, τ_s, sampling_rate_Hz)
rng = OofRNG(GaussRNG(), slope, 1/τ_s, f_knee_Hz, sampling_rate_Hz)
data = [randoof(rng) * σ_K for i in 1:Int(τ_s * sampling_rate_Hz)+1]
end
Every time I call estimator
I get the same values. This does not happen if I put the line rng = OofRNG(GaussRNG(), slope, 1/τ_s, f_knee_Hz, sampling_rate_Hz)
outside the function. This happens because the seed is reinitialized every time the function is called, so the drawn sequence of pseudo-random numbers will be always the same.
This does not happen using the Distributions
package, e.g.:
function estimator(mean_val, σ, τ)
d = Normal(mean_val, σ)
rand(d, τ)
end
where the seed can be fixed explicitly, outside the function, with Random.seed!
.
So, should be possible to disentangle the seed definition from the OofRNG
function? In other words, should be possible to make CorrNoise
getting the seed in the same way as Distributions
does?
The REQUIRE file could not be found.
cc: @ziotom78
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.