<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">What about them?!?<div class=""><br class=""></div><div class="">No-one said this was *perfect*, only quick and cheap. Two out of three isn't bad!</div><div class=""><br class=""></div><div class="">;)</div><div class=""><div class=""><br class="webkit-block-placeholder"></div><div class=""><div>Slightly more seriously (1) averages out over time, (2) is only a problem when the frequency gets lower at the extremes. Stay away form the extremes and you avoid this problem.</div><div><br class=""></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 8 Dec 2023, at 16:15, Mattias Rickardsson <<a href="mailto:mr@analogue.org" class="">mr@analogue.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">But what about potential problems and errors from<div class=""><br class=""></div><div class="">1 - the non-constant number of transitions per time?</div><div class=""><br class=""></div><div class="">2 - the non-constant frequency of the pulse wave?</div><div class=""><br class=""></div><div class="">/mr</div><div class=""><br class=""></div></div><br class=""><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" class="">tom@electricdruid.net</a>> wrote:<br class=""></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;" class=""><br class="">
<div class=""><br class=""><blockquote type="cite" class=""><div class="">On 8 Dec 2023, at 14:41, Matthew Skala via Synth-diy <<a href="mailto:synth-diy@synth-diy.org" target="_blank" class="">synth-diy@synth-diy.org</a>> wrote:</div><br class=""><div class=""><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" class="">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" class=""><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" class="">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" class=""><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" class="">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" class=""><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" class="">bit-reversal seems not to be what you mean when you say PDM.</span></div></blockquote></div><div class=""><br class=""></div>That's not what I meant when I said PDM, certainly.<div class=""><br class=""></div><div class="">The way I generated it is using an NCO. The NCO generates a single-shot output pulse everytime the phase accumulator wraps.</div><div class=""><br class=""></div><div class="">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 class="">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 class="">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 class=""><br class=""></div><div class="">HTH,</div><div class="">Tom<br class=""><div class=""><br class=""></div><div class=""><div class="">==================<br class=""> Electric Druid<br class="">Synth & Stompbox DIY<br class="">==================</div><div class=""><br class=""></div></div></div></div>_______________________________________________<br class="">
Synth-diy mailing list<br class="">
<a href="mailto:Synth-diy@synth-diy.org" target="_blank" class="">Synth-diy@synth-diy.org</a><br class="">
<a href="http://synth-diy.org/mailman/listinfo/synth-diy" rel="noreferrer" target="_blank" class="">http://synth-diy.org/mailman/listinfo/synth-diy</a><br class="">
Selling or trading? Use <a href="mailto:marketplace@synth-diy.org" target="_blank" class="">marketplace@synth-diy.org</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></body></html>