<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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);">No, jitter is to reduce EMC.  If you're producing a varying voltage it's spread all over the spectrum, but
 for a constant voltage all the energy is at one frequency which isn't good.  Jitter smears it out a bit.</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">The method shown with a good integrator gave 18 bits at 16kHz 40 years ago, so no need
 to make it any better for synth CVs - just use a better op-amp and capacitor to avoid a correction table.<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> cheater cheater <cheater00social@gmail.com><br>
<b>Sent:</b> 08 December 2023 23:18<br>
<b>To:</b> Mike Bryant <mbryant@futurehorizons.com><br>
<b>Cc:</b> Ben Bradley <ben.pi.bradley@gmail.com>; SDIY <synth-diy@synth-diy.org><br>
<b>Subject:</b> Re: [sdiy] Generating a large number of CV outputs</span>
<div> </div>
</div>
<div><span style="font-size: 11pt;">Right, that makes sense. Thanks a lot guys!<br>
<br>
So what was that about using jitter? Is that to make the integrator<br>
"more perfect"?<br>
<br>
If instead of using single pulses you used BLEPs or something similar,<br>
could that help as well? Or some sort of linear interpolation that<br>
outputs two samples in succession (so that their sum is 65535) in some<br>
smart way ...<br>
<br>
<br>
On Sat, Dec 9, 2023 at 12:09 AM Mike Bryant <mbryant@futurehorizons.com> wrote:<br>
><br>
> Only with a perfect integrator, which to get to 18 bit accuracy is extremely hard.  In practice you measure a few prototypes and build a correction table to give the voltages you require.<br>
><br>
><br>
> ________________________________<br>
> From: Synth-diy <synth-diy-bounces@synth-diy.org> on behalf of cheater cheater via Synth-diy <synth-diy@synth-diy.org><br>
> Sent: 08 December 2023 22:49<br>
> To: Ben Bradley <ben.pi.bradley@gmail.com><br>
> Cc: SDIY <synth-diy@synth-diy.org><br>
> Subject: Re: [sdiy] Generating a large number of CV outputs<br>
><br>
> Does that mean the final output voltage (after the reconstruction<br>
> filter) is proportional to the freq value in the algorithm Tom posted<br>
> above? So you set the desired output value by setting the freq<br>
> variable?<br>
><br>
> On Fri, Dec 8, 2023 at 11:47 PM Ben Bradley via Synth-diy<br>
> <synth-diy@synth-diy.org> wrote:<br>
> ><br>
> > I get it. Firstly, it's an NCO:<br>
> > <a href="https://en.wikipedia.org/wiki/Numerically_controlled_oscillator" id="OWAa158b78e-2e5e-2c3f-177e-460dfc284113" class="OWAAutoLink" data-auth="NotApplicable">
https://en.wikipedia.org/wiki/Numerically_controlled_oscillator</a><br>
> > From that, the thing gives a fixed-width pulse (a little shorter than<br>
> > one cycle at the max frequency) for every cycle of output, thus the<br>
> > average voltage (the output of a low-pass filter) is proportional to<br>
> > frequency.<br>
> ><br>
> > On Fri, 8 Dec 2023 at 16:43, Tom Wiltshire <tom@electricdruid.net> wrote:<br>
> > ><br>
> > > Honestly, it's not. It's just that damn simple. The version I actually wrote was all hardware module set-up specific to the device, and basically nothing else, so wouldn't tell you anything. Turning it all into software loses a lot of the benefit, so
 doesn't make much sense, except to explain it.<br>
