Re: Oscillator [square] suffer from severe alias

Don't have anything to add to this except that it seems pretty clear that
the oscillator output has too many frequency components, and you should
probably file bugs against your favorite browsers that demonstrate this
behavior.

On Mon, Mar 6, 2017 at 12:30 PM, André Michelle <
andre.michelle@audiotool.com> wrote:

> Hi all,
>
>
> I am developing a bandlimited oscillator for our synthesiser in
> www.audiotool.com and could not get it quite right. I tested the
> web-audio-api as a reference and voila: There is alias as well.
> http://jsbin.com/xebozar/edit?js,output
>
> I downloaded the sources from here to reimplement it in Java to find the
> problem.
> https://github.com/WebKit/webkit/blob/master/Source/
> WebCore/Modules/webaudio/OscillatorNode.cpp
> https://github.com/WebKit/webkit/blob/master/Source/
> WebCore/Modules/webaudio/PeriodicWave.cpp
>
> My port produces the exact same amount of alias at the same frequencies.
> The code in "PeriodicWave::waveDataForFundamentalFrequency" obviously
> chooses a table with too much harmonics but I could not find a fix and an
> obvious error. I could however replace the look-up code for a test, that it
> always returns the tables with just a single harmonic (sine-wave) and the
> alias is gone. That means that the wavetable size is big enough and the
> linear interpolation is working well.
>
> Any thoughts on this?
>
> ~
> André Michelle
> http://www.audiotool.com
>

Received on Monday, 6 March 2017 23:01:56 UTC