[sdiy] DCO Question
Tim Ressel
timr at circuitabbey.com
Thu Nov 2 17:56:51 CET 2017
Man, that worked great!
Here is my kludge-o-matic code:
// increment DCO
if(RST1)
Lfo1_DCO=0;
else {
if(Lfo1_DCO==LFO_MAX) // were at max; go to zero
Lfo1_DCO=0;
else if((LFO_MAX-Lfo1_DCO)<(Lfo1_INC)) // were less than one
inc away; set to max
Lfo1_DCO = LFO_MAX;
else if((LFO_MAX-Lfo1_DCO)<(Lfo1_INC*2)) // were less than
two incs away; add diff/2
Lfo1_DCO = Lfo1_INC/2;
else if((LFO_MAX-Lfo1_DCO)<(Lfo1_INC*3)) // were less than
three incs away; add diff/3
Lfo1_DCO = Lfo1_INC/3;
else
Lfo1_DCO+=Lfo1_INC; // were more
than three incs away; add inc
}
Thanks everybody!
On 11/2/2017 9:43 AM, Olivier Gillet wrote:
>> i.e. spectral purity
> a digital system will never be able to reproduce a perfect sawtooth
> anyway. only a band-limited one.
>
> you're just choosing the lesser of two evils: eliminate all harmonics
> above nyquist, instead of folding them back.
>
>> I don't want to calculate polynomials in floating point on the fly so I think I'll pre-calculate a table. Flash memory is cheaper than cycles.
> flash memory access has a cost too - table offset calculation, the
> actual vldr, and some nasty processor-specific side effects (messing
> with flash prefetching/caching/DMA access). A couple of vmul.f32 and
> vfma.f32 are not that bad for low order polynomials.
>
> don't assume, benchmark!
>
> On Thu, Nov 2, 2017 at 5:15 PM, Tim Ressel <timr at circuitabbey.com> wrote:
>> Ah, so if I am understanding polyBlep, one sacrifices waveform linearity
>> i.e. spectral purity for jitter reduction. The last few samples get morphed
>> so that the accumulator maxes out every cycle. In this case the saw wave
>> will nose over a bit at the top. Another way of saying it is the fraction
>> left at the top is amortized over a few samples. Since I am not trying to
>> hit exact frequencies this should work nice and easy.
>>
>> I don't want to calculate polynomials in floating point on the fly so I
>> think I'll pre-calculate a table. Flash memory is cheaper than cycles.
>>
>> Thanks!
>>
>> -t-i-m-b-o-
>>
>>
>>
>> On 11/2/2017 8:39 AM, Eric Brombaugh wrote:
>>> Jitter / Aliasing - it's both!
>>>
>>> Eliminating that "feature" of digital oscillators is the primary
>>> motivation behind the proliferation of antialiased oscillator algorithms and
>>> the proliferation thereof. Check out all the papers on BLEP, MinBLEP,
>>> PolyBLEP, DPW, etc.
>>>
>>> Eric
>>>
>>> On 11/02/2017 08:26 AM, Tim Ressel wrote:
>>>> Hi,
>>>>
>>>> I am making a digital oscillator (DCO) and was wondering if there is a
>>>> way to reduce the jitter one gets at higher frequencies. I understand it
>>>> comes from round off error (for lack of a better term): as the accumulator
>>>> reaches the top of the range the remaining amount is less than the value
>>>> being added, and that fraction changes every cycle. This causes jitter, or
>>>> is it aliasing? Anyway, is there a clever way to deal with it?
>>>>
>>>> Thanks!
>>>>
>>> _______________________________________________
>>> Synth-diy mailing list
>>> Synth-diy at synth-diy.org
>>> http://synth-diy.org/mailman/listinfo/synth-diy
>>>
>> --
>> --Tim Ressel
>> Circuit Abbey
>> timr at circuitabbey.com
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at synth-diy.org
>> http://synth-diy.org/mailman/listinfo/synth-diy
--
--Tim Ressel
Circuit Abbey
timr at circuitabbey.com
More information about the Synth-diy
mailing list