Digital Audio Basics
Digitization of Sound
- Crucial for multimedia presentations.
- Introduces basic concepts and digitization of sound.
- Explores MIDI for capturing, storing, and playing back musical notes.
Sound
- Wave phenomenon involving air molecule compression and expansion.
- Longitudinal pressure wave.
- Takes on continuous values.
- Requires a medium (e.g., air) to propagate.
- Wave properties: reflection, refraction, diffraction.
- Digital representation: digitized representations of audio information.
Ear Mechanics
- Ear canal amplifies speech frequencies, protects eardrum.
- Middle ear (ossicles: hammer, anvil, stirrup) amplifies vibrations.
- Inner ear (cochlea) transforms vibrations to electrical impulses via hair cells.
Digitization
- Conversion to stream of numbers (integers).
- Analog signal: continuous pressure wave measurement.
- Sound is 1D (amplitude vs. time).
Sampling and Quantization
- Signal must be sampled in time and amplitude.
- Sampling: measuring at evenly-spaced intervals (sampling frequency).
- Typical audio sampling rates: 8 kHz - 48 kHz (Nyquist theorem).
- Quantization: sampling in amplitude to represent signal as discrete values.
Pitch and Frequency
- Frequency: absolute measure.
- Pitch: perceptual, subjective quality.
- Linked by setting "A" above middle C to 440 Hz.
- Octave: doubling the frequency.
- Harmonics: integral multiples of fundamental frequency.
Audio Data Digitization
- Key questions:
- Sampling rate?
- Quantization fineness and uniformity?
- Audio data format (file format)?
Nyquist Theorem
- Sampling rate must be at least twice the maximum frequency content.
- Sampling_rate >= 2 * f_{max}
- Alias frequency: incorrect frequency due to under-sampling.
- Band-limited signal: sampling rate should be at least , where and are the lower and upper frequency limits.
Signal to Noise Ratio (SNR)
- Measure of signal quality.
- Ratio of correct signal power to noise.
- Measured in decibels (dB).
Audio Filtering
- Prior to sampling, filters remove unwanted frequencies.
- Speech: 50Hz to 10kHz (band-pass filter).
- Music: 20Hz to 20kHz.
- Lowpass filter used after DA conversion to remove high frequencies.
Digital to Analog Conversion
- Methods:
- FM (Frequency Modulation)
- WaveTable
Frequency Modulation (FM)
- Varying carrier signal frequency with modulating signal.
- Complex signals created by modulating frequencies.
- Uses envelope function for loudness over time and for harmonics.
Wave Table Synthesis
- Storing digital samples of real instrument sounds.
- Allows software manipulation: combining, editing, enhancing sounds.
- Better sound reproduction than FM synthesis.
MIDI: Musical Instrument Digital Interface
- Protocol for controlling and communicating between electronic music devices.
- Scripting language coding "events" (pitch, duration, volume).
- Supported by most synthesizers.
- MIDI file: sequence of MIDI instructions (messages).
MIDI Concepts
- Channels: 16 channels (0-15) to separate messages, associated with instruments.
- System messages: general messages for all instruments (tuning, timing).
- Multi-voice instruments: can play multiple notes at once.
General MIDI
- Standard mapping specifying instruments associated with channels.
- Note On message: channel, pitch, velocity (volume).
- Percussion: pitch data indicates drum type.
- Note On message: status byte (channel, pitch), followed by two data bytes.
- Followed by Note Off message (pitch, velocity).
- MIDI status byte: 128-255; data bytes: 0-127.
- Actual MIDI bytes are 10-bit (0 start, 0 stop).
- Programmability: devices can change envelope describing sound amplitude over time.