Splines are also a great tool to know about when you're trying to approximate smooth curves from sparse data! I reached for splines and martingales a ton when we were developing a patient simulator.
We published a paper about such an application to modelling sensor error here: https://doi.org/10.1177/1932296817711297
The martingale comes up under the "simulator" section, starting in the paragraph "In our previous simulation study".
if next_value > upper_bound: next_value = upper_bound
if next_value < lower_bound: next_value = lower_bound
This works fine, but serves to concentrate probability mass near the boundaries, so it's no longer uniformly distributed. By reflecting across boundaries rather than coercing, you're effectively flattening that concentration. If you coerce, you also reduce the expected value, which may or may not be a desirable property.