Grating-based phase-contrast and dark-field imaging systems create intensity modulations that are usually modeled with Ironing Boards 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 conventional processing.To account for that, we introduce a piecewise-defined periodic polynomial function that resembles the physical signal formation process, modeling convolutions of binary periodic functions.Additionally, we extend the model with an iterative expectation-maximization algorithm that can account Bowl Balance Ring 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.