> > ><br>
> > > Play with some NCOs a bit, and then get them to make a single pulse when they wrap. And then - Bingo! You're there!<br>
> > ><br>
> > > If you thought something was missing, what exactly? Ask a more specific question and perhaps I can help fill in a blank. I well remember how weird this stuff seemed when I first met it, so I think I understand the position you're in now.<br>
> > ><br>
> > ><br>
> > > > On 8 Dec 2023, at 21:18, cheater cheater <cheater00social@gmail.com> wrote:<br>
> > > ><br>
> > > > I don't get it. Most of the algorithm is missing.<br>
> > > ><br>
> > > > On Fri, Dec 8, 2023 at 10:07 PM Tom Wiltshire <tom@electricdruid.net> wrote:<br>
> > > >><br>
> > > >><br>
> > > >><br>
> > > >> On 8 Dec 2023, at 20:30, cheater cheater <cheater00social@gmail.com> wrote:<br>
> > > >><br>
> > > >> On Fri, Dec 8, 2023 at 5:06 PM Tom Wiltshire <tom@electricdruid.net> wrote:<br>
> > > >><br>
> > > >><br>
> > > >><br>
> > > >><br>
> > > >> On 8 Dec 2023, at 14:41, Matthew Skala via Synth-diy <synth-diy@synth-diy.org> wrote:<br>
> > > >><br>
> > > >> If PDM means PWM with bit-reversal before the comparison (such as Richie<br>
> > > >> describes), then it does indeed lock you into a lower sampling rate, and<br>
> > > >> that's one reason I skipped describing *that* technique.  But PWM with<br>
> > > >> bit-reversal seems not to be what you mean when you say PDM.<br>
> > > >><br>
> > > >><br>
> > > >> That's not what I meant when I said PDM, certainly.<br>
> > > >><br>
> > > >> The way I generated it is using an NCO. The NCO generates a single-shot output pulse everytime the phase accumulator wraps.<br>
> > > >><br>
> > > >> 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.<br>
> > > >> 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.<br>
> > > >> 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.<br>
> > > >><br>
> > > >> HTH,<br>
> > > >> Tom<br>
> > > >><br>
> > > >><br>
> > > >> I've read this a few times but I'm struggling to understand what's<br>
> > > >> going on. Can someone type out an algorithm or something like that?<br>
> > > >> Would appreciate it a lot. Thanks.<br>
> > > >><br>
> > > >><br>
> > > >> Ok, it'd look something like this:<br>
> > > >><br>
> > > >> phase: 16-bit variable (for example)<br>
> > > >> freq: 16-bit variable (same as phase)<br>
> > > >><br>
> > > >> So we do:<br>
> > > >><br>
> > > >> // Increment phase accumulator<br>
> > > >> phase = phase + freq<br>
> > > >><br>
> > > >> // Did phase wraparound?<br>
> > > >> If (phase>65535) { // There are probably better ways to do this test, if it's even required.<br>
> > > >> // Ok, phase wrapped<br>
> > > >> phase = phase % 65536<br>
> > > >> // output a pulse a single clock in length<br>
> > > >> <this is implementation dependent!><br>
> > > >> }<br>
> > > >><br>
> > > >> All you need to do is run this code at a fast clock rate and you're off. Of course, the better way is if you can hand some of this overhead to hardware, and some modern uPs include NCOs as a peripheral and can be set up for this "single shot pulse
 output" mode, which means that the while thing boils down to simply updating the "freq" frequency increment variable with your current output. It's dead simple.<br>
> > > >><br>
> > > >><br>
> > > >> There's a page about NCOs in general on my website:<br>
> > > >><br>
> > > >> <a href="https://electricdruid.net/direct-digital-synthesis/" id="OWA147797a7-7728-e99f-52c4-eba7c8cd11cb" class="OWAAutoLink" data-auth="NotApplicable">
https://electricdruid.net/direct-digital-synthesis/</a><br>
> > > >><br>
> > > >> HTH,<br>
> > > >> Tom<br>
> > > >><br>
> > > >><br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > Synth-diy mailing list<br>
> > > Synth-diy@synth-diy.org<br>
> > > <a href="http://synth-diy.org/mailman/listinfo/synth-diy" id="OWA8b37a670-21f1-66ea-49a2-e6062d1d0f53" class="OWAAutoLink" data-auth="NotApplicable">
http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
> > > Selling or trading? Use marketplace@synth-diy.org<br>
> ><br>
> > _______________________________________________<br>
> > Synth-diy mailing list<br>
> > Synth-diy@synth-diy.org<br>
> > <a href="http://synth-diy.org/mailman/listinfo/synth-diy" id="OWA5913b584-1fb0-e930-09a3-fc1dfa471189" class="OWAAutoLink" data-auth="NotApplicable">
http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
> > Selling or trading? Use marketplace@synth-diy.org<br>
><br>
> _______________________________________________<br>
> Synth-diy mailing list<br>
> Synth-diy@synth-diy.org<br>
> <a href="http://synth-diy.org/mailman/listinfo/synth-diy" id="OWA433d3777-a09d-3817-021f-846a435343dc" class="OWAAutoLink" data-auth="NotApplicable">
http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
> Selling or trading? Use marketplace@synth-diy.org</span></div>
</body>
</html>