Calculate sampling frequency from the sampling period (fs = 1/Ts), or find the period, Nyquist frequency, minimum sampling rate or FFT record length.

Optional settings

Calculator Functions

FunctionWhat it doesWhat it requires
Frequency from periodFinds the sampling frequency from the time between samplesRequires the sampling period in s, ms, min or h
Period from frequencyFinds the time between samples from the sampling frequencyRequires the sampling frequency in Hz, kHz or MHz
Nyquist frequencyFinds the highest frequency a sampling rate can representRequires the sampling frequency. A signal band limit to compare is optional
Minimum sampling rate (Nyquist)Finds the sampling rate that a signal's highest frequency calls forRequires the highest signal frequency or an example band limit. A sampling rate to compare is optional
FFT record durationFinds how long a block of samples lastsRequires the sampling frequency and the sample count
FFT sampling rateFinds the sampling rate that fits a sample count into a record durationRequires the sample count and the record duration
FFT sample countFinds how many whole samples cover a record durationRequires the sampling frequency and the record duration

The three FFT functions also report the FFT bin spacing. The example band limits, such as 20 kHz for audio or 150 Hz for an ECG, only fill in the highest signal frequency and can be replaced with the signal's real bandwidth.

Sampling Frequency Formulas

fs = 1 ÷ Ts
fsSampling frequency (Hz), the number of samples taken per second
TsSampling period (s), the time between one sample and the next

Frequency from period

This is the formula above. A sample every 1 ms is 1 ÷ 0.001 = 1,000 Hz. A sample every 30 seconds is 0.0333 Hz.

Period from frequency

Ts = 1 ÷ fs

Audio sampled at 44.1 kHz has 1 ÷ 44,100 = 0.00002268 s, about 22.7 microseconds, between samples.

Nyquist frequency

fN = fs ÷ 2 [2]

The Nyquist frequency is half the sampling rate. Signal content above it shows up at a false lower frequency, which is called aliasing [2]. A 44,100 Hz rate has a Nyquist frequency of 22,050 Hz. Compared with a 20 kHz band limit, 44,100 Hz is above the 40,000 Hz threshold.

Minimum sampling rate (Nyquist)

fs > 2 × fmax [1]

A signal that contains no frequencies above fmax is completely determined by samples taken 1 ÷ (2 × fmax) seconds apart [1], so the sampling rate has to be more than twice the highest signal frequency. A 20 kHz band limit gives a threshold of 40,000 Hz. With the 150 Hz ECG example the threshold is 300 Hz, so a 250 Hz rate is below it and aliasing is possible.

FFT record duration

T = N ÷ fs
Δf = fs ÷ N = 1 ÷ T [2]

N is the number of samples in the block, T is the record duration and Δf is the spacing between FFT bins [2]. A block of 1,024 samples at 1,024 Hz lasts 1 s and has 1 Hz bins.

FFT sampling rate

fs = N ÷ T

Fitting 2,048 samples into 2 s takes a sampling rate of 1,024 Hz, with 0.5 Hz bins.

FFT sample count

N = fs × T, rounded up

A partial sample cannot be taken, so the count rounds up and the actual duration is reported. At 1,000 Hz, a 0.5005 s record needs 501 samples, which last 0.501 s and give bins 1.996 Hz apart.

Limits of This Estimate

  • The 2 × rule is for an ideal signal with nothing above its band limit, sampled at even intervals. Real anti-alias filters roll off gradually, so practical sampling rates sit some way above the threshold.
  • A sampling rate exactly equal to twice the highest frequency leaves no margin and does not guarantee the signal can be rebuilt.
  • Bin spacing does not guarantee that two close tones can be told apart. Spectral leakage spreads energy into neighboring bins, and the window used changes how much [2].
  • The example band limits are illustrations. They are not clinical or equipment settings.

Sources

  1. C. E. Shannon, Communication in the Presence of Noise, Proceedings of the I.R.E., vol. 37, January 1949: the sampling theorem: a signal with no frequencies above W is fixed by samples taken 1/2W seconds apart
  2. National Instruments, Application Note 041, The Fundamentals of FFT-Based Signal Analysis and Measurement: FFT bin spacing as sampling rate divided by the number of points, the Nyquist criterion, aliasing and spectral leakage