Wednesday, 1 June 2022

How to get the real and imag arrays for createPeriodicWave for a piecewise periodic function?

The pattern of the wave is as follows:

0.0 - 0.5 => low,
0.5 - 1.0 => high,
1.0 - 2.0 => low,
2.0 - 2.5 => high,
2.5 - 4.0 => low,
4.0 - 4.5 => high,
4.5 - 6.5 => low,
6.5 - 7.0 => high,

enter image description here

The pulses are equal but the time between different pulses increases as follows: 0.5, 1.0, 1.5, 2.0. This pattern repeats itself so that if we keep going the next iteration would look like this:

7.0 - 7.5 => low,
7.5 - 8.0 => high,
8.0 - 9.0 => low,
9.0 - 9.5 => high,
9.5 - 11.0 => low,
11.0 - 11.5 => high,
11.5 - 13.5 => low,
13.5 - 14.0 => high,

enter image description here

I believe the lows should be -1 instead of 0 (not sure though). How can I get the real and imag arrays for this waveform?

https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createPeriodicWave



from How to get the real and imag arrays for createPeriodicWave for a piecewise periodic function?

No comments:

Post a Comment