Introduction - If you have any usage issues, please Google them yourself
This is a variable length window averaging filter that uses an MCP3002 ADC with SPI interface to sample an analog input, and has a PWM that can be run through a low-pass filter to produce an analog output. The design was simulated in Modelsim with no problems (although it was not a thorough simulation), and it was successfully implemented on an Altera Cyclone FPGA.