What you see. The size of the transfer function, |H| in dB against frequency, and under it the coherence γ², from 0 to 1; phase adds the phase between them. Measure plays a test signal through the speaker and records the microphone at the same time: the “system” is everything in between, speaker, air (the room, your hand, a bottle held over the phone) and microphone (slides 3.2–3.3). Every measurement is kept, numbered and coloured by its number: tap a number under the plots to fade its line, again to hide it, again to show it.
How it works. H = Y/X, from spectra averaged over many frames (slide 3.6): Sxx = E[X*X], Syy = E[Y*Y], Sxy = E[X*Y], then H₁ = Sxy/Sxx, H₂ = Syy/Syx and γ² = |Sxy|²/(SxxSyy) (the slide calls the input f: its Syf is Sxy here). Where the frames agree γ² is near 1; where noise swamps the output it drops. sine plays a tone, waits for the transient to die away, measures the gain and phase, then moves to the next (slide 3.2): reliable, one frequency at a time, and slow when each tone is given time to settle. sweep glides through the band, 4 times over to average; noise plays every frequency at once (slides 3.4–3.5); file plays a recording of your own (it stays on your device), length seconds of it from start (seconds into it, decimals allowed; 0 is its first sound): music works where it has energy, and γ² shows where that is.
Try: In Demo, measure, set mass to added and measure again: each mode drops by a different amount, and mode 2 hardly moves, as the mass sits near one of its nodes (the effect of a point mass, slides 7.11–7.12). Turn the demo’s noise up to −35 dB: γ² stays near 1 only at the peaks, and falls furthest at the dips, where the output is smallest. Set frame to 4096: the first peak reads 8 dB low and γ² dips right at it, as a frame is short next to how long that mode rings. With a phone, hold it over the mouth of a bottle, measure, pour in some water, and measure again.
Averaging. The recording is cut into frames (Hann window, half overlapping), or for a sweep into its repeats, and the spectra averaged. The frame sets the resolution, Δf = fs/frame: 1.4 s to start with, so that a room’s reverberation dies away within a frame; 10 s of noise then makes 14 frames (overlapping by half, so not quite 14 independent averages). With one frame H₁ = H₂ and γ² = 1 by definition, which says nothing, so no γ² is drawn for it: average more. The H₂ button draws H₂ as a thin line. With sine, each tone, once settled, is measured in 4 blocks of whole cycles, and those are its frames: γ² is 1 where its gain and phase were the same in all four. A point below 1 was noisy (an anti-resonance, or where the speaker barely plays), had not settled (turn per tone up), or the speaker’s clock runs at its own rate (Bluetooth, AirPlay), which costs most at high frequencies. With only 4 blocks, even pure noise reads about 0.25. A tone is 1 s to start with: about 0.7 s for the transient and a room’s reverberation to die away, then 0.24 s measured. A longer tone only waits longer, as longer blocks would let a speaker’s own clock creep further in phase.
Why γ² drops (4C6 slides 2.13–2.17): noise at the output, most where the output is small (low level, the notches between peaks, frequencies the speaker cannot make); frames short compared with how long a resonance rings, which shows as a dip right at the peaks; and a nonlinear system. With noise only on the output, H₁ is the true H and H₂ is pushed up.
Phase. unwrap follows the phase along frequency instead of folding it into ±180°, where γ² ≥ 0.5. τ is a delay left in the phase (φ = φ₀ − 2πfτ), shown only when the phase is a straight line, as a delay’s is (a resonance or a room’s reflections make it something else); remove delay takes it off.
Demo is a simulated structure, with no microphone needed: the driving-point transfer function, force to acceleration, of four lightly damped modes (a peak, then an anti-resonance, then a peak), with noise on the output that you can turn up. It is simulated sample by sample at 48 kHz, each mode a second-order digital filter made by the bilinear transform (the trapezoidal rule), warped so that each resonance lands exactly where it should; exact draws that simulated structure’s true H. Tap a plot to read a value; at a peak it gives Q = f₀/Δf from the half-power points. A peak sharper than the frames can resolve reads low and wide: longer frames, or the stepped sine, get closer.
A phone measures speaker, room and microphone together, uncalibrated (dB of microphone full scale per speaker full scale), and its speaker makes little below about 300 Hz. A structure is measured with a shaker or a hammer and an accelerometer, as in the 3C6 lab (slides 3.7–3.13).
The little chirp at the start of each measurement is a sync signal. Sound takes tens of milliseconds to go out through the browser and back in, and left in, that delay would wind the phase round and round; the app finds the chirp in the recording, which says exactly how late the microphone heard what was played, and lines the two up. H₁ needs that: it multiplies the two spectra frame by frame. Without the chirp only |H| could be had, as √(Syy/Sxx) from the two spectra apart, pushed up by any noise, and no phase at all. That includes the sound’s flight, about 3 ms per metre, so the phase is measured from the arrival of the direct sound.
When the delay moves. Through AirPlay the delay is about 2 s, through Bluetooth a few tenths: the app waits up to 5 s for the chirp, and says when the delay is that long. Measurements through them are less reliable: the delay can wander during a run (the speaker keeps its own clock), which turns H₁’s phase and lowers γ². Where several frames in a row agree that the delay has moved, each frame is lined up on its own; if it drifts within each frame too, the frames are shortened until it does not, and the card says so, with a way back to the frames chosen. A single frame that disagrees is not followed (in a lively room that is an echo, not the delay). For such a measurement, try power on the |H| plot: |H| from the powers alone, √((Syy − Snn)/Sxx), with the room’s noise Snn, heard before the chirp, taken off. It has no phase, so a delay that wanders cannot spoil it; but anything the microphone hears that was not there before the chirp (a voice, a door) counts as signal. In a lively room much of what comes back is echo, so a stretch of the recording may not match what was played clearly; that is not a fault, and nothing is said. What does spoil a measurement shows in γ², and three things are flagged in red: too loud (the microphone clipped), too quiet (the test signal less than 10 dB above the room’s own noise in the band) and γ² low right across the band (a noisy room, the sound breaking up, or AirPlay from an iPhone moving the delay by tenths of a second).
Level check (under level) plays the noise for 10 s and shows the level played and the level the microphone hears, with how far the band stands above the room. Noise is the hardest case both ways: its power is spread over the band, so at each frequency it is the quietest of the signals, and a sine or sweep at a resonance comes in a few dB louder at the microphone. So when it says good, every signal is right.
The signals. A sweep is 1 s with 0.4 s after it for the ringing to die away, played 4 times; once is allowed, but then γ² is 1 by definition. The noise’s peaks are cut down to about twice its RMS (plain noise’s are 4–5 times), so it is nearly as loud as a sweep at the same level. A frame of 1.4 s is 65536 samples at 48 kHz; at another rate the frame keeps about the same time, and the frame list says what it is there. Long frames are for a room: its reflections and reverberation (a large kitchen, an empty lecture theatre) then die away within a frame rather than spill into the next and cost coherence. A microphone close to the speaker helps too.
τ is least squares, weighted by γ², over the coherent bins: how much later (or earlier) the band measured arrives than the chirp’s 2.5–8 kHz did, with the distance sound goes in that time. A speaker can be tens of ms slower at low frequencies than high. It is shown when the phase is coherent over most of the band and within 10° of the line. Unwrapping stops where γ² is low because one noisy bin would throw everything after it by 360°.
Devices. Where the browser allows (Chrome or Edge on a computer), devices, under the settings, chooses the microphone and the speaker; in Safari on a Mac the sound goes to the Mac’s own choice of output (menu bar or System Settings), AirPlay included. Some phones still process the microphone however the page asks. Bluetooth and AirPlay speakers add a long delay, and their own processing: the device’s own speaker is the cleaner measurement. On an iPhone, once the microphone is on, iOS will not send the sound to AirPlay, and switches Bluetooth to its call mode, which a web page cannot change: use the phone’s own speaker, or a laptop for an AirPlay or Bluetooth speaker.
A reference channel (devices, with an interface of two or more inputs: a loopback of the drive, or a force gauge) does away with the delay altogether: H₁ is then the response over the reference, both recorded together, and the loop’s delay and the speaker cancel.
Band: the presets, or custom… for any f₁ to f₂, on a log axis if that spans a decade or more. γ² on the |H| plot puts the coherence plot away and back. The colours go blue, orange, green, then red, purple, brown, olive and cyan (matplotlib’s order after Tore’s pens). The cards (≡ on a phone) say how each measurement was made; ✕ deletes one, and Undo brings it back; the last 8 are kept, the oldest going first, and after Clear the numbers start again from 1. Save CSV (with the cards): every measurement kept, shown or hidden, one after another with its number in the first column: frequency, H₁ (real, imaginary, dB, phase), γ², H₂, power and the auto-spectra, and each one’s settings in the header, in a form pydvma can read. With time data ticked it holds each one’s sound as well, played and recorded, lined up as analysed (tens of MB). Load CSV brings a saved file back as cards.