SAMPLING - WHAT IS IT?![]() Sampling and SequencingDuring the 1980’s the general population was introduced to sampling in mainstream pop music, but what is it? Well, simply put sampling is a technique in which a sound is electronically recorded, processed then played back. A single sound recording is referred to as a sample. To understand exactly what a sample is, a basic understanding of the physics of sound and how computers store digital information is required. This document introduces these subjects. What is Sound?Sound is basically pressures waves that are transmitted from a sound source (e.g. a speaker), through a medium such as air until it reaches our ears. Our ears then convert these pressure waves into electrical signals that our brain interprets as sound. When there isn’t a medium for sound to travel through (i.e. a vacuum such as space), sound waves are not generated (there is nothing for them to travel through). So next time you watch Star Wars imagine how odd it would be if it were realistic - there would be no laser gun blasts, thundering engine sounds an explosions sounds! How boring! To understand what a sound wave is, they can be liked to ripples on a pond. The pressure waves of sound are similar to the ripples that are created on a pond when a stone is dropped into it (figure 1). If a cork were placed on the surface of the pond we would see the cork bob up and down as the ripples passed. This up and down displacement of the cork is called amplitude, and the bigger the ripple the bigger the amplitude. If we were to plot the amplitude of the ripple against time, then we would see something like that shown in the graph in figure 2. This graph is an illustration of a sound wave. When this sound wave is electronically recorded we call it a sample, but how is it electronically stored? Binary, Bits, Nibbles and BytesA computer is just an elaborate calculator capable of doing lots of calculations and storing lots of numbers. Computers store information using binary. Binary is a method in which numbers are stored as a sequence of on/off switches. Each of these switches is referred to as a bit. When there are 2 bits (switches) there are 4 possible combinations: When there are 8 bits there is 256 possible combinations and when there are 16 bits there is 65,536 possible combinations. Now here’s where someone had a sense of humour. 4 bits are called a nibble, 8 bits called a byte, 16 bits called a word and 32 bits called a double word. The SampleA sound wave like that shown above can be stored in a computer by slicing the wave into small sections of time, then working out the amplitude of the sound in each section. These little sections are sometimes called discrete samples, or for short, a sample. This process of converting a sound wave is called digitisation. Because the sound wave is to be stored in a computer the number of bits used for each discrete sample must be determined, or in other words, how many different amplitude levels will be used for each slice of time. These amplitude levels are called quantisation levels. If 4 bits (a nibble) are used a total of 16 different quantisation levels are available in each time slice. This is fine for a child’s toy but yields a poor sound quality. If 8 bits are used (a byte) at total of 256 different quantisation levels are available for each discrete sample. This produces a better quality sound to that when 4 bits are used and is often used in telephone applications and some of the older computers such as the Commodore Amiga (an old favourite). However this is isn’t a particularly high quality. Moving up to 16 bits provides 65,536 different quantisation levels for a discrete sample. This gives a much higher sound quality and is used on compact discs (CD’s) and most modern sound cards in PC’s. However, at the professional level, 16 bits isn’t enough so 32 bits or higher are often used. Quantisation ErrorIt has already been discussed that the more quantisation levels used the better the sound quality. The reason for this is when lower quantisation levels are used; the greater the quantisation error is when compared to a sample with higher quantisation levels. So what is quantisation error? Quantisation error results when there is not enough quantisation levels to truly represent the original sound wave. Figure 3 illustrates this. The quantisation error (marked green) is the region of overlap between the original sound (blue) and the result of digitisation (red bars). A sound that has lots of quantisation error sounds very coarse (very un-natural). ![]() Sampling RateGoing back to the sound wave, once we’ve chosen how many bits to use for each sample (the number of quantisation levels), and divided the sound wave up into discrete samples, we could imagine them plotted as a bar graph with each bar representing one discrete sample (shown in figure 4). This bar graph starts to look a little bit like the original sound wave. Obviously it’s not quite the same because it has lots of steps on it. To improve upon this we can increase the number of quantisation levels (as discussed above) and/or divide the original sound wave into more discrete samples (figures 4, 5 and 6). This is called increasing the sampling rate (more divisions for the same period of time). Figure 5 shows the effect of doubling the sample rate compared to that in figure 4. The sampling rate is how many discrete samples there are in one second of sound and is measured in Hertz (the letters Hz for short). For example, if you wanted 100 discrete samples in 1 second, the sampling rate would be 100 Hz (figure 4), 200 samples in one second is 200 Hz (figure 5) and 400 samples in 1 second is 400 Hz (figure 6). So as the sampling rate increases, the bar chart is increasingly looking like the original sound wave. This means that the sound wave stored in the computer will sound more like the original sound wave as the sampling rate increases. However, as the sampling rate increases we need to store more information in the computer for the same sound wave. In the old days of computers the amount of memory in a computer was finite so it was a fine balancing act between choosing a sampling rate and bits per sample (quantisation levels) and sound quality. |