Skip to content
Documentation sections

I2S Audio Interface Timing Calculator

POSThttps://rftools.io/api/py/v1/calculate

Slug i2s-timing. Calculate I2S bit clock (BCLK), word clock (LRCLK/WCLK), and data rate for audio interfaces at any sample rate, bit depth, and channel count.

Inputs

Send every one of these in inputs, in the units shown. Most are required: a call without one is refused (400) and costs nothing; one the calculator can do without takes the default shown. An input outside its range is still computed and flagged in the provenance.

Inputs of i2s-timing
NameUnitRangeDefaultDescription
sampleRatenumberkHz0.1 … 76844.1Audio sample rate (e.g., 44.1, 48, 96, 192 kHz)
bitDepthnumberbits8 … 6424Bits per sample (common: 16, 24, 32 bits)
channelsnumbernone1 … 322Number of audio channels (1 for mono, 2 for stereo)
mclknumberMHz0.1 … 20016.9344The clock BCLK is divided from by a whole number: 16.9344 MHz is 384 × 44.1 kHz, 12.288 MHz is 256 × 48 kHz
rateBudgetnumber%0.001 … 100.1The sample-rate error the link can take; ±0.1 % (1000 ppm) is IEC 60958-3's Level II clock accuracy for consumer digital audio

Outputs

Returned in values, by key. A value that is unbounded or undefined is null.

Outputs of i2s-timing
FieldUnitDescription
bclkheadlineMHzBit clock frequency: BCLK = Fs × bit_depth × channels
wclkkHzWord/frame clock frequency = sample rate
bclkPeriodnsPeriod of one BCLK cycle
dataRateMbpsRaw audio data rate on the I2S bus
mclkDividernoneThe whole number MCLK is divided by, the nearest to MCLK/BCLK
bclkActualMHzMCLK over the divider
sampleRateActualkHzThe actual BCLK over the bits in a frame
sampleRateError_pct%Actual over requested, signed; zero only where MCLK is a whole multiple of BCLK

Calling it

  • Calculate: one call, the request and response in full, and its errors.
  • Batch: this calculator with others, or a sweep, in one request.
  • Solve for a target: the value of one input that brings an output to a target.