Resonance tube speed of sound calculator
This resonance tube speed of sound calculator turns a familiar laboratory measurement into a direct acoustic result.
Run — free
Enter the driving frequency of the tuning fork and two consecutive air-column lengths at which resonance is heard. The calculator finds their separation, doubles it to obtain the wavelength, and multiplies by frequency to obtain the speed of sound. Because the two readings are consecutive resonances in the same tube, the unknown end correction cancels from the difference instead of requiring a separate estimate.
Measure two genuinely consecutive resonances
Use one tuning fork at a fixed frequency and vary the air-column length slowly. Record the first clear resonance length, then continue in the same direction and record the very next clear resonance. These readings must be adjacent modes, not simply any two loud positions. For a tube closed by water at one end and open at the other, successive allowed resonances are separated by half a wavelength. If a resonance is skipped, the measured separation contains multiple half-wavelengths and the calculator will return a sound speed that is too large by the same integer factor. Read both lengths from the same reference point, keep the tube orientation unchanged, and choose the shared unit in the form. The second value must be larger than the first. Several repeated trials are useful because judging the loudest point by ear introduces uncertainty. Average the length differences from consistent trials before calculating when your laboratory procedure permits it, rather than averaging the two raw length columns independently.
How the resonance spacing gives sound speed
A closed-open resonance tube supports odd quarter-wavelength patterns. Its resonant air-column lengths can be represented as an odd multiple of one quarter wavelength, with an additional end correction caused by the displacement antinode extending slightly beyond the open rim. For two consecutive resonances in the same tube, subtracting the shorter effective length from the longer one removes that shared correction. The remaining difference is one half wavelength, so wavelength equals twice the measured separation. Sound speed then follows from the wave relation speed equals frequency times wavelength, giving v = 2f(L2 - L1). The calculator first converts both lengths to metres, applies this relation, and reports speed in metres per second together with wavelength and the converted separation. It does not estimate an end correction because none is needed for this difference method. The calculation assumes the driving frequency is known and stable, the resonances belong to the same longitudinal mode sequence, and the medium and experimental conditions remain unchanged between readings.
Interpret the result and investigate discrepancies
Compare the calculated value with an appropriate reference for the gas and laboratory conditions, remembering that sound speed in air varies most noticeably with temperature and also depends on composition and humidity. A disagreement does not automatically mean the formula is wrong. Common experimental causes include selecting nonconsecutive resonances, reading the scale from inconsistent reference points, moving the water level too quickly, holding the tuning fork in a different position, or using the nominal fork frequency when its actual frequency differs. The result is only as precise as the measured separation: subtracting two similar lengths can amplify the relative effect of reading uncertainty. Report sensible significant figures based on the ruler resolution and frequency tolerance, even though the calculator returns a stable numeric value. This tool models the standard ideal resonance-spacing method; it does not correct for tube diameter, viscous losses, background noise, temperature gradients, or uncertainty propagation. For a stronger experiment, repeat the measurement, document ambient temperature, calculate each valid trial, and examine the spread rather than presenting a single reading without context.
What you can do with it
Complete a resonance-tube laboratory calculation
Convert two adjacent resonance readings and the marked tuning fork frequency into wavelength and experimental sound speed.
Check student measurements for a skipped mode
Identify implausibly large results that may indicate the recorded resonance lengths were not consecutive.
Compare sound speed across laboratory conditions
Process consistent resonance trials taken at different temperatures or with different gases for later comparison.
FAQ
Why are two consecutive resonance lengths used?
Their difference equals half a wavelength. Subtraction also cancels the common open-end correction, making a separate correction estimate unnecessary.
What formula does the calculator use?
It uses v = 2f(L2 - L1), where f is frequency and L2 - L1 is the separation between consecutive resonance lengths after conversion to metres.
Can I enter lengths in centimetres?
Yes. Select cm for centimetres, m for metres, or mm for millimetres. Both resonance lengths must use the same selected unit.
What happens if I skipped a resonance?
The separation will contain more than one half-wavelength, so the reported wavelength and sound speed will be too large by an integer multiple.
Does the calculator include end correction?
It does not need an explicit end correction. The same correction occurs in both consecutive readings and cancels when the lengths are subtracted.
What does an API calculation cost?
Each API request costs $0.002. The same deterministic calculation is also available free in the browser.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/optics/resonance-tube-speed-of-sound \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"frequency_hz":512,"first_resonance_length":16,"second_resonance_length":49.5}'const res = await fetch("https://api.kit.forhosting.com/optics/resonance-tube-speed-of-sound", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"frequency_hz": 512,
"first_resonance_length": 16,
"second_resonance_length": 49.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/optics/resonance-tube-speed-of-sound",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"frequency_hz": 512,
"first_resonance_length": 16,
"second_resonance_length": 49.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/optics/resonance-tube-speed-of-sound", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"frequency_hz":512,"first_resonance_length":16,"second_resonance_length":49.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"frequency_hz":512,"first_resonance_length":16,"second_resonance_length":49.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/optics/resonance-tube-speed-of-sound", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"frequency_hz": 512,
"first_resonance_length": 16,
"second_resonance_length": 49.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "optics.resonance_tube_speed_of_sound",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |