Has anyone looked into optimising PWM for use as an analogue output? I was thinking about reducing ripple by distributing the high periods of the duty cycle, i.e. if resolution is 1/8ths of a cycle and output is 25% duty cycle (16384 in CircuitPython's range), this
becomes
I realise this could be done to some extent with
variable_frequency but it would be easier if it was done under the covers particularly if the hardware has features to support this efficiently.