W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2012

Re: Wavetable example?

From: Peter van der Noord <peterdunord@gmail.com>
Date: Sun, 22 Jul 2012 14:58:28 +0200
Message-ID: <CAL9tNz8iE92uiFawA7zh7xgr3zYHtKmsS5Z69nKJY22k7EcX1Q@mail.gmail.com>
To: public-audio@w3.org
Hmmm, my math knowledge isnt of the level that i have an immediate idea
about how that would work :)




> If you set the cos wave to [0, 1] and the sin wave to [0, 0] you just
> get a pure sine wave.
> If you flipped those two around you still get a sine wave, but it's
> rotated 90' in phase.
> If the waves are [0, 0, 1] and [0, 0, 0] you get a sine wave at double
> the harmonic frequency.
> For each component "n" in the two tables the amplitude of the frequency
> (f * n) is proportional to sqrt(cos_table[n]^2 + sin_table[n]^2)
> The phase is atan2(sin_table[n], cos_table[n])
> At least that's how I understand it :)
> Ray
Received on Sunday, 22 July 2012 12:58:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 22 July 2012 12:58:55 GMT