15
Sampling rate & Bit Depth

Sampling rate bit depth_lossey lossless

Embed Size (px)

DESCRIPTION

Sampling rate bit depth_lossey lossless

Citation preview

Page 1: Sampling rate bit depth_lossey lossless

Sampling rate&

Bit Depth

Page 2: Sampling rate bit depth_lossey lossless

What is SoundAll sounds are vibrations traveling through the air as sound waves. Sound waves are caused by the vibrations of objects and radiate outward from their source in all directions.

A vibrating object compresses the surrounding air molecules (squeezing them closer together) and then rarefies them (pulling them farther apart). Although the fluctuations in air pressure travel outward from the object, the air molecules themselves stay in the same average position.

As sound travels, it reflects off objects in its path, creating further disturbances in the surrounding air. When these changes in air pressure vibrate your eardrum, nerve signals are sent to your brain and are interpreted as sound.

Page 3: Sampling rate bit depth_lossey lossless

Fundamentals of a Sound Wave

• The simplest kind of sound wave is a sine wave. Pure sine waves rarely exist in the natural world, but they are a useful place to start because all other sounds can be broken down into combinations of sine waves. A sine wave clearly demonstrates the three fundamental characteristics of a sound wave: frequency, amplitude,

Page 4: Sampling rate bit depth_lossey lossless

Frequency• Frequency is the rate, or number of times per second, that

a sound wave cycles from positive to negative to positive again. Frequency is measured in cycles per second, or hertz (Hz). Humans have a range of hearing from 20 Hz (low) to 20,000 Hz (high). Frequencies beyond this range exist, but they are inaudible to humans.

Amplitude• Amplitude (or intensity) refers to the strength of a sound

wave, which the human ear interprets as volume or loudness., Audio meters use a logarithmic scale (decibels) to make the units of measurement for audio loudness.

Page 5: Sampling rate bit depth_lossey lossless

Digital Audio

• Bit rate refers to the amount of data, specifically bits, transmitted or received per second.

• One of the most common bit rates given is that for compressed audio files. For example, an MP3 file might be described as having a bit rate of 160 kbit/s or 160000 bits/second. This indicates the amount of compressed data needed to store one second of music.

• The standard audio CD is said to have a data rate of 44.1 kHz/16, meaning that the audio data was sampled 44,100 times per second, with a bit depth of 16. CD tracks are usually stereo, using a left and right track, so the amount of audio data per second is double that of mono, where only a single track is used. The bit rate is then 44100 samples/second x 16 bits/sample x 2 tracks = 1,411,200 bit/s or 1.4 Mbit/s.

Page 6: Sampling rate bit depth_lossey lossless

Digital Audio

• To fully define a sound file's digital audio bit rates: the format of the data, the sampling rate, word size (bit depth), and the number of channels (e.g. mono, stereo, quad), must be known.

• Calculating values• An audio file's bit rate can be calculated given sufficient information.

Given any three of the following four values, the fourth can be calculated.

• Bit rate = (sampling rate) × (bit depth) × (number of channels)E.g., for a recording with a 44.1 kHz sampling rate, a 16 bit depth, and 2 channels (stereo):

• 44100 × 16 × 2 = 1411200 bits per second = 1411.2 kbit/sTheeventual file size of an audio recording can also be calculated using a similar formula:

Page 7: Sampling rate bit depth_lossey lossless

Sample rate indicates the number of digital snapshots taken of an audio signal eachsecond. This rate determines the frequency range of an audio file. The higher thesample rate, the closer the shape of the digital waveform is to that of the originalanalogue waveform. Low sample rates limit the range of frequencies that can berecorded, which can result in a recording that poorly represents the original sound.

A. Low sample rate that distorts the original sound wave.

B. High sample rate that perfectly reproduces the original sound wave.

Page 8: Sampling rate bit depth_lossey lossless
Page 9: Sampling rate bit depth_lossey lossless
Page 10: Sampling rate bit depth_lossey lossless

