Sound wave particle simulator

This simulator and everything written here is pieced to together from the internet - any of it might be wrong. If you see a mistake, feel free to let me know and I'll fix it if I have a chance.

Equations

Displacement of a particle[6]

Max Pressure[13]

Loudness[4]

Glossary

Explanation

This model shows how characteristics of a sound wave emerge from the underlying movement of sound particles. Sound particles are the dots in the simulation [2]. You can think of a sound particle as representing the average movement of a large number of air molecules[1].

Sound waves are caused by a source object vibrating - moving back and forth in a consistent pattern. As it vibrates, it moves the sound particles around it and they end up vibrating back and forth in the same pattern as the source. These sound particles then move the sound particles in front of them and so on, causing the vibration of the source to propagate through the air. Eventually the vibration propagates all the way to your eardrum - whose vibration is interpreted by your brain as sound.

In the simulation above, imagine the moving line on the left as the source of the sound, and the listener being somewhere off to the right.

However, the propagation takes time - obviously the particles near the source are made to vibrate earlier. This causes the vibrations of the particles to be out of phase with each other, having all started at different times. The time it takes for vibrations to propagate through particles is determined by the underlying medium and this is what we call the speed of sound.

The fact that the particles are vibrating out of phase is what causes the areas of low and high density particles to appear, as particles at slow points in their cycle are caught up by those at fast points, or vice versa.

The maximum increase or decrease in density of particles (measured as pressure) is determined by the distance each particle moves while vibrating and is called it's amplitude. This is a big factor in how loud we perceive it to be.

How often a particle vibrates per second is its frequency, and also gives the emergent sound wave its frequency.

How a particle's displacement changes over the course of a vibration is what dictates a sound wave's shape, the timbre of the sound.

Limitations of the model

Things that felt important when I learnt them

Some more reading

Footnotes

[1]You could in principle simulate molecules of air directly and see the same emergent effects - but you have to simulate a lot of them. Our simulation space represents a 100mm by 20mm area. Assume a depth of 10mm - 100mmx20mmx10mm volume of air contains 5.06e+20 molecules (based on 10e25 molecules per meter cube). The simulation can barely handle 20,000. You'd also have to simulate the physics of them colliding with each other. Their individual paths would be messy, but on average they would move like our sound particles do and you'd see the same sound waves emerge. You also wouldn't be able to draw the individual molecules anyway - at the scale needed to see the sound wave individual molecules would be smaller then a pixel.

[2]https://en.wikipedia.org/wiki/Sound_particle

[3]https://en.wikipedia.org/wiki/Absolute_threshold_of_hearing

[4]https://en.wikipedia.org/wiki/Sound_pressure#Sound_pressure_level

[5]https://en.wikipedia.org/wiki/Wavelength

[6]https://en.wikipedia.org/wiki/Wave_vector#Physics_definition

[7]https://en.wikipedia.org/wiki/Speed_of_sound

[8]https://en.wikipedia.org/wiki/Frequency

[9]https://en.wikipedia.org/wiki/Acoustic_impedance#Characteristic_specific_acoustic_impedance

[10]https://en.wikipedia.org/wiki/Density

[11]https://en.wikipedia.org/wiki/Sound_pressure

[12]https://en.wikipedia.org/wiki/Particle_displacement

[13]Based on the equation at the very bottom of this section, but with $z_m(r,s)$ replaced with $z_0$

[14]https://www.britannica.com/science/timbre

[15]https://en.wikipedia.org/wiki/Root_mean_square#In_waveform_combinations

[16]https://en.wikipedia.org/wiki/Phase_(waves)#Phase_shift