raspberrypi / pico-extras

BSD 3-Clause "New" or "Revised" License
480 stars 120 forks source link

pico_audio_pwm - How does noise shaping work? #74

Open NNNILabs opened 6 months ago

NNNILabs commented 6 months ago

In samples_encoding.cpp, there is a section that is defined out (lines 309 - 382) that seems to describe noise shaping implemented using the RP2040 interpolator.

I was unable to find a reference to what the function interp_configure_with_signed_and_cross_result in line 324. I understand that it has something to do with interpolator configuration, but I am not sure which function parameters correspond to which control/base/accumulator registers.

Since the comments are rather sparse, I am finding it difficult to understand how exactly the noise shaping is happening.

I would be grateful if some light could be shed on how this works.