Human hearing includes frequencies up to around 20,000 HzSince every cycle of a waveform has both a positive and negative pressure, top to bottom,we must dedicate a minimum of two samples for each cycle of a wave. Therefore, thehighest frequency a digital system can represent is half of the sampling rate. This is theso-called "Nyquist theory“.

In the case of 44.1kHz, the highest frequency we can accurately represent is 22,050Hertz. According to our understanding of human hearing, this frequency seems to beenough, we can capture frequencies up to 20k and even a little beyond.

CD-quality (red book) sound the rate is 44,100 samples per second, 44.1 kHz

Page 11: Sampling rate bit depth_lossey lossless

Bit depth

For every digital sample, our analogue to digital converter asks "what is theamplitude?". The question that remains is, how is this amplitude represented? Theanswer is "bit depth" which determines both how many different amplitudelevels/steps are possible and what the overall capacity of the system is...how loud ofa signal it can tolerate.

CD-quality has a bit depth of 16. This means we will have 2^16 ("two to the 16thpower") different amplitude values available to us

Since the number of steps is divided between positive and negative values (crests andtroughs) this means it is divided into 32,767 positive and 32,768 negative values.

2x2x2x2x2x2x2x2x2x2x2x2x2x2x2x2 = 65,536 steps

Page 12: Sampling rate bit depth_lossey lossless

For each sample taken, the actual amplitude must be "rounded" to the nearest availablelevel...producing another "error" relative to the original audio signal. The signal is"quantized". This "quantization error" produces as small amount of "quantizationnoise", noise inherent to digital recording. A digital system is totally noise-less on itsown, but as soon as it is recording a signal, it makes these errors and ends up with thissmall amount of noise.

Page 13: Sampling rate bit depth_lossey lossless

The overall amplitude capacity of an digital system can be theoretically approximatedas 6 decibels per bit. For our 16-bit CD-quality signal, this means our system cantolerate 96 dB. (16 bits x 6 dB)

So, is 16-bits enough? The threshold of hearing varies among individuals, but is oftencited as 120 or 130 dB. So it may be that--unlike the CD-quality sampling rate and itsaccommodation for the range of human hearing--our 16-bit system is not enough.

What bit depth would a system need to be to tolerate 130 dB ? 24 bit x 6 = 144 dB

If care is not taken when recording, a signal can easily exceed the maximumamplitude, producing “ Digital clipping". In clipping, the waveform hits its amplitudeceiling resulting is a cropped waveform.

Page 14: Sampling rate bit depth_lossey lossless

The conversion of a raw audio signal into a digital representation is known asquantization. The continuous, real-world audio signal, represented here as a smoothwaveform with positive and negative pressure levels, is recorded in a series ofsnapshots known as "samples". Each sample is, like a frame of video, a picture of thesignal at that moment. Specifically, it is a picture of its amplitude.

The difference between the actualincoming audio signal (grey line) andthe quantized digital signal (red line)is called the quantization error.

"what is the amplitude?". The succession of these amplitude measurements("samples", shown below as dotted lines) results in a digital approximation of theoriginal audio signal. The frequencies and notes we hear are the result of thesechanging amplitudes over time.

Page 15: Sampling rate bit depth_lossey lossless

Lossy compression

• OGG Vorbis – Vorbis is an open and free audio compression which normally goes under the name format of OGG. Due to the free nature, Ogg Vorbis format has proved popular among the open source communities, along with its claimed best quality lossy audio codec (at certain bitrates).

• WMA (Windows Media Audio) – WMA is Microsoft’s audio file format. A WMA file is almost always encapsulated in an Advanced Systems Format file. The resulting file may have the Filename extension .wma or .asf (.wma being used being used if audio only). Windows Media Audio supports DRM which has led to itself as a competitor to the AAC format used by iTunes.