<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">I was getting 18 bit accuracy back in early 80s using this technique using LS-TTL and
 discrete transistors.  I'm sure one could do even better now with better components.<br>
</span></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Synth-diy <synth-diy-bounces@synth-diy.org> on behalf of Mattias Rickardsson <mr@analogue.org><br>
<b>Sent:</b> 08 December 2023 16:15<br>
<b>To:</b> Tom Wiltshire <tom@electricdruid.net><br>
<b>Cc:</b> SDIY <synth-diy@synth-diy.org><br>
<b>Subject:</b> Re: [sdiy] Generating a large number of CV outputs</span>
<div> </div>
</div>
<div style="direction: ltr;">But what about potential problems and errors from</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">1 - the non-constant number of transitions per time?</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">2 - the non-constant frequency of the pulse wave?</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">/mr</div>
<div style="direction: ltr;"><br>
</div>
<br>
<div style="direction: ltr;">On Fri, 8 Dec 2023 at 17:02, Tom Wiltshire <<a href="mailto:tom@electricdruid.net" id="OWA95e8e64f-532c-3d6e-002e-9b9e22ea858e" class="OWAAutoLink">tom@electricdruid.net</a>> wrote:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div><br>
</div>
<div><br>
</div>
<blockquote>
<div>On 8 Dec 2023, at 14:41, Matthew Skala via Synth-diy <<a href="mailto:synth-diy@synth-diy.org" id="OWAfc545545-361e-309a-e795-603f80412c02" class="OWAAutoLink">synth-diy@synth-diy.org</a>> wrote:</div>
<br>
<div><span style="letter-spacing: normal; font-family: Helvetica; font-size: 12px;">If PDM means PWM with bit-reversal before the comparison (such as Richie</span><br>
<span style="letter-spacing: normal; font-family: Helvetica; font-size: 12px;">describes), then it does indeed lock you into a lower sampling rate, and</span><br>
<span style="letter-spacing: normal; font-family: Helvetica; font-size: 12px;">that's one reason I skipped describing *that* technique.  But PWM with</span><br>
<span style="letter-spacing: normal; font-family: Helvetica; font-size: 12px;">bit-reversal seems not to be what you mean when you say PDM.</span></div>
</blockquote>
<div><br>
</div>
That's not what I meant when I said PDM, certainly.
<div><br>
</div>
<div>The way I generated it is using an NCO. The NCO generates a single-shot output pulse everytime the phase accumulator wraps.</div>
<div><br>
</div>
<div>Now consider what happens with a simple 8-bit NCO. If our frequency increment is 2, for example, we get a single output pulse every 128 clocks, or 2 pulses per 256 clocks. Notice that they will be nicely spaced apart, not next to each other like PWM. The
 output frequency would be (clock frequency / 128) in this situation.</div>
<div>If the increment is 8, we get a output pulse every 32 clocks, 8 pulses per 256 clocks, and again, they're nicely spaced out. The output frequency is now up to (clock /32) so there's been a big improvement, just by getting away from those extreme values
 a little bit.</div>
<div>As the increment climbs, the accumulator wraps more and more often. At freq=128, every other clock is an output and we reach our maximum output frequency of (clock/2). As the increment goes above half, we start staying high for more than a single pulse,
 and the waveform effectively turns the other way up and we get a mirror image of the effect we've seen from 0-128.</div>
<div><br>
</div>
<div>HTH,</div>
<div>Tom</div>
<div><br>
</div>
<div>==================<br>
       Electric Druid<br>
Synth & Stompbox DIY<br>
==================</div>
<div><br>
</div>
_______________________________________________<br>
Synth-diy mailing list<br>
<a href="mailto:Synth-diy@synth-diy.org" id="OWA0a4cc1f1-28f1-c75c-2b6e-9afa7480e61d" class="OWAAutoLink">Synth-diy@synth-diy.org</a><br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy" id="OWA12ae9099-cb59-46e9-94a6-0864b86c2977" class="OWAAutoLink" data-auth="NotApplicable">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
Selling or trading? Use <a href="mailto:marketplace@synth-diy.org" id="OWA20cc4fa6-87b7-04be-5c2b-100884a04cf4" class="OWAAutoLink">
marketplace@synth-diy.org</a><br>
</blockquote>
</body>
</html>