Chapter 2: Basics of Sound Notes

Basics of Sound

Introduction

  • Sound is a wave created by the compression and expansion of air molecules, caused by a physical device like a speaker.
  • The speaker vibrates, producing a longitudinal pressure wave, which we perceive as sound.

Sound Wave Characteristics

  • Sound waves have properties like reflection, refraction, and diffraction.
    • Reflection: Bouncing of sound waves.
    • Refraction: Change in the speed of sound when entering a medium with a different density.
    • Diffraction: Change in the direction of waves when passing through an opening or barrier.

Characteristics of Sound Waves

  • Frequency: Number of cycles a sound wave completes in one second, measured in Hertz (Hz).
    • 1 Hz means 1 vibration per second.
    • Humans can typically hear between 20 Hz and 20 kHz.
    • Frequencies above the audible range are called ultrasound, while those below are called infrasound.
  • Amplitude: Maximum displacement of a particle in the wave's path, representing the loudness of the sound, measured in decibels (dB).
    • Larger energy in the sound wave results in a larger amplitude and louder sound.
  • Waveform: The shape of the wave, which can be sinusoidal, square, triangular, sawtooth, or irregular.
  • Speed of propagation: The speed depends on the medium.
    • In air: 340m/sec340 \, \text{m/sec}
    • In water: 1500m/sec1500 \, \text{m/sec}

How Sound Waves Interact

  • A tone is a sound with a single frequency, represented by a sinusoidal wave.
  • A note is a composite sound, a mixture of various tones with different amplitudes and frequencies.
  • When sound waves meet, they can add to or subtract from each other.

Digital Sound

  • Digital sound involves the reproduction and transmission of sound stored in a digital format.
  • Conversion Process:
    • Analog-to-digital converter (ADC) converts an analog signal to a digital signal.
    • The digital signal can undergo digital signal processing and be stored or transmitted.
    • Finally, a digital-to-analog converter (DAC) converts the digital signal back to analog.
  • For computers to work with audio waves, they must be converted from analog to digital form through sampling and quantization.
    • Sampling: Recording a sample of the audio in digital bits at fractions of a second.
    • Quantization: Converting the sampled amplitude values into discrete levels.

Sample Rate

  • Sample rate is the number of times a sample is taken, measured in Hertz (Hz).
    • 1 Hz = 1 sample per second
    • 1 kHz = 1,000 samples per second
    • 1 MHz = 1 million samples per second
  • Common sample rates: 11.025 kHz, 22.05 kHz, and 44.1 kHz.
  • Higher sample rates result in better quality digitized audio.

Nyquist Sampling Theorem

  • The sampling frequency must be at least twice the highest frequency component in the signal.

Sampling Example

  • Nyquist rate sampling: fs=2ff_s = 2f
  • Oversampling: fs=4ff_s = 4f
  • Undersampling: fs<2ff_s < 2f

Example Calculation

  • A signal has frequency components from 300 Hz to 1.8 kHz. The minimum sampling rate is calculated as follows:
    • fm=Maximum frequency of the signal=1.8kHzf_m = \text{Maximum frequency of the signal} = 1.8 \, \text{kHz}
    • Minimum sampling rate = Nyquist rate = 2×fm=2×1.8kHz=3.6kHz2 \times f_m = 2 \times 1.8 \, \text{kHz} = 3.6 \, \text{kHz}

Aliasing

  • Aliasing occurs due to insufficient sampling when a signal is digitized.
  • If a signal with frequency f<em>of<em>o is digitized at a rate of 2f</em>o2f</em>o, the samples produce a waveform with a frequency of fof_o.
  • If the signal is digitized at a rate of 43fo\frac{4}{3}f_o, the samples produce a distorted waveform.
  • In practice, an ADC's sampling rate should be much higher than twice the maximum signal frequency.

Quantization

  • Quantization is the process of rounding off the amplitudes of samples to a number of levels.
  • Each sample is matched to the closest level, as each level has a specific value.
  • A common approach is rounding the sample to the closest integer.

Quantization Error

  • Quantization error leads to information loss, which manifests as noise.

Signal to Noise Ratio (SNR)

  • SNR is the ratio of the power of the correct signal to the noise, measuring signal quality.
  • Measured in decibels (dB), SNR is defined as:
    SNR=20log<em>10V</em>signalV<em>noise=10log</em>10V<em>signal2V</em>noise2SNR = 20 \log<em>{10} \frac{V</em>{\text{signal}}}{V<em>{\text{noise}}} = 10 \log</em>{10} \frac{V<em>{\text{signal}}^2}{V</em>{\text{noise}}^2}
    Where V<em>signalV<em>{\text{signal}} and V</em>noiseV</em>{\text{noise}} are the amplitudes of the signal and noise, respectively.

Bit Depth

  • When a sound wave is sampled, each sample is assigned the amplitude value closest to the original wave’s amplitude.
  • Higher bit depth provides more possible amplitude values, producing greater dynamic range and lower noise.
  • 8-bit sample allows 28=2562^8 = 256 values.
  • 16-bit sample provides 216=65,5362^{16} = 65,536 values.
  • The greater the sample size, the better the audio quality.

Bit Depth Examples

  • 8-bit depth: 256 levels (Telephony quality)
  • 16-bit depth: 65,536 levels (Audio CD quality)
  • 24-bit depth: 16,777,216 levels (Audio DVD quality)
  • 32-bit depth: 4,294,967,296 levels (Best quality)

File Size

  • Audio File Size = bit depth * sample rate * duration (seconds) * number of channels
  • Example: 16-bit, 44100 Hz, 10 seconds, 2 channels (stereo)
    16×44100×10×2=14,112,000bits=1,764,000bytes=1,764kB=1.764MB16 \times 44100 \times 10 \times 2 = 14,112,000 \, \text{bits} = 1,764,000 \, \text{bytes} = 1,764 \, \text{kB} = 1.764 \, \text{MB}