- From: Chris Rogers <crogers@google.com>
- Date: Thu, 9 May 2013 11:57:00 -0700
- To: Ehsan Akhgari <ehsan.akhgari@gmail.com>
- Cc: rbj@audioimagination.com, "public-audio@w3.org" <public-audio@w3.org>
- Message-ID: <CA+EzO0k4-ZB=mA3LvAzHcTkiLWzG9u5CXnAnefsB9kTpWQkmcQ@mail.gmail.com>
On Thu, May 9, 2013 at 7:26 AM, Ehsan Akhgari <ehsan.akhgari@gmail.com>wrote: > On Wed, May 8, 2013 at 11:54 PM, Chris Rogers <crogers@google.com> wrote: > >> >> >> >> On Wed, May 8, 2013 at 8:46 PM, <rbj@audioimagination.com> wrote: >> >>> >>> >>> it seems to me that if the createWaveTable() method is, essentially, an >>> inverse DFT. is it anything else? >>> >> That's the basic idea, but then this time-domain version has to be >> sampled at many different rates, so we want to avoid aliasing. In WebKit >> (Blink is the same) we use a multi-table approach (similar to mipmaps for >> graphics) where each table uses an inverse DFT, culling out an appropriate >> number of aliasing harmonics. Then when we render the waveform, we select >> which two adjacent tables to use, interpolate between those two, and then >> use linear interpolation... >> >> https://svn.webkit.org/repository/webkit/trunk/Source/WebCore/Modules/webaudio/WaveTable.cpp >> >> https://svn.webkit.org/repository/webkit/trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp >> >> We have tests where we load up a WaveTable and use it with an >> OscillatorNode, sweeping the frequency from very low to high (something >> like 10Hz -> 20KHz), checking that the aliasing isn't too bad... >> > > That is my point. :-) It should be possible to implement WaveTable (and > OscillatorNode) without linking to the WebKit implementation! > But I think the spec is very detailed and quite clear on what the WaveTable and OscillatorNode should do mathematically. It doesn't dictate a specific technique for achieving the effect. I only mentioned the WebKit code here as one possible practical approach. > > > -- > Ehsan > <http://ehsanakhgari.org/> >
Received on Thursday, 9 May 2013 18:57:27 UTC