Accompanying code for the paper "Alias-free simulation of static diode circuits using the Lambert-W function" by F. Esqueda and V. Välimäki. Submitted to IET Electronics Letters, October 2017. The attached MATLAB script implements a diode clipper model using the first- and second-order antiderivative antialiasing methods and generates the spectrogram shown in Fig. 2. The antiderivative methods are implemented as described in: Bilbao, S., Esqueda, F., Parker, J. D. and Välimäki, V.: "Antiderivative antialiasing for memoryless nonlinearities", IEEE Signal Processing Letters, 2017, 24, 7, pp. 1049--1053. Written by F. Esqueda. October 31, 2017.