[sdiy] Generating a large number of CV outputs

Mattias Rickardsson mr at analogue.org
Fri Dec 8 23:36:04 CET 2023


On 8 Dec 2023, at 16:15, Mattias Rickardsson <mr at analogue.org> wrote:
> But what about potential problems and errors from
> 1 - the non-constant number of transitions per time?
> 2 - the non-constant frequency of the pulse wave?


On Fri, 8 Dec 2023 at 19:16, Tom Wiltshire <tom at electricdruid.net> wrote:

> What about them?!?
> No-one said this was *perfect*, only quick and cheap. Two out of three
> isn't bad!
> ;)
>

:-D


> 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.
>

Sorry for my short descriptions. I was more thinking
1 - if there are transitions more often (like in mid-range of values), then
the difference between up-edge and down-edge contributes more to the value,
and I'd expect it to result in some nonlinearity - not sure how large - and
also some noise. PWM on the contrary is inherently linear.
2 - frequencies above audible range can result in tones in the audio band
due to different nonlinear/disturbance phenomena... is it safe to have
dozens of them twittring around up there? :-)

/mr




>
>
> On 8 Dec 2023, at 16:15, Mattias Rickardsson <mr at analogue.org> wrote:
>
> But what about potential problems and errors from
>
> 1 - the non-constant number of transitions per time?
>
> 2 - the non-constant frequency of the pulse wave?
>
> /mr
>
>
> On Fri, 8 Dec 2023 at 17:02, Tom Wiltshire <tom at electricdruid.net> wrote:
>
>>
>>
>> On 8 Dec 2023, at 14:41, Matthew Skala via Synth-diy <
>> synth-diy at synth-diy.org> wrote:
>>
>> If PDM means PWM with bit-reversal before the comparison (such as Richie
>> describes), then it does indeed lock you into a lower sampling rate, and
>> that's one reason I skipped describing *that* technique.  But PWM with
>> bit-reversal seems not to be what you mean when you say PDM.
>>
>>
>> That's not what I meant when I said PDM, certainly.
>>
>> The way I generated it is using an NCO. The NCO generates a single-shot
>> output pulse everytime the phase accumulator wraps.
>>
>> 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.
>> 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.
>> 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.
>>
>> HTH,
>> Tom
>>
>> ==================
>>        Electric Druid
>> Synth & Stompbox DIY
>> ==================
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at synth-diy.org
>> http://synth-diy.org/mailman/listinfo/synth-diy
>> Selling or trading? Use marketplace at synth-diy.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20231208/9da3c9f8/attachment.htm>


More information about the Synth-diy mailing list