Periodic Processes: A Variational Approach