Sampling Rate Calculator Formula

Understand the math behind the sampling rate calculator. Each variable explained with a worked example.

Formulas Used

Minimum Sampling Rate (Nyquist)

min_sampling_rate = 2 * max_signal_freq_hz

Practical Sampling Rate

practical_rate = oversampling_ratio * max_signal_freq_hz

Data Rate (16-bit mono)

data_rate_16bit = oversampling_ratio * max_signal_freq_hz * 16

Variables

VariableDescriptionDefault
max_signal_freq_hzMaximum Signal Frequency(Hz)20000
oversampling_ratioOversampling Ratio2

How It Works

How to Determine Sampling Rate

The Nyquist theorem states the minimum sampling rate is twice the highest signal frequency.

Formulas

f_sample_min = 2 x f_max

f_sample_practical = Oversampling Ratio x f_max

In practice, engineers oversample (4x to 8x or more) because:

  • Perfect brick-wall anti-aliasing filters do not exist
  • Oversampling reduces quantization noise
  • It allows simpler, cheaper analog filters
  • Worked Example

    Capture audio up to 20 kHz with 2x oversampling.

    max_signal_freq_hz = 20000oversampling_ratio = 2
    1. 01Minimum (Nyquist): 2 x 20,000 = 40,000 Hz
    2. 02Practical rate: 2 x 20,000 = 40,000 Hz
    3. 03Data rate (16-bit): 40,000 x 16 = 640,000 bits/s = 640 kbps

    Frequently Asked Questions

    Why not just sample as fast as possible?

    Higher sampling rates require more storage, bandwidth, and processing power. Choose a rate that balances quality and resources.

    What oversampling ratio should I use?

    For basic measurement: 2.5-3x. For precision: 4-8x. For sigma-delta converters: 64-256x.

    Does higher sampling rate mean better quality?

    Only if there is signal content above the current Nyquist frequency. For signals already band-limited, more resolution (bits) helps more than more speed.

    Ready to run the numbers?

    Open Sampling Rate Calculator