An Efficient Coding Technique for Stochastic Processes