In an all-digital class-D audio amplifier each signal sample is mapped into a pulse using digital pulse-width-modulation (PWM), and this intrinsically generates nonlinear distortion. This article develops discrete-time Volterra models for digital PWM. The analysis considers two types of demodulation filter, an ideal filter which provides insight into the behavior of the PWM itself, and an analog low-order demodulator filter which models the interaction of the PWM mapping with a real demodulator filter. Symmetric, trailing edge, and leading edge PWM are considered. Using the Volterra models, formulae for the inverse systems are developed. This facilitates digital precompensation of the above mentioned distortion by digitally pre-filtering the modulating signal prior to the PWM mapping. This method is first simulated and compared to pseudo-natural PWM, a well-known method for PWM distortion reduction. Moreover, the method is verified by real measurements from a physical realization of the prefilter setup using real-time digital signal processing.