Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define oscillator phases for the predefined types. #270

Merged
merged 2 commits into from Feb 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 25 additions & 1 deletion index.html
Expand Up @@ -3629,7 +3629,7 @@ <h2 id="OscillatorNode">4.23. The OscillatorNode Interface</h2>

<p>
There are several practical approaches that an implementation may take to avoid this aliasing.
But regardless of approach, the <em>idealized</em> discrete-time digital audio signal is well defined mathematically.
But regardless of approach, the <a href="#oscillatorTypes-OscillatorNode"><em>idealized</em> discrete-time digital audio signal</a> is well defined mathematically.
The trade-off for the implementation is a matter of implementation cost (in terms of CPU usage) versus fidelity to
achieving this ideal.
</p>
Expand Down Expand Up @@ -3747,6 +3747,30 @@ <h3 id="methodsandparams-OscillatorNode">4.23.2. Methods and Parameters</h3>
</dl>
</div>

<div id="oscillatorTypes-OscillatorNode-section" class="section">
<h3 id="oscillatorTypes-OscillatorNode">4.23.3. Oscillator Types</h3>
The idealized mathematical waveforms for the various oscillator types are defined here. In summary,
all waveforms are defined mathematically to be an odd function with a positive slope at time
0. The actual waveforms produced by the oscillator may differ to prevent aliasing affects.
<div id="oscillatorSin-OscillatorNode-section" class="section">
<h4 id="oscillatorSin-OscillatorNode">4.23.3.1 "sine"</h3>
The waveform for sine oscillator is sin(t).
</div>
<div id="oscillatorSquare-OscillatorNode-section" class="section">
<h4 id="oscillatorSquare-OscillatorNode">4.23.3.2 "square"</h3>
The waveform for the square wave oscillator is 1 for 0&le; t &lt; &pi; and -1 for -&pi; &lt; t &lt; 0.
</div>
<div id="oscillatorSawtooth-OscillatorNode-section" class="section">
<h4 id="oscillatorSawTooth-OscillatorNode">4.23.3.2 "sawtooth"</h3>
The waveform for the sawtooth oscillator is the ramp t/&pi; for -&pi; &lt; t &le; &pi;.
</div>
<div id="oscillatorTriangle-OscillatorNode-section" class="section">
<h4 id="oscillatorTriangle-OscillatorNode">4.23.3.2 "triangle"</h3>
The waveform for the triangle oscillator is 2/&pi;*t for 0 &le; t &le; &pi;/2 and
1-2/&pi;*(t-&pi;/2) for &pi;/2 &lt; t &le; &pi;. This is extended to all t by using the fact
that the waveform is an odd function with period 2&pi;.
</div>
</div>

<div id="PeriodicWave-section" class="section">
<h2 id="PeriodicWave">4.24. The PeriodicWave Interface</h2>
Expand Down