This might seem silly but I need a circuit to detect the average value of a square waveform (0-1V), with frequencies below 20KHz. The duty cycle is not 50%.
This is done all the time with power converters where the switch voltage is averaged out by the low-pass filter (output filter). You just need a low-pass filter that is 'good enough' to bring the ripple to an acceptable level.