blog

here's what i'm working on

Sampling rate

October 16, 2021 — ~kai

Music is recorded and typically stored (encoded) using pulse code modulation (PCM). These files can get large, and FLAC is a common format that uses lossless compression to compress raw PCM files.

A digital audio file can be encoded in b bits and at a sampling rate of r kHz1. For example a “24/96” file is shorthand for b = 24 and r = 96.

Generally the maximum frequency stored in a file is r/2 (half the sampling rate). Humans can listen up to 20 kHz so it can be argued that a sampling rate r > 40 has no effect on enjoyment of music. CDs have r = 44.1.

The bit depth b helps give it dynamic range - how soft and loud it can get.

If someone gives you a file and claims it to be sampled at 96 kHz but a spectrogram (using software such as Spek or Sonic Visualizer) shows the maximum frequency to cut off at less than 48 kHz, then you can assume that they weren’t honest! It is likely that they took a lower quality file and converted it to FLAC.

Most of what I understood comes from here.

tags: music, art, ?


  1. A file can also be expressed in b ⋅ r kbps (kilobits per second).↩︎