[music-dsp] Article: antialiased sine waveform syncing
gasmoa at gmail.com
Mon Jun 8 22:18:02 EDT 2009
On Mon, Jun 8, 2009 at 7:27 PM, robert
bristow-johnson<rbj at audioimagination.com> wrote:
> On Jun 8, 2009, at 8:48 AM, george bezerianos wrote:
> On Wed, May 6, 2009 at 2:12 PM, Vadim Zavalishin wrote:
>>> Comments welcome.
> hi Vadim and George.
> i took a look at both the bloo.pfd and the SineSyncRC.pdf (i could not
> extract what i was looking for in the SineSync.pdf).
> now in bloo, George is creating a blit, as best as i can tell, and i am not
> sure if you're getting a sinusoid out of it, but if you are, is your BLIT
> going through some resonant filter or something? i don't see where the
> sin(wt) is coming out of it.
Well, if you convolve a BLIT with a sufficiently long sine wave you
will be approximating
a sine fine - and while you can find a multitude of ways to do that
better the actual BLOO
method is supposed to generalize for _arbitrary_ waveforms. The sine
function is used
as an example because of its Cinf discontinuity. As I said in a
previous post while the article
resets the slave oscillator near the sync point, one can get rid of
the harmonics by increasing
the overlapping and thus hard-sync _any_ waveform as the actual
can be anything. So, the two articles are rather different in terms of
The actual interesting bit as i said in a previous post would be to
actually connect the
higher order BLEP method (generalized for _arbitrary_ waveforms) with
BLOO suggests. That would actually add some additional theoretical justification
and insight, but numerically the method works fine both in terms of
complexity and numerical
> in SineSyncRC, Vadim is using a quite long polynomial of |x| to approximate
> a sine function over a period (and i presume he's driving that with a
> sawtooth function coming out of a phase-accumulator that defines the phase
> of the waveform).
> are my understandings reasonably correct?
> about Vadim's method, that's fine and good, but i think you're throwing
> *much* more polynomial at it to get an acceptable synthesized sine wave.
> the sine function is fully analytic (not the Hilbert transform meaning of
> "analytic"). it is continuous and has continuous derivatives, no matter how
> deep you go. that lends itself to very good polynomial approximation,
> *particularly* for the 1/2 cycle before the sin() bends around back (and +/-
> i would suggest aiming to approximate
> sin( pi/2 * x ) for -1 <= x <= +1
> sin(x) is a completely odd-symmetry, so any decent polynomial approximation
> would be odd-symmetry (and odd-order). if you factor out the x, and express
> sin( pi/2 * x ) = x * p(x^2)
> you are left with a simple polynomial that is made into an even-symmetry
> polynomial when x^2 is the argument.
> p(x^2) = sin(pi/2*x)/(pi/2*x) * pi/2 = pi/2 * sinc(x/2) -1 <= x <= +1
> p(x) = pi/2 * sinc( sqrt(x)/2 ) for 0 <= x <= +1
> unlike George, i (and nearly all my EE textbooks) define the sinc(x)
> function to have the pi in it:
> sinc(x) = sin(pi*x)/(pi*x)
Correct, however I use pi explicitly when i utilize "my" sinc definition as you
can see in equation (1). Sorry for the confusion.
> that is the polynomial that you want coefficients for (after determining the
> order necessary). you might be surprized to see how good of a fit you get
> for merely a 2nd or 3rd-order approximation to the sinc(sqrt(x)/2) function.
> don't use Taylor series, but try to be more optimal in getting the
> coefficients. least-squares would be good, in this case, but the Remes
> Exchange algorithm would work also.
> oh, the other thing is that you need to turn your sawtooth phase function
> into a triangle since the sin(x) function is being fit for only 1/2 period.
> if your saw goes from -1 to +1, then
> tri(x) = 2*|saw(x)| - 1
> that absolute value operation is the only one you'll need. everything else
> is just plug-and-chug into the polynomial.
> r b-j rbj at audioimagination.com
> "Imagination is more important than knowledge."
> dupswapdrop -- the music-dsp mailing list and website:subscription info,
> FAQ, source code archive, list archive, book reviews, dsp
More information about the music-dsp