Calculate the Nyquist Rate

Nyquist Rate Calculator .nyquist-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e1e4e8; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); color: #333; } .nyquist-calc-header { text-align: center; margin-bottom: 30px; } .nyquist-calc-header h2 { color: #2c3e50; margin-bottom: 10px; } .nyquist-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; } @media (max-width: 600px) { .nyquist-calc-grid { grid-template-columns: 1fr; } } .nyquist-input-group { display: flex; flex-direction: column; } .nyquist-input-group label { font-weight: 600; margin-bottom: 8px; font-size: 14px; color: #555; } .nyquist-input-group input, .nyquist-input-group select { padding: 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 16px; } .nyquist-calc-btn { background-color: #3498db; color: white; border: none; padding: 15px 25px; font-size: 18px; font-weight: bold; border-radius: 6px; cursor: pointer; width: 100%; transition: background-color 0.2s; } .nyquist-calc-btn:hover { background-color: #2980b9; } .nyquist-result-box { margin-top: 30px; padding: 20px; background-color: #f8f9fa; border-left: 5px solid #3498db; border-radius: 4px; } .nyquist-result-item { display: flex; justify-content: space-between; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .nyquist-result-item:last-child { border-bottom: none; } .nyquist-result-label { font-weight: 600; } .nyquist-result-value { font-family: monospace; font-size: 18px; color: #2c3e50; } .nyquist-article { margin-top: 40px; line-height: 1.6; color: #444; } .nyquist-article h3 { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 5px; margin-top: 25px; } .nyquist-formula-box { background: #f1f1f1; padding: 15px; text-align: center; font-size: 1.2em; margin: 20px 0; border-radius: 8px; font-family: "Courier New", Courier, monospace; }

Nyquist Rate Calculator

Determine the minimum sampling rate required to avoid aliasing in a signal.

Hertz (Hz) Kilohertz (kHz) Megahertz (MHz) Gigahertz (GHz)
Nyquist Rate (fs):
Nyquist Interval (Ts):

What is the Nyquist Rate?

The Nyquist rate is a fundamental concept in digital signal processing and information theory. Named after physicist Harry Nyquist, it defines the minimum sampling rate required to accurately reconstruct a continuous-time signal from its discrete samples without loss of information. According to the Nyquist-Shannon Sampling Theorem, if a signal contains no frequencies higher than B hertz, it is completely determined by giving its ordinates at a series of points spaced 1/(2B) seconds apart.

fs = 2 × fmax

How to Calculate the Nyquist Rate

Calculating the Nyquist rate is straightforward once you identify the highest frequency component of your analog signal:

  1. Identify fmax: Determine the maximum frequency present in the signal you wish to sample. For example, the human ear typically hears up to 20,000 Hz.
  2. Apply the Multiplier: Multiply that frequency by 2.
  3. Result: The product is the Nyquist rate in Hertz (samples per second).

Why the Nyquist Rate Matters: Preventing Aliasing

If a signal is sampled at a rate lower than the Nyquist rate, a phenomenon called aliasing occurs. Aliasing causes high-frequency components to be "misinterpreted" as lower-frequency components, creating distortions that cannot be corrected later. This is why high-quality audio recording (CD quality) uses a sampling rate of 44,100 Hz—slightly more than double the 20,000 Hz limit of human hearing.

The Nyquist Interval

The Nyquist interval is the reciprocal of the Nyquist rate. It represents the maximum time gap allowed between consecutive samples to ensure perfect reconstruction of the signal. It is calculated as:

Ts = 1 / (2 × fmax)

Practical Example

Imagine you are working with a radio signal that has a maximum frequency of 5 MHz. To calculate the Nyquist rate:

  • fmax: 5,000,000 Hz
  • Nyquist Rate: 2 × 5,000,000 = 10,000,000 samples per second (10 MS/s).
  • Nyquist Interval: 1 / 10,000,000 = 0.0000001 seconds (100 nanoseconds).
function calculateNyquistRate() { var inputFreq = document.getElementById('maxFrequency').value; var unitMultiplier = document.getElementById('freqUnit').value; var fMax = parseFloat(inputFreq); var multiplier = parseFloat(unitMultiplier); if (isNaN(fMax) || fMax = 1000000000) { resRate.innerText = (nyquistRateHz / 1000000000).toFixed(4) + " GHz"; } else if (nyquistRateHz >= 1000000) { resRate.innerText = (nyquistRateHz / 1000000).toFixed(4) + " MHz"; } else if (nyquistRateHz >= 1000) { resRate.innerText = (nyquistRateHz / 1000).toFixed(4) + " kHz"; } else { resRate.innerText = nyquistRateHz.toFixed(2) + " Hz"; } // Format Interval if (nyquistIntervalSec < 0.000001) { resInterval.innerText = (nyquistIntervalSec * 1000000000).toFixed(4) + " ns"; } else if (nyquistIntervalSec < 0.001) { resInterval.innerText = (nyquistIntervalSec * 1000000).toFixed(4) + " µs"; } else if (nyquistIntervalSec < 1) { resInterval.innerText = (nyquistIntervalSec * 1000).toFixed(4) + " ms"; } else { resInterval.innerText = nyquistIntervalSec.toFixed(6) + " s"; } }

Leave a Comment