Additive Synthesis

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

If I'm not mistaken, the "SHO" is an example of semi-implicit euler and it is symplectic but only first-order accurate. It doesn't conserve energy exactly, but IIRC in fixed-point the oscillation does cancel the error accumulation. I seem to remember it doing this in floating-point too, at least assuming a specific rounding mode, but I can't seem to find good reference either way for the floating-point case. [Here's some fun discussion.]

Don't take my word for the following (I didn't verify it in any way) but intuitively, I'd guess the phase-quadrature is essentially off by about half a sample.

Post

Interesting stuff mystran. I'm going to look at the phase issue on the weekend, if it's out by .5 sample maybe use v before adjusting it for position:

p+=v;
cosv=v/(dt*2*pi);
v-=p*dts;

Post

shabby wrote:Interesting stuff mystran. I'm going to look at the phase issue on the weekend, if it's out by .5 sample maybe use v before adjusting it for position:

p+=v;
cosv=v/(dt*2*pi);
v-=p*dts;
That adjusts the phase by one full sample. :P

Post

It won't stay in-phase with an ideal phase accumulator, there is non-zero error. If you're generating several harmonics this way they will drift out of phase over time as opposed to generating each scaled from a single phase accumulator.

Same issue as rotation matrices, recomputing the matrices from a rotation vector will be stable because error does not accumulate.

Rotations obviously are worse because the error not only accumulates but does so non-linearly, so rotation matrices can "explode". While that doesn't happen in this case you'll still end up out of phase and the error is dependent upon all of frequency, amplitude and phase.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

That's uber-nasty - I like it!

Post Reply

Return to “DSP and Plugin Development”