This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19561 - WaveTable is poorly named
Summary: WaveTable is poorly named
Status: CLOSED FIXED
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: public-audio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-16 20:41 UTC by Chris Rogers
Modified: 2013-07-05 09:36 UTC (History)
4 users (show)

See Also:


Attachments

Description Chris Rogers 2012-10-16 20:41:47 UTC
It's been pointed out off-list that the WaveTable name is poor, since this name has other connotations involving synthesis techniques which sweep through through multiple waves:
http://en.wikipedia.org/wiki/Wavetable_synthesis

Suggested renaming is:
WaveTable -> PeriodicWave
Comment 1 Chris Wilson 2012-10-16 20:49:05 UTC
Maybe AdditiveHarmonics?  FourierHarmonics? It would be nice to capture that this is a set of harmonics being added to generate the waveform.  All Oscillators are periodic waveforms.
Comment 2 Chris Rogers 2012-10-16 21:21:41 UTC
(In reply to comment #1)
> Maybe AdditiveHarmonics?  FourierHarmonics? It would be nice to capture that
> this is a set of harmonics being added to generate the waveform.  All
> Oscillators are periodic waveforms.

I much prefer PeriodicWave because this captures the essence of what it is.  The OscillatorNode generates a periodic output based on a representation of a single cycle -- this is what I'm calling PeriodicWave
Comment 3 Marcus Geelnard (Opera) 2012-10-17 08:16:12 UTC
I think I'm with Chris Wilson here. I find it a bit counterintuitive to have "Wave" in the name at all, since to me, a wave is a time domain thing but the WaveTable object holds frequency domain data (it's the OscillatorNode that produces the wave, not the WaveTable object).

More precisely, the data held in the object is the Fourier series of a periodic wave, but I guess PeriodicWaveFourierSeries is a bit too wordy to be practical?

As usual, interface naming is about the hardest thing you can do in computer science ;)

Here's another thought: You could treat the WaveTable object in a way that is independent of frequency/time domain. For instance, if the interface provided a way to set the object state from a time domain signal as well as from a frequency domain signal, and let it be up to the implementation to choose how to store the data internally (could be frequency domain for hi quality synthesis or time domain for low quality synthesis), and use FFT/IFFT internally for the setters, as appropriate for the implementation.

If so, I think "PeriodicWave" would be a very fitting name.
Comment 4 Jussi Kalliokoski 2012-10-17 14:21:11 UTC
What about FormantTable?
Comment 5 Jussi Kalliokoski 2012-10-17 14:52:36 UTC
(In reply to off-issue-tracker comment)
> Formant implies an _absolute_ frequency.
>
> The WaveTable entries are harmonics, i.e. _relative_ to the oscillator's
> current fundamental frequency.

You're absolutely right, HarmonicTable is more accurate.

I didn't notice your earlier comment because it was made on the mailing list, please refrain from commenting on issues off the issue tracker to avoid the discussion from getting fragmented. :)
Comment 6 Chris Rogers 2012-12-04 19:56:01 UTC
(In reply to comment #3)
> I think I'm with Chris Wilson here. I find it a bit counterintuitive to have
> "Wave" in the name at all, since to me, a wave is a time domain thing but
> the WaveTable object holds frequency domain data (it's the OscillatorNode
> that produces the wave, not the WaveTable object).
> 
> More precisely, the data held in the object is the Fourier series of a
> periodic wave, but I guess PeriodicWaveFourierSeries is a bit too wordy to
> be practical?
> 
> As usual, interface naming is about the hardest thing you can do in computer
> science ;)
> 
> Here's another thought: You could treat the WaveTable object in a way that
> is independent of frequency/time domain. For instance, if the interface
> provided a way to set the object state from a time domain signal as well as
> from a frequency domain signal, and let it be up to the implementation to
> choose how to store the data internally (could be frequency domain for hi
> quality synthesis or time domain for low quality synthesis), and use
> FFT/IFFT internally for the setters, as appropriate for the implementation.
> 
> If so, I think "PeriodicWave" would be a very fitting name.

Actually, the object as it's currently implemented in WebKit *does* internally represent the data in the time-domain (in multiple tables to avoid aliasing at different playback rates -- this is an implementation technique I can share more details about...).  And I *do* think it's conceivable that we could have a way to create these objects given a time-domain array of data.

So this object isn't really tied to frequency-domain or time-domain and the current way of constructing it is simply a matter of convenience.

So I hope that "PeriodicWave" will be a good name.
Comment 7 Marcus Geelnard (Opera) 2012-12-06 08:50:12 UTC
Chris (R), do you think it's a good idea to add another method for creating the WaveTable (aka PeriodicWave) object from time-domain data?
Comment 8 Chris Rogers 2013-06-17 20:28:29 UTC
(In reply to comment #7)
> Chris (R), do you think it's a good idea to add another method for creating
> the WaveTable (aka PeriodicWave) object from time-domain data?

Hi Marcus, sorry for the long delay.  I think it's useful to add another method, but not critical we add it right now into the spec.
Comment 9 Chris Rogers 2013-06-17 20:29:01 UTC
Fixed:
https://dvcs.w3.org/hg/audio/rev/7c4a40a9bb57
Comment 10 Marcus Geelnard (Opera) 2013-06-18 06:19:06 UTC
(In reply to comment #9)
> Fixed:
> https://dvcs.w3.org/hg/audio/rev/7c4a40a9bb57

Looks good to me. And yes, it's not critical to add another time-domain function right now.
Comment 11 Olivier Thereaux 2013-07-05 09:36:01 UTC
Closing.