I get this code in this site:
http://www.darreltaylor.com/DT_INTS-14/SPWM.html