Skip to main content
100%

Compound Waves

✓ Published0🌍 Public
Aalexmacy
Last edited Jun 9, 2017
Created on Apr 15, 2017

Three slider-controlled frequencies generate individual sine-like waves and their compound average, rendered as layered polylines on a black canvas. The visualization computes the least common multiple of the three frequencies to determine the compound wave’s full period, which can reach over a million samples for certain combinations. Individual waves appear in gray, while the red compound wave shows their combined effect. The code uses D3 v4’s line generator with a monotone curve, canvas rendering via `getContext("2d")`, and `d3.easeSinInOut` for wave shape calculation.

AI-generated description

This is the beginning of exploring how to calculate and display the combinations of multiple waves. This requires finding the least common multiple of the frequencies, which can get pretty heavy to process.

Adjust the sliders to change frequency combinations. But watch out with some of the more complicated waves, sometimes the least common multiple can get above 1 million! (e.g. 79, 80, 81)

mit Licensed

Similar vizzes