back to list

Bandlimited synthesis algorithm

🔗Mike Battaglia <battaglia01@...>

3/29/2011 6:22:28 AM

On Tue, Mar 29, 2011 at 6:37 AM, Kalle Aho <kalleaho@...> wrote:
>
> >
> > You could probably just replace the sigmoid integration with the
> > above, which I think will be equivalent because of the Taylor series
> > expansion for log(1+x).
>
> What do you think of this?
>
> if x goes from -1 to 1
>
> f(x)=x-tanh(a*x)/tanh(a)
>
> gives a sawtooth wave with roughly 2*a harmonics when a is about
> >=3.5.
>
> Integrating this gives
>
> 1/2*x^2-ln(cosh(a*x))/(a*tanh(a))
>
> for parabolic wave that can be used to get variable duty cycle triangle waves.
>
> Kalle

That's one way to do it. Theoretically, this approach is really
interesting, as it basically involves adding a nonlinearity to an
existing sawtooth wave - if you go from -1 to 1 and then repeat, you
are effectively generating a sawtooth wave and then running it through
a nonlinear input-output function. I'm not sure exactly how that will
affect the spectrum, but it generally means that the spectrum is going
to get convolved with itself. How this ends up affecting the aliased
signal I'm not sure.

I was also looking at this, like I mentioned:

ln(k+sin(x)) = hilbert(sawtooth(x)) if k = 1.

I am far too tired to figure out how in the hell to integrate this
now, but if you do, you end up with parabolic waves for different
values of k, and as k moves down to 1 you get a perfect parabolic
wave. You can then take the square root to get triangle waves, or you
can differentiate to get a sawtooth.

In general I think it's best to store the integrated version of the
target waveform in a wavetable and then differentiate because of the
paper I sent you. Funny how nobody's doing this, though, this seems
like such a simple concept.

-Mike

🔗Kalle Aho <kalleaho@...>

3/29/2011 7:04:50 AM

--- In MakeMicroMusic@yahoogroups.com, Mike Battaglia <battaglia01@...> wrote:
>
> On Tue, Mar 29, 2011 at 6:37 AM, Kalle Aho <kalleaho@...> wrote:
> >
> > >
> > > You could probably just replace the sigmoid integration with the
> > > above, which I think will be equivalent because of the Taylor series
> > > expansion for log(1+x).
> >
> > What do you think of this?
> >
> > if x goes from -1 to 1
> >
> > f(x)=x-tanh(a*x)/tanh(a)
> >
> > gives a sawtooth wave with roughly 2*a harmonics when a is about
> > >=3.5.
> >
> > Integrating this gives
> >
> > 1/2*x^2-ln(cosh(a*x))/(a*tanh(a))
> >
> > for parabolic wave that can be used to get variable duty cycle triangle waves.
> >
> > Kalle
>
> That's one way to do it. Theoretically, this approach is really
> interesting, as it basically involves adding a nonlinearity to an
> existing sawtooth wave - if you go from -1 to 1 and then repeat, you
> are effectively generating a sawtooth wave and then running it through
> a nonlinear input-output function. I'm not sure exactly how that will
> affect the spectrum, but it generally means that the spectrum is going
> to get convolved with itself. How this ends up affecting the aliased
> signal I'm not sure.
>
> I was also looking at this, like I mentioned:
>
> ln(k+sin(x)) = hilbert(sawtooth(x)) if k = 1.
>
> I am far too tired to figure out how in the hell to integrate this
> now, but if you do, you end up with parabolic waves for different
> values of k, and as k moves down to 1 you get a perfect parabolic
> wave.

Integrating it in www.wolframalpha.com produced a monster.

> You can then take the square root to get triangle waves, or you
> can differentiate to get a sawtooth.

I'd make triangle waves by subtracting two phase shifted parabolic waves.

> In general I think it's best to store the integrated version of the
> target waveform in a wavetable and then differentiate because of the
> paper I sent you. Funny how nobody's doing this, though, this seems
> like such a simple concept.

I know that technique but it has numerical issues, the
differentiation causes frequency-dependent amplitude scaling. Might
not be an issue with only one differentiation though. But why bother
if the aliasing is already suppressed to inaudibility?

Kalle

🔗Mike Battaglia <battaglia01@...>

3/29/2011 7:19:40 AM

On Tue, Mar 29, 2011 at 10:04 AM, Kalle Aho <kalleaho@...> wrote:
>
> > I am far too tired to figure out how in the hell to integrate this
> > now, but if you do, you end up with parabolic waves for different
> > values of k, and as k moves down to 1 you get a perfect parabolic
> > wave.
>
> Integrating it in www.wolframalpha.com produced a monster.

Yikes.

> > You can then take the square root to get triangle waves, or you
> > can differentiate to get a sawtooth.
>
> I'd make triangle waves by subtracting two phase shifted parabolic waves.

You could also do that.

> > In general I think it's best to store the integrated version of the
> > target waveform in a wavetable and then differentiate because of the
> > paper I sent you. Funny how nobody's doing this, though, this seems
> > like such a simple concept.
>
> I know that technique but it has numerical issues, the
> differentiation causes frequency-dependent amplitude scaling. Might
> not be an issue with only one differentiation though. But why bother
> if the aliasing is already suppressed to inaudibility?

It's supposed to cause frequency-dependent amplitude scaling, that's
the point. You analytically generate the -integral- of whatever
waveform that you actually want, and then you differentiate. This way,
the aliasing frequencies actually get generated at attenuated
amplitude to begin with, and then once you differentiate, the aliasing
actually works against them - since they've now aliased down into the
lower frequency range, when you differentiate they get less of a boost
than if you had just generated the original waveform without taking
the integral. Not sure if I'm explaining it clearly enough, or maybe
you already know. Either way, yeah, I guess it's not much of an issue
if this technique already produces aliasing components that are below
what we can hear anyway.

-Mike