Discontinuous modulation functions called crenel and saw-tooth have been developed for description and refinement of strongly modulated crystal structures with abrupt changes of modulation parameters. Although used for refinement of many modulated structures and mentioned in books on aperiodic crystals, technical details of such refinements have never been published and remained hidden in the source code of the refinement program Jana2006. In this article we explain how to recognize discontinuous modulations in a Fourier map and how to refine structures where crenel or saw-tooth functions are combined with additional secondary modulation. Three sets of functions suitable for such combination are presented: the traditional ortho-harmonics, and newly developed sets of Legendre polynomials and x-harmonics. Tiny differences between refinements based on particular function sets are demonstrated using simulated as well as existing modulated structures.