Back in the university I was working on a program that generates a sequence of random autocorrelated numbers. Autocorrelated meaning that each next value is close to the previous one and depends on it but still is random. The sequence was meant to represent a real road surface profile to be used in models of vehicle movement.
Here are the steps of the algorithm:
- Measure the real profile $H(l)$.
- Find profile's correlation function $R$.
- Find approximation for the normalized correlation function:
- Calculate coefficients $a$, $b$ for the algorithm based on approximation coefficients $A$, $alpha$, $beta$ and original profile variance $sigma$.
- Generate a sequence $x$ of normally distributed random (not autocorrelated) numbers.
- Generate points $q$ of the artificial profile in a loop using the algorithm:
As you can tell it looks nice and really smooth and if you could look at it in a larger scale than it would look like a straight horizontal line just like it should.
I have the source code for this project but it is really messy and written in Delphi. It also has a really nasty bug I was unable to fix: the deviation of the resulting sequence (somewhat randomly) doesn't match the deviation of the original sequence so the sequence has to be rescaled. This bug is the main reason for this question. It considerably restricts possible applications of the algorithm.
I don't expect anyone to go deep into my code and the math behind it (it is here in hope that someone remembers seeing something similar), but I would like to use this algorithm now.
- Does anyone know what is this algorithm or what's its name?
- Are there any libraries that implement it?
- Any ideas on where I should look for its implementation?
Here is a screenshot of the program to give you a better idea: