B8 · Lesson 5 · Wave lab
Modes, decibels, junctions and a passing siren, then a plucked string simulated
The first four lessons gave formulas for waves on strings, sound in air and the Doppler shift. In this lab you'll turn them into small tools: the modes of strings and pipes, the sum of several noise sources in decibels, what a junction reflects, and the speed of a passing vehicle from two pitches heard as it goes by. Then you'll simulate a plucked string on a grid, without any formula for its modes, and hear the right fundamental come out of the arithmetic.
- A siren moves past you at speed v. The two levels are the pitches heard as it approaches and as it recedes.
- Raise v: the gap between them grows. From the two pitches alone you can recover both the siren's true pitch and its speed, which is what step 4 does.
- The readouts give the speed and true pitch recovered from the two pitches shown.
Predict
Ten identical machines each make 60 dB at a spot. What level do all ten make together?
70 dB. Incoherent sources add their powers, so ten of them carry ten times the intensity of one, which is 10 dB more. Each doubling adds 3 dB: two machines make 63 dB, four 66 dB, and it takes ten to reach 70.
Name it
Modes
A string or an open pipe of length L fits whole half-wavelengths: . A pipe closed at one end has a node at one end and an antinode at the other, so it fits odd quarter-wavelengths: , only the odd harmonics, an octave lower than an open pipe of the same length.
Adding levels
Incoherent sources add their intensities, so levels combine as . Two equal sources make 3 dB more than one; a source 10 dB quieter than another adds only 0.4 dB.
Junctions
A wave on a medium of impedance meeting impedance reflects with amplitude ratio , and passes on a fraction of its power.
A passing source
Approaching at speed v, a source of pitch sounds as ; receding, . Solving the pair gives
Simulating a string
The wave equation on a grid of spacing Δx with time step Δt becomes the leapfrog update
It's stable for , and at exactly 1 it moves pulses along the grid without any error at all.
Worked example
An open organ pipe and a pipe closed at one end are both 0.5 m long. What are their first three resonances (sound at 343 m/s)?
Show the solution
- Open pipe. With m, so 343, 686 and 1029 Hz.
- Pipe closed at one end. With m, so 171.5, 514.5 and 857.5 Hz.
- Compare. The closed pipe sounds an octave lower and has only odd harmonics, which gives it a hollower tone.
- Instruments. A clarinet behaves like a closed pipe and a flute like an open one, which is much of why they sound so different at the same pitch.
Answer the open pipe resonates at 343, 686 and 1029 Hz, and the closed one at 171.5, 514.5 and 857.5 Hz.
Worked example
A siren's pitch is 767.1 Hz as it approaches and 643.7 Hz as it recedes. How fast is it moving, and what is its true pitch?
Show the solution
- Speed.
- True pitch.
- Why both pitches. Neither pitch alone says anything about the speed without knowing the siren's true pitch, but the pair settles both.
- Radar. The same idea, with a stationary radar instead of an ear, measures speeds from the frequency shift alone.
Answer the siren moves at 30.0 m/s, and its true pitch is 700 Hz.
Worked example
A string 0.65 m long carries waves at 143 m/s. What is its fundamental, and how many grid steps does a simulation need per period with 130 cells and ?
Show the solution
- Fundamental. a guitar's A string.
- Grid spacing and time step. With 130 cells and :
- Steps per period. A period of 9.09 ms takes exactly twice the number of cells, since a pulse must cross the string and return.
- What the simulation knows. It knows nothing about modes or harmonics, only the wave equation at each point, yet it rings at 110 Hz with all the harmonics that the pluck's shape contains.
Answer the fundamental is 110 Hz, and the simulation takes 260 steps per period.
Check
Step 1. Write modes(v, L, n, closed_one_end=False) returning a NumPy array of the first n resonant frequencies of a string or open pipe, or of a pipe closed at one end.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 2. Write add_db(levels) that combines a list of incoherent sound levels in dB into one level.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. Write junction(Z1, Z2) returning the reflected amplitude ratio and the fraction of power transmitted, for a wave going from impedance Z1 to Z2.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 4. Write doppler_pass(fa, fr, c=343) that returns (v, f0), the speed and true pitch of a source heard at fa approaching and fr receding.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 5. Write pluck_freq(L, v, N, T) that simulates a string of length L and wave speed v on N cells with , plucked into a triangle 1 cm high peaking at 30% of its length and released from rest, runs for time T, and returns the frequency measured from the downward zero crossings at the middle cell. For the first step from rest, use .
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
2 identical sources each make 70 dB at a spot.
(a)
What level do they make together?
(b)
What do one source of 70 dB and one 10 dB quieter make together?
Check
A passing horn sounds 520 Hz as it approaches and 0.85 times that as it recedes. How fast is it moving?
Write units the way you normally would: 1.5 m/s, 1500 mm/s and 0.0015 km/s are the same answer.
Explain why
Why does the leapfrog simulation of a string give exactly the right pitch when , but not with a smaller time step?
The wave equation's solutions are shapes sliding left and right at speed v. When , each time step moves a shape exactly one grid cell, and the leapfrog update reduces to copying values from neighboring cells, so a pulse travels along the grid with no distortion and the round trip takes exactly the right number of steps. With a smaller time step, the shape has to move a fraction of a cell per step, and the grid can only approximate that: short wavelengths travel slightly too slowly (numerical dispersion), so the harmonics drift out of tune, though the fundamental, being long and smooth, stays close to correct.
Practice
Keep practicing
4 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.