Pulse-density modulation PDM
tonyp12
Posts: 1,951
Audio 1bit DACs uses this technique.
As it's very simple to create an analog signal by avaraging the bits sent with a low-pass filter.
To create a 50% voltage value you would send 01010101
And a 25% you would send 00100100
I guess you could create a 255 long table if you are using 8 bit.
But when going with 16 bit that would not be an option.
I was thinking if you to is the same way a prop counter does in duty mode.
send a 1 when the value rolles over.
I'n on the right track?
As it's very simple to create an analog signal by avaraging the bits sent with a low-pass filter.
To create a 50% voltage value you would send 01010101
And a 25% you would send 00100100
I guess you could create a 255 long table if you are using 8 bit.
But when going with 16 bit that would not be an option.
I was thinking if you to is the same way a prop counter does in duty mode.
send a 1 when the value rolles over.
(innerloop) mov buffer,myaudio '16+16bit L/R wave audio and buffer,_#$FFFF0000 'keep left audio mov counter,_#$FFFF 'run the loop 65'535 times (not practical, use 12bits?) loop: add buffer2,buffer wc muxc outa,#serpin dbnz counter,#loop
I'n on the right track?
Comments
-Phil
clk low> right channel bit, clk high> left channel bit
It probably would be harder to use 3 counters than to bit banging it with my own code.