İçeriğe geç

Ders 5 · Sound and Digital Audio

Sample Rate, Bit Depth and Audio Files

Learn how computers store sound: sample rate, the Nyquist limit, aliasing, bit depth, dither, common audio file formats and how to estimate file sizes.

A microphone produces an electrical signal that changes smoothly. A computer stores numbers. An analog-to-digital converter (A/D) turns the signal into numbers, and a digital-to-analog converter (D/A) turns numbers back into a signal for your speakers or headphones.

Two settings describe this process: sample rate and bit depth. You choose them when you start a project, so it helps to know what they do.

What you will learn

  • What sample rate controls and what the Nyquist limit is
  • What bit depth controls
  • Which file formats keep all the audio data
  • How to estimate the size of uncompressed audio

Sample rate

The converter measures the signal many times each second. Each measurement is a sample. The sample rate is the number of samples per second, for each channel.

Sample rate Common use
44.1 kHz CD audio and much music
48 kHz Video and film work, and many music projects
88.2 or 96 kHz Some recording and sound design work

Note that this meaning of "sample" differs from a sample as a short recorded sound that you load into a sampler. Producers use both.

The Nyquist limit

To capture a frequency correctly, the sample rate must be more than twice that frequency. Half the sample rate is called the Nyquist frequency. At 44.1 kHz it is 22.05 kHz. At 48 kHz it is 24 kHz. Both are above the usual upper limit of human hearing.

A properly designed system can rebuild a smooth signal from the samples for frequencies below the limit. The stair-step pictures often used to explain digital audio are misleading: your speakers do not receive those hard steps in a well-designed converter.

Aliasing

What if a frequency above the Nyquist limit is sampled? It appears as a different, false frequency. This is aliasing. For a frequency between half the sample rate and the full sample rate, the false frequency is:

alias = sample rate − input frequency

For example, at a 48 kHz rate, a 30 kHz tone would appear at 18 kHz. Converters use anti-aliasing filters to remove high content before it causes this problem. Aliasing can also be created inside software, for example by some distortion effects and digital oscillators. Many plugins offer oversampling to reduce it, at the cost of more processing.

Bit depth

Each sample is stored with a limited number of steps. Bit depth sets how precise that is. More bits give a lower noise floor from rounding, which means more room between the loudest signal and that noise.

A useful rule: each bit adds about 6 dB of theoretical dynamic range.

Format Theoretical range, roughly
16-bit integer 96 dB
24-bit integer 144 dB
32-bit float Far larger, with very large headroom

Real converters and microphones have their own noise, so you do not get the full 24-bit figure in a real recording. Still, 24-bit gives plenty of room, so you can record with safe, moderate levels.

32-bit float can represent values above 0 dBFS. Many DAWs mix internally in floating point. However, this does not fix a signal that already clipped at the microphone preamp or at a fixed-point converter. Some recorders use special converter designs that give a wider input range. Check your device's documentation.

Dither

When you reduce bit depth, for example from 24-bit to 16-bit, the values must be rounded. This rounding can create distortion on very quiet material. Dither adds a tiny amount of noise that turns the distortion into steady, low noise. A common practice is to apply dither once, at the final step of lowering the bit depth.

File formats

Type Examples What happens to the data
Uncompressed WAV, AIFF (usually PCM) All sample values are stored
Lossless compression FLAC, ALAC Smaller, and the original samples can be rebuilt exactly
Lossy compression MP3, AAC, Ogg Vorbis Much smaller, but some information is removed for good

Use uncompressed or lossless files while you work. Make lossy copies for sharing when needed. Converting an MP3 to WAV does not bring back removed information.

File size

For uncompressed audio:

bytes = sample rate × (bit depth ÷ 8) × channels × seconds

For one minute of stereo audio at 48 kHz and 24-bit:

48,000 × 3 × 2 × 60 = 17,280,000 bytes, about 17.3 MB.

Ten such tracks recorded for five minutes use about 864 MB. This count ignores small file headers and any extra takes. Mono tracks use half as much as stereo tracks.

Which settings should you choose?

  • For many projects, 48 kHz and 24-bit is a sensible starting point.
  • If you deliver for a specific client or service, follow their specification.
  • Keep one sample rate for the whole project.
  • Higher rates use more disk space and processing power. They do not automatically make music sound better.

Common mistakes

  • Mixing up sample rate and bit depth. One is about time, the other about level precision.
  • Playing a file at the wrong sample rate, which changes its speed and pitch.
  • Saving your only copy of a project's audio in a lossy format.
  • Assuming 32-bit float repairs a signal that clipped before conversion.

Try it

Estimate how much space your session needs.

Audio file size calculator

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the Nyquist frequency at a 48 kHz sample rate?

    The Nyquist frequency is half the sample rate.
  2. 2. Which setting mainly affects the theoretical noise floor of integer audio?

    Each extra bit adds about 6 dB of theoretical dynamic range.
  3. 3. Which format is lossy?

    MP3 removes some information to make the file much smaller.
  4. 4. When is dither commonly used?

    Dither handles rounding errors that happen when bit depth is lowered.

Summary

  • Sample rate is the number of samples per second per channel.
  • Frequencies must stay below half the sample rate, or aliasing can occur.
  • Bit depth affects precision and noise floor, at about 6 dB per bit.
  • Work in uncompressed or lossless formats.
  • 48 kHz and 24-bit is a sensible default for many projects.

Next: Hearing Safety for Producers

İlerlemeni takip et

Dersleri işaretlemek ve herhangi bir cihazda kaldığın yerden devam etmek için ücretsiz bir hesap oluştur.