Grating-based phase-contrast and dark-field imaging systems create intensity modulations that are usually modeled with sinusoidal functions to extract transmission, differential-phase shift, and scatter information.Under certain system-related conditions, the modulations become non-sinusoidal and cause artifacts in Vitamin D conventional processing.To account for that, we introduce a piecewise-defined periodic polynomial function that resembles the physical signal formation Wraps process, modeling convolutions of binary periodic functions.Additionally, we extend the model with an iterative expectation-maximization algorithm that can account for imprecise grating positions during phase-stepping.We show that this approach can process a higher variety of simulated and experimentally acquired data, avoiding most artifacts.