Jump to content

Digital sampling

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Unused0022 (talk | contribs) at 16:45, 11 January 2006 (Recording samples). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Digital sampling, PCM sampling, or just sampling is the recording of sound as a series of numbers which represent the measurement of the sound's amplitude, taken at regular intervals. PCM is an acronym for Pulse-code modulation. The process of sampling is the same as making any other sort of digital recording. In contrast to a digital recording which may be a complete piece of music, for example, a sample is typically a short, simple sound which is reused again and again.

Samples can be created using a sampler, which is a musical instrument capable of recording samples. A sampler is traditionally a keyboard instrument, but may also be packaged as a sound module. Samples may also be recorded using a variety of software and hardware including software samplers, digital audio workstations, and even sound recording applets which typically ship with an operating system.

Types of samples

Once recorded, samples can be edited, played back, or looped (i.e. played back continuously). Types of samples include:

  • Loops. The drums and percussion parts of many modern recordings are really a variety of short samples of beats strung together. Many libraries of such beats exist and are licensed so that the user incorporating the samples can distribute their recording without paying royalties. Such libraries can be loaded into samplers. Though percussion is a typical application of looping, many kinds of samples can be looped. A piece of music may have an ostinato which is created by sampling a phrase played on any kind of instrument. There is software which specializes in creating loops.
  • Samples of musical instruments. Whereas loops are usually a phrase played on a musical instrument, this type of sample is just a single note. Music workstations and samplers use samples of musical instruments as the basis of their own sounds, and are capable of playing a sample back at any pitch. Many modern synthesizers and drum machines also use samples as the basis of their sounds. (See sample-based synthesis for more information.) Most such samples are created in professional recording studios using world-class instruments played by accomplished musicians. These are usually developed by the manufacturer of the instrument or by a subcontractor who specializes in creating such samples. There are businesses and individuals who create libraries of samples of musical instruments. Of course, a sampler allows anyone to create such samples. Samples used in musical instruments sometimes have a looped component. An instrument with indefinite sustain, such as a pipe organ, does not need to be represented by a very long sample because the sustained portion of the timbre is looped. The sampler (or other sample playback instrument) plays the attack and decay portion of the sample followed by the looped sustain portion for as long as the note is held, then plays the release portion of the sample.
  • Resampled layers of sounds generated by a music workstation. To conserve polyphony, a workstation may allow the user to sample a layer of sounds (piano, strings, and voices, for example) so they can be played together as one sound instead of three. This leaves more of the instruments' resources available to generate additional sounds.
  • Samples of recordings. There are several genres of music in which it is commonplace for an artist to sample a phrase of a well-known recording and use it as an element in a new composition. Two well-known examples include the sample of Rick James' "Super Freak" in MC Hammer's "U Can't Touch This" and the sample of Queen/David Bowie's "Under Pressure" in Vanilla Ice's "Ice Ice Baby". For the main article on this specific practice, see sampling (music).
  • Sound effects. Many incidental sounds in radio, film, and television are samples added to the broadcast or soundtrack. Examples include such sounds as breaking glass, laser blasts, or squealing tires.
  • Startup sounds and audio cues. In the user interface of application software, samples are often used as startup sounds which are heard in conjunction with a splash screen or as audio cues to alert the user to events such as the receipt of email or the recording of a transaction, for example.
  • Samples in video games. Many video games make extensive use of samples to provide audio feedback of the events taking place within the game.
  • Samples in toys. Sounds made by children's toys such as talking dolls or books with sounds may be samples.

Recording samples

Though samples are typically no longer than a few seconds in length, they are nevertheless the same as any other digital recording. The music on a CD, for example, can be thought of as a very long sample.

The quality of a sample depends on many factors, but two very important variables in the sampling process itself are the sampling frequency and resolution. The sampling frequency or sample rate is the number of times per second that an analog-to-digital converter measures the amplitude of voltage in an analog signal, which itself is an electrical representation of sound pressure. Each such measurement is also called a sample. Sample rate is measured in kilohertz. The resolution (also referred to as bit width or word size) refers to the number of bits used to describe the sound's amplitude at each sample.

A sample which is "CD quality" is recorded with a sample rate of 44.1 kHz and a resolution of 16 bits. That means 44100 samples are teken every second, and, for each sample, 16 bits of data are recorded. 16 bits can be used to represent 216 distinct values, so each sample is just a number from 0 to 65535. If the recording is in stereo, two such recordings are made simultaneously, one for each channel.

Because the voltage in an analog signal is continuous, meaning that there are an infinite number of amplitude values between any two moments in time, faster sample rates represent the analog signal more accurately than lower sample rates. Sample rates can be much higher (and much lower) than CD quality. 192 kHz is now typical in professional recording equipment. Most samples played back by childrens' toys use comparatively lower sample rates and often sound "scratchy" as a result.

The law of diminishing returns suggests that each successive jump in sample rate (or bit width) brings a continously smaller improvement in the quality of a sample and, while not literally true (doubling the sample rate does double the quality of the sample), it is certainly true that each such jump becomes less noticable. Most listeners consider a CD-quality sample a high fidelity recording and probably would not notice the difference if the sample rate and resolution were considerably higher than CD-quality. The benefit of the higher sample rates used in recording studios is that more data is available to manipulate into a final product, even if that final product is "just" CD quality.

The highest frequency in the original sound that can be represented by the samples at a given sample rate without a kind of distortion known as aliasing is limited to half the sampling rate. See Nyquist-Shannon sampling theorem.

See also