Short Matlab script for generated time-correlated gaussian noise thanks to my supervisor. It takes the previous sample and generated a new sample with sampling rate dt based on a gaussian with time constant tau, mean mu and sd sig.
function y = tcorr_randn(y_prev,mu, sig, tau, dt)
y = mu + (y_prev - mu)*exp(-dt/tau) + sig*sqrt(1-exp(-2*dt/tau))*randn;
end
No comments:
Post a Comment