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.
${timeScale}$: How much slower then real time the simulation should run at. 0.00001 means it runs at
one-hundred-thousandth the speed of real time, 0.0001 means it plays at one-ten-thousandth.
$t$: Time in microseconds since the source of sound started vibrating.
$A$: Amplitude, measured in millimeters. The maximum displacement of the vibrating particles from their
starting positions, in the direction the sound wave is traveling.[6][12].
Amplitude can also refer to the pressure changed caused by a sound wave, in which case it's measure in
Pascals[11]. The size of the pressure change is proportional to
the amplitude of the sound particles' displacements.
$v$: The speed of sound in meters per second. How fast vibrations propagate between sound particles/through
the medium
(air)[7]. In our simplified simulation properties of the medium
(density, etc) affect it but it's independent of properties of the sound wave/particle vibrations
(amplitude,
frequency, etc).
$f$: Frequency, measured in hz.[8]. At a particle level this is how
many times the
particle completes a full journey (back and forth) from its starting point per second. At a sound wave level
it's how many complete wave cycles pass through a given point per second.
Both have the same value, with the sound wave's frequency being an emergent property of the sound particles'
frequencies.
$\lambda$: Wave length, measured in millimeters. The distance over which the wave's shape repeats[5]. You can see this in the simulation as the distance
between peaks/troughs of pressure.
$k$: The spatial angular frequency of the wave, describing how many wave cycles it completes per meter.
Measured in radians per meter ($2\pi$ radians being one wave cycle).
$x$: The initial distance of a particle from the sound source. It's displacement while vibrating is relative
to this point. Together with $v$ it determines the phase offset[16]
of a particle's vibration relative to the
sound source.
$w$:The (temporal) angular frequency of the wave, describing how many oscillations it completes per second.
Measured in
radians per second ($2\pi$ radians being one wave cycle).
$F$: A function representing how a particle's displacement changes over the course of one oscillation, which
contributes to a sound's timbre[14]. It
takes an
angle in radians representing where in the current wave cycle the particle is (between $0$ and $2\pi$), and
maps that
to a displacement. The output is between -1 and 1 so you multiply by $A$ to find the distance in meters.
$p$: the pressure caused by the sound wave, in Pascals (Pa)[11]. Our
values are absolute, not relative to ambient air pressure. It's value is constantly changing at each point
as the sound wave moves forward, which is why we use the Root Mean Square of it's value to get an average
(see SPL). Wikipedia has a
good list of the pressures caused by different sounds.
$Z_0$: is the characteristic acoustic impedance of the medium (air) the sound/vibration is in[9]. Can be imagined as the resistance of the medium to the vibration.
$\rho$: density of the medium (air) the vibration is in[10].
$p_0$: reference pressure, approximately the quietest sound a young human with undamaged hearing can detect
at 1,000 Hz[3]
${RMS factor}$, each wave form has a different Root Mean Square (RMS) factor that you can multiply by the
wave's max pressure to find the RMS of the wave. For common wave forms there are formulae to calculate the
RMS from the pressure directly[4]. To get RMS of a set of discrete
values, you square them all, get the mean of the squares and find the square root of that. For a
non-discrete values like a waveform it's calculated using integration.
${SPL}$: Sound Pressure Level (dB) - the RMS pressure level caused by the sound relative to $p_0$, (roughly)
how loud it is.[4]
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
Our imaginary sound wave doesn't lose energy (get quieter) as it progresses forwards.
Everything is 2 dimensional.
We don't model the propagation of changes in the sound source. When a setting is changed, we draw the model
as if the new wave has already had time to propagate all the way
from the left to the right of the simulation. In reality, if the vibrations on the right of the graph
changed (it's displacement or frequency), it would take time for the new wave to propagate forwards - it
would look like the new wave was chasing the old wave left to right.
It doesn't let you model low frequency or quite sounds. This is because for most sounds in our hearing range
the
particle displacement is so small relative to the wavelength of the sound that you cannot usefully draw both
on the same graph. For example, a 100dB sound causes a displacement of 100nm, which is tiny
compared to the 172mm wave length of a ~2000hz sound. For lower frequencies the wave lengths are even bigger
and so the problem is worse.
At high frequencies you get thick bands of particles at the peak pressure points, and they get wider as
pressure caused by the sound increases. I don't understand this and wether it's a bug, limitation our model,
or a real effect. It seems to start happening when the change in pressure is bigger then atmospheric
pressure ($1.01×10^{5}{Pa}$)
Things that felt important when I learnt them
A sound wave cause no net movement of particles - that's what fans do, not speakers.
To repeat what's above: frequency of a sound is how many times its particles are moving back and forth per
second, it's amplitude is how far they are moving and it's timbre is what the graph of that movement over
time
looks like.
Even the loudest noises we can hear involve pretty tiny displacements of air - that's why speaker cones
don't need to move very far to make a loud noise. Maximum movement only needs to be in millimeters.
Lower frequency sounds particles need to oscillate with a bigger amplitude to produce the same level of
pressure.
[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.