Audio Sample Rate & File Size Calculator
Understanding Audio Sample Rate
The sample rate is a fundamental concept in digital audio processing that defines how many times per second an analog audio signal is measured (sampled) to create a digital representation. Measured in Hertz (Hz) or Kilohertz (kHz), the sample rate directly influences the frequency range that can be accurately captured and reproduced.
Common sample rates include 44.1 kHz (standard for CDs) and 48 kHz (standard for video production). This calculator helps engineers, audiophiles, and developers determine the data requirements and theoretical limits of their digital audio projects.
The Nyquist-Shannon Sampling Theorem
To accurately digitize a sound, the sample rate must be at least twice the highest frequency in the audio signal. This rule is known as the Nyquist Theorem.
- Highest Frequency ($f_{max}$): The highest pitch you want to record. For human hearing, this is generally 20,000 Hz (20 kHz).
- Nyquist Rate: The minimum sample rate required, calculated as $2 \times f_{max}$.
- Aliasing: If the sample rate is too low (below the Nyquist rate), high frequencies will be misinterpreted as lower frequencies, causing distortion known as aliasing.
For example, to capture up to 20,000 Hz, you need a sample rate of at least 40,000 Hz. The CD standard of 44,100 Hz provides a small buffer (guard band) above this theoretical minimum to allow for anti-aliasing filters to work effectively.
Calculating Audio File Size
Uncompressed audio files (like WAV or AIFF) consume storage space based on a linear relationship between duration, sample rate, bit depth, and channel count. Understanding this formula is crucial for estimating disk space requirements for recording sessions.
File Size (bits) = Sample Rate × Bit Depth × Channels × Duration (seconds)
File Size (Bytes) = File Size (bits) / 8
Inputs explained:
- Sample Rate: The number of snapshots taken per second (e.g., 48,000).
- Bit Depth: The dynamic range or resolution of each sample (e.g., 16-bit or 24-bit). Higher bit depth lowers the noise floor.
- Channels: Mono = 1, Stereo = 2. Each channel multiplies the data requirement.
Bitrate vs. Sample Rate
While sample rate determines the frequency response, Bitrate refers to the amount of data processed per second. It is usually measured in kilobits per second (kbps).
For uncompressed audio:
Bitrate = Sample Rate × Bit Depth × Channels.
For example, a stereo CD track (44.1 kHz, 16-bit) has a bitrate of approximately 1,411 kbps.