GestureSynth.me

Music calculator

Audio Sample Clock Drift Calculator

Estimate accumulated drift between two audio recorders. Enter both signed sample-clock offsets, the shared nominal rate and real elapsed seconds.

audio sample clock drift calculator

Audio Sample Clock Drift Calculator guide

Line up a slate at the start of two recordings and compare another slate near the end. A widening separation can come from different sampling clocks even when both files say 48 kHz. The calculator predicts the relative sample count from the signed clock errors, then expresses that difference on a timeline running at the shared nominal rate.

Play the instrument ↑
Default result
18 ms timeline drift

Calculation and units

Over T real seconds, a clock with nominal rate F and offset p ppm accumulates F × T × (1 + p/1000000) frames. Subtraction cancels the common nominal term. The frame difference is F × T × (pA − pB)/1000000. Dividing by F gives the difference in nominal playback seconds, with a positive sign when A holds more frames.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Ten-minute dialogue take

Nominal sample rate (Hz) = 48000 · Recorder A offset (ppm) = 20 · Recorder B offset (ppm) = -10 · Real elapsed time (s) = 600.

18 ms timeline drift. 864 sample frames (A minus B). Both recordings are interpreted at the nominal sample rate.

A runs thirty parts per million faster than B in relative sample accumulation. Because both files are interpreted at the same nominal rate, more samples translate into a longer nominal duration for A.

One minute of the same take

Nominal sample rate (Hz) = 48000 · Recorder A offset (ppm) = 20 · Recorder B offset (ppm) = -10 · Real elapsed time (s) = 60.

1.8 ms timeline drift. 86.4 sample frames (A minus B). Both recordings are interpreted at the nominal sample rate.

Reducing elapsed time by a factor of ten reduces both timeline separation and frame-count difference by that factor. A fixed input buffering delay would not show this dependence on duration.

Matched fast clocks

Nominal sample rate (Hz) = 48000 · Recorder A offset (ppm) = 25 · Recorder B offset (ppm) = 25 · Real elapsed time (s) = 3600.

0 ms timeline drift. 0 sample frames (A minus B). Both recordings are interpreted at the nominal sample rate.

Each recorder runs faster than ideal but their rates agree. Their files can align with each other while both differ in duration from a separate, more accurate reference.

Opposite order

Nominal sample rate (Hz) = 48000 · Recorder A offset (ppm) = -10 · Recorder B offset (ppm) = 20 · Real elapsed time (s) = 600.

-18 ms timeline drift. -864 sample frames (A minus B). Both recordings are interpreted at the nominal sample rate.

Swapping the clock offsets reverses the sign. Select a reference recorder and keep it consistent when comparing this result with the sign of offsets reported by an editing program.

Higher nominal rate

Nominal sample rate (Hz) = 96000 · Recorder A offset (ppm) = 20 · Recorder B offset (ppm) = -10 · Real elapsed time (s) = 600.

18 ms timeline drift. 1728 sample frames (A minus B). Both recordings are interpreted at the nominal sample rate.

The time difference stays the same as in the first example, but twice as many frames occupy that duration. This matters when the editing control accepts a sample count.

Long two-recorder session

Nominal sample rate (Hz) = 44100 · Recorder A offset (ppm) = 15 · Recorder B offset (ppm) = -15 · Real elapsed time (s) = 3600.

108 ms timeline drift. 4762.8 sample frames (A minus B). Both recordings are interpreted at the nominal sample rate.

Small independent offsets can accumulate into an audible synchronization error during a continuous hour. File length alone cannot separate this rate effect from silence trimmed off one end.

Interpreting the result

Use the same starting event in both recordings and compare distances between two events. An initial buffer offset or different trigger time shifts the whole recording by a fixed amount. Subtracting the starting offset before comparing the end helps distinguish that fixed latency from a rate difference that grows throughout the take.

Measurement and model limits

If all you have is a tolerance, try both ends of the range. Two recorders each rated within 20 ppm can happen to drift together very little, while one fast and the other slow can differ by 40 ppm. The sign remains unknown until a measurement identifies which clock accumulated more frames.

Answers before you play

Common questions

Why is the result sometimes fractional in frames?

This is a continuous expectation from a rate error over time. Actual file frames are whole numbers, and the observed count can depend on the timing of the first and last sample relative to the measurement interval.

Will this predict drift after sample-rate conversion?

Only if the original independent rates still determine the timeline relationship. A shared clock, asynchronous rate matching, dropped samples or software resynchronization can change the result. Check the capture chain before estimating a correction from two oscillator data sheets.

Which recorder is ahead when the result is positive?

A has accumulated more sample frames over the same real interval. Read on their nominal timelines, an event at the end of that interval appears later in A's file.

Which time goes in the seconds field?

Use real elapsed time between common events. A known one-hour reference interval is 3600 seconds even when the two recorder timelines place the end marker at slightly different positions.