<div dir="ltr">But what about potential problems and errors from<div><br></div><div>1 - the non-constant number of transitions per time?</div><div><br></div><div>2 - the non-constant frequency of the pulse wave?</div><div><br></div><div>/mr</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 8 Dec 2023 at 17:02, Tom Wiltshire <<a href="mailto:tom@electricdruid.net">tom@electricdruid.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><br>
<div><br><blockquote type="cite"><div>On 8 Dec 2023, at 14:41, Matthew Skala via Synth-diy <<a href="mailto:synth-diy@synth-diy.org" target="_blank">synth-diy@synth-diy.org</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">If PDM means PWM with bit-reversal before the comparison (such as Richie</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">describes), then it does indeed lock you into a lower sampling rate, and</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">that's one reason I skipped describing *that* technique. But PWM with</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">bit-reversal seems not to be what you mean when you say PDM.</span></div></blockquote></div><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<br><div><br></div><div><div>==================<br> Electric Druid<br>Synth & Stompbox DIY<br>==================</div><div><br></div></div></div></div>_______________________________________________<br>
Synth-diy mailing list<br>
<a href="mailto:Synth-diy@synth-diy.org" target="_blank">Synth-diy@synth-diy.org</a><br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy" rel="noreferrer" target="_blank">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
Selling or trading? Use <a href="mailto:marketplace@synth-diy.org" target="_blank">marketplace@synth-diy.org</a><br>
</blockquote></div>