Amplitudes Frequencies Phases
Signal 1
Signal 2
Signal 3
 
 
About this app

Sum of sines viewer

This app gives you an opportunity to play around with superimposed sine waves. You can control the amplitudes, frequencies, and phases, as well as the sampling rate.

About the parameters:

Software components:


 
  These tabs have some presets you can play with.

The orange, green, and blue add up to make the black. As the orange has the most amplitude, with lowest frequency, the green and blue appear as ripples on top of the main wave. This is the default demo when you load this page; you can play with any of the controls as you wish.

This is another combination of three sines.

The sum of two sines with the same frequency is another sine — even if the phases are different. This is how noise-cancelling headphones work: they try to imitate the surrounding sounds, 180 degrees (half a cycle) out of phase. If you slide Signal 2’s phase closer to 0.0 — or 1.0 — you'll see how these signals can reinforce one another, rather than cancelling out.

This is also the sum of two sines, with phase closer to the same. Here the two don’t cancel each other out, but rather, they reinforce one another.

The sum of two sines with different frequencies isn’t another sine — rather, you get an outer envelope involving the different in frequencies. That annoying yoing-yoing-yoing when you hear two instruments playing almost the same pitch, just out of tune, are called beats.

This is a selector for a single sine wave.

 

For me, this part is the most fun! The other demos show examples of varying amplitude, frequency, and phase. Here we look into what can get weird, even for something as seemingly simple as a single sine wave.

Click here to show a single sine wave with highest sampling: 1000 data points. The frequency is 10 and you can see 10 peaks of the sine wave.

Click here to show that same single sine wave, but sampled at 500 data points. You can still see 10 peaks of the sine wave.

Click here to show that same single sine wave sampled at 100 data points. You can still see 10 peaks of the sine wave but it’s getting grainy.

Click here to show that same single sine wave sampled at 40 data points. It’s really grainy but you can still see the peaks and the troughs. What happens if you vary Signal 1’s phase?

Click here to show that same single sine wave sampled at 20 data points. What happened?!? Try varying Signal 1’s phase.

With sampling at 20 data points, it looks like there are two waves, each with two peaks.

With sampling at 17 data points, it looks like there are two waves, each with three peaks.

 

You can read more about this in the Wikipedia articles on aliasing and the Nyquist-Shannon sampling theorem.