Another way to do audio from a uP


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11636
Posted: 05:59pm 06 Apr 2023      

One limitation of uP is that the maximum PWM rate is limited by the CPU clock and the accuracy of the output as an analogue signal is then also limited

so in the case of the Pico 133MHz/44100 = 3015 steps = 11.5 bits of accuracy

However, there is a way of getting much more accuracy by combining two PWM signals for each audio channel

This is explained here

In this case with two channels you could have 16-bit accuracy with a much higher PWM frequency making filtering much easier or possibly unnecessary at all

Say 133MHz/(44100*11) = 274 steps. Now with two channels running together combined in a 256:1 ratio as in the document we get 16-bit accuracy with 11 PWM waves for each audio level at a PWM frequency of 44100*11 = 485KHz