Sampling Rate Design Calculator
Try Keep Highest Signal Frequency (Hz) at 500 and compare Oversampling Factor at 2.5x with 4x.
Observe The opening 2.5x setting recommends 1,250 Hz against a 1,000 Hz Nyquist minimum. With 12 bits, 60 seconds and one channel, storage is 146.5 KB.
Explain Oversampling Factor multiplies the highest frequency; storage then multiplies that rate by bytes per sample, duration and channel count.
Calculate sampling budget
Reset
Technical boundaries. Storage assumes whole bytes per sample, rounded up, without file headers or compression. The filter cutoff is simply the highest signal frequency, and estimated current follows the fixed rule 2 + 0.001 times sampling rate in mA.
Sampling Rate Design Calculator
Use this calculator to determine the required sampling rate, storage needs, and estimated power draw for your IoT sensor design. Enter your signal parameters and the calculator will apply the Nyquist theorem with practical engineering margins.
viewof calcFmax = Inputs. range ([0.001 , 100000 ], {
value : 500 ,
step : 0.001 ,
label : "Highest Signal Frequency (Hz)"
})
calcOversamplingOptions = [
{label : "2x (Nyquist minimum -- not recommended)" , value : 2 },
{label : "2.5x (Minimum practical)" , value : 2.5 },
{label : "3x (Moderate margin)" , value : 3 },
{label : "4x (Good margin)" , value : 4 },
{label : "5x (Conservative / industrial)" , value : 5 },
{label : "10x (High-fidelity / medical)" , value : 10 }
]
viewof calcOversampling = Inputs. select (
// Scalar option values survive the primary verb's current-input snapshot.
calcOversamplingOptions. map (d => d. value ),
{
value : 2.5 ,
label : "Oversampling Factor" ,
format : value => calcOversamplingOptions. find (d => d. value === value). label
}
)
viewof calcBits = Inputs. select ([8 , 10 , 12 , 16 , 24 ], {
value : 12 ,
label : "ADC Resolution (bits)"
})
viewof calcDuration = Inputs. range ([1 , 86400 ], {
value : 60 ,
step : 1 ,
label : "Recording Duration (seconds)"
})
viewof calcChannels = Inputs. range ([1 , 8 ], {
value : 1 ,
step : 1 ,
label : "Number of Channels"
})
calcNyquistMin = 2 * calcFmax
calcRecommended = calcOversampling * calcFmax
calcBytesPerSample = Math . ceil (calcBits / 8 )
calcTotalSamples = calcRecommended * calcDuration * calcChannels
calcStorageBytes = calcTotalSamples * calcBytesPerSample
calcStorageFormatted = calcStorageBytes < 1024 ? calcStorageBytes + " B"
: calcStorageBytes < 1048576 ? (calcStorageBytes / 1024 ). toFixed (1 ) + " KB"
: calcStorageBytes < 1073741824 ? (calcStorageBytes / 1048576 ). toFixed (2 ) + " MB"
: (calcStorageBytes / 1073741824 ). toFixed (2 ) + " GB"
calcFilterCutoff = calcFmax
calcPowerMA = 2 + 0.001 * calcRecommended
calcDataRateKBps = (calcRecommended * calcBytesPerSample * calcChannels / 1024 ). toFixed (2 )
html `<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0;">
<div style="background: #2c3e50; color: white; padding: 15px; border-radius: 8px; text-align: center;">
<div style="font-size: 11px; text-transform: uppercase; opacity: 0.8;">Nyquist Minimum</div>
<div style="font-size: 22px; font-weight: bold; margin: 5px 0;"> ${ calcNyquistMin. toLocaleString ()} Hz</div>
<div style="font-size: 11px; opacity: 0.7;">2 x f_max (theoretical)</div>
</div>
<div style="background: #0b6b50; color: white; padding: 15px; border-radius: 8px; text-align: center;">
<div style="font-size: 11px; text-transform: uppercase; opacity: 0.8;">Recommended Rate</div>
<div style="font-size: 22px; font-weight: bold; margin: 5px 0;"> ${ calcRecommended. toLocaleString ()} Hz</div>
<div style="font-size: 11px; opacity: 0.7;"> ${ calcOversampling} x oversampling</div>
</div>
<div style="background: #7a4a00; color: white; padding: 15px; border-radius: 8px; text-align: center;">
<div style="font-size: 11px; text-transform: uppercase; opacity: 0.8;">Anti-Aliasing Filter</div>
<div style="font-size: 22px; font-weight: bold; margin: 5px 0;"> ${ calcFilterCutoff. toLocaleString ()} Hz</div>
<div style="font-size: 11px; opacity: 0.7;">Cutoff = f_max (signal bandwidth)</div>
</div>
</div>
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0;">
<div style="background: #34495e; color: white; padding: 12px; border-radius: 6px; text-align: center;">
<div style="font-size: 16px; font-weight: bold;"> ${ calcStorageFormatted} </div>
<div style="font-size: 10px; opacity: 0.7;">Total Storage</div>
</div>
<div style="background: #34495e; color: white; padding: 12px; border-radius: 6px; text-align: center;">
<div style="font-size: 16px; font-weight: bold;"> ${ calcDataRateKBps} KB/s</div>
<div style="font-size: 10px; opacity: 0.7;">Data Rate</div>
</div>
<div style="background: #34495e; color: white; padding: 12px; border-radius: 6px; text-align: center;">
<div style="font-size: 16px; font-weight: bold;"> ${ calcTotalSamples. toLocaleString ()} </div>
<div style="font-size: 10px; opacity: 0.7;">Total Samples</div>
</div>
<div style="background: #34495e; color: white; padding: 12px; border-radius: 6px; text-align: center;">
<div style="font-size: 16px; font-weight: bold;">~ ${ calcPowerMA. toFixed (1 )} mA</div>
<div style="font-size: 10px; opacity: 0.7;">Est. ADC Current (ESP32)</div>
</div>
</div>
<div style="background: #f8f9fa; border-left: 4px solid #0b6b50; padding: 12px 15px; margin-top: 15px; border-radius: 0 6px 6px 0; font-size: 13px;">
<strong>Design formula:</strong>
Storage = ${ calcRecommended. toLocaleString ()} samples/s x ${ calcBytesPerSample} bytes x ${ calcDuration. toLocaleString ()} s x ${ calcChannels} ch = <strong> ${ calcStorageFormatted} </strong>
</div>`
How to use: Enter your signal’s highest frequency component, then choose a sampling margin for the anti-alias filter and timing requirements before setting ADC resolution, recording duration, and channel count. The calculator outputs the Nyquist minimum, practical recommended rate, required anti-aliasing filter cutoff, storage budget, data throughput rate, and estimated ESP32 ADC current draw.
Back to the chapter