Sound Waves: The Physics of Data
Before we can teach a machine to recognize speech or classify music genres, we must understand the raw material: Sound is just changes in air pressure over time.
Amplitude & Loudness
A sound wave is a longitudinal wave. The distance it displaces particles from their resting state is its Amplitude. High amplitude means highly compressed air particles, which our ears interpret as louder sound. In digital terms, amplitude is represented by the numerical value of the signal at any given moment in an array.
Frequency & Pitch
Frequency dictates how rapidly the wave oscillates. It is measured in Hertz (Hz)βthe number of cycles per second. A low frequency (e.g., 60 Hz) creates a deep bass note, while a high frequency (e.g., 10,000 Hz) sounds like a sharp whistle.
Analog to Digital (ADC)
Computers cannot process continuous acoustic waves. We must digitize them using two steps:
- Sampling (Time Domain): Taking "snapshots" of the wave at regular intervals. CD quality audio uses a sample rate of 44,100 times per second.
- Quantization (Amplitude Domain): Assigning the measured amplitude to the nearest binary value. A 16-bit depth means we have 65,536 possible amplitude levels.
π‘ Data Retrieval: Audio FAQs
What is the difference between Frequency and Amplitude?
Frequency (Pitch): The speed of oscillation. Measured in Hertz (Hz). Higher frequency = higher pitch.
Amplitude (Loudness): The height or intensity of the wave. Higher amplitude = louder volume.
How do computers store sound waves?
Through a process called PCM (Pulse Code Modulation). The analog wave is sampled thousands of times a second (e.g. 44.1kHz), and each sample's amplitude is converted to a binary number (Quantization). In Python, this is represented as a 1D NumPy array.