I'm working through this awesome article: https://jackschaedler.github.io/circles-sines-signals/dft_introduction.html
I want to use the Web Audio API's PeriodicWave object to implement this demo:
However, when I set a periodic wave with these settings:
var real = new Float32Array([0,0,1,0,1]);
var imag = new Float32Array(real.length);
var customWave = context.createPeriodicWave(real,imag);
osc.setPeriodicWave(customWave);
I output a wave that looks like this:
Here is full code: http://jsbin.com/zaqojavixo/4/edit To see the waveform, please press play the sound a few times.
I believe these should match up, so here are my questions:
Edit: As noted in comments, my graph is upside down (on the canvas 0,0 is the upper left corner).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With