Chapter 6
Chapter 6
Chapter Six
KUMKUMO K. @DDUIoT
2
KUMKUMO K. @DDUIoT
3 DIGITAL AUDIO AND MIDI
What is sound?
Sound is a wave form of energy, just like electricity light, but is macroscopic and
involves molecules of air being compressed and expanded under the action of some
physical device.
Sound is a continuous wave that travels through the air
The wave is made up of pressure differences and is detected by measuring the pressure
level at a location
4
How to Record and Play Digital Audio?
In order to play digital audio (i.e. WAVE file), you need a card
with a Digital to Analog Converter (DAC) circuitry on it. Most
sound cards have both an ADC (Analog to Digital Converter) and
a DAC so that the card can both record and play digital audio.
This DAC is attached to the Line Out jack of your audio card,
and converts the digital audio values back into the original analog
audio. This analog audio can then be routed to a mixer, or
speakers, or headphones ..
KUMKUMO K. @DDUIoT
Wave Characteristics
5
Frequency:
Represents the number of
periods in a second and is
measured in hertz (Hz) or cycles
per second.
Air Pressure
Amplitude
Human hearing frequency range:
20Hz to 20kHz (audio) Time
Amplitude:
One Period
The measure of displacement of
One particular frequency component
the air pressure wave from its
mean. Related to but not the
same as loudness
measures the how high or low the
voltage of the signal is at a given
point of time.
KUMKUMO K. @DDUIoT
6 Digitization
Digitizing sound
KUMKUMO K. @DDUIoT
7 Principles of Digitization
Sampling
Sampling means measuring the value of the signal at a given
time period. Divide the horizontal axis (time) into discrete
pieces . The samples are then quantized.
Quantization
Quantization is rounding the value of each sample to the
nearest amplitude number in the graph.
Divide the vertical axis (signal strength - voltage) into pieces.
For example, 8-bit quantization divides the vertical axis into
256 levels. 16 bit gives you 65536 levels. Lower the
quantization, lower the quality of the sound
KUMKUMO K. @DDUIoT
8
KUMKUMO K. @DDUIoT
9
Example:
The sampling points in the above diagram are A, B, C, D, E, F, H, and I.
The value of sample at point A falls between 2 and 3, may be 2.6. This
value should be represented by the nearest number. We will round the sample
value to 3. Then this three is converted into binary and stored inside computer.
Similarly, the values of other sampling points are: B=1 C=3 D=1
E=3F=1 G=2 H=3 I=1
The values of most sample points are quantized. After quantization, we
convert sample values into binary digits.
KUMKUMO K. @DDUIoT
Sample Rate
The sample rate is the each number of sample measurements taken every second.
In order to accurately represent all of the frequencies in a recording that fall within the
range of human perception, generally accepted as 20Hz or 20KHz, we must choose a
sample rate high enough to represent all of these frequencies.
A sample rate of 20KHz is identical to the highest frequency.
A waveform has both positive and negative amplitude and it is the rate of alternation
between positive and negative amplitudes that determines frequency. Therefore, we
need two samples for every cycle resulting in a sample rate of at least 40 KHz
Common Sampling Rates
8KHz: used for telephone
11.025 KHz: Speech audio
22.05 KHz: Low Grade Audio (WWW Audio, AM Radio)
44.1 KHz: CD Quality audio
KUMKUMO K. @DDUIoT 10
11 Audio Quality vs. Data Rate
Quality Sample Rate Bits Mono/ Data Rate Frequency
(kHz) pe Stereo (kBytes/sec) Band
r (uncompressed)
Sample
KUMKUMO K. @DDUIoT
Popular File Formats
12 Common Audio Formats
ASF
Microsoft’s Advanced Streaming Format (ASF) is similar to designed to Real Network's Real Media
format, in that it provides a common definition for internet streaming media and can accommodate not only
synchronized audio, but also video and other multimedia elements, all while supporting multiple bandwidths
within a single media file. Also like Real Network's Real Media format, Microsoft’s ASF requires a program
or browser plug- in.
The pure audio file format used in Windows Media Technologies is Windows Media Audio 7 (WMA files).
Like MP3 files, WMA audio files use sophisticated audio compression to reduce file size. Unlike MP3 files,
however, WMA files can function as either discrete or streaming data and can provide a security mechanism
to prevent unauthorized use.
MOV
Apple QuickTime movies (MOV files) can be created without a video channel and used as a sound-only
format. Since version 4.0, Quick time provides true streaming capability. QuickTime also accepts different
audio sample rates, bit depths, and offers full functionality in both Windows as well as the Mac OS.
KUMKUMO K. @DDUIoT
Popular File Formats
14
2 Discrete Audio File Formats
the traditional discrete audio file that you can save to a hard drive or other digital storage
medium. Common discrete audio file formats include WAV, AIF, AU and MP3. A fifth
format, called MIDI is actually not a file format for storing digital audio, but a system of
instructions for creating electronic music.
AU(Audio file )
The AU file format is a compressed audio file format developed by Sun Microsystems and
popular in the UNIX world. It is also the standard audio file format for the Java
programming language. Only supports 8-bit depth thus cannot provide CD-quality sound.
MP3(Motion Picture Experts Group)
MP3 stands for Motion Picture Experts Group, Audio Layer 3 Compression. MP3 files
provide near-CD-quality sound but are only about 1/10th as large as a standard audio CD
file. Because MP3 files are small, they can easily be transferred across the Internet and
played on anyKUMKUMO
multimedia computer with MP3 player software.
K. @DDUIoT
Popular File Formats
15
WAV (windows audio video)
The WAV format is the standard audio file format for Microsoft Windows applications and is the default
file type produced when conducting digital recording within Windows. It supports a variety of bit
resolutions, sample rates, and channels of audio. This format is very popular upon IBM PC (clone)
platforms, and is widely used as a basic format for saving and modifying digital audio data
AIF/AIFF(Audio Interchange File Format )
The Audio Interchange File Format (AIFF) is the standard audio format employed by computers using the
Apple Macintosh operating system. Like the WAV format, it supports a variety of bit resolutions, sample
rates, and channels of audio and is widely used in software programs used to create and modify digital
audio.
MIDI/MID
MIDI (Musical Instrument Digital Interface), is not a file format for storing or transmitting recorded
sounds, but rather a set of instructions used to play electronic music on devices such as synthesizers. MIDI
files are very small compared to recorded audio file formats. However, the quality and range of MIDI
tones is limited
KUMKUMO K. @DDUIoT
16 Miscellaneous Audio Facts
KUMKUMO K. @DDUIoT
17 MIDI: Musical Instrument Digital Interface
is a protocol that enables computer, synthesizers, keyboards, and another musical device to
communicate with each other.
This protocol is a language that allows interworking between instruments from different
manufacturers by providing a link that is capable of transmitting and receiving digital data.
Components of a MIDI System
Synthesizer:
It is a sound generator (various pitch, loudness, tone color).
A good (musician’s) synthesizer often has a microprocessor, keyboard, control panels,
memory, etc.
Sequencer:
a stand-alone unit or a software program for a personal computer. It used to be a storage
server for MIDI data. Nowadays it is more a software music editor on the computer.
It has one or more MIDI INs and MIDI OUTs.
KUMKUMO K. @DDUIoT
18 MIDI: Musical Instrument Digital Interface
Basic MIDI Concepts
Track:
Track in sequencer is used to organize the recordings.
Tracks can be turned on or off on recording or playing back.
Channel:
MIDI channels are used to separate information in a MIDI system.
There are 16 MIDI channels in one cable.
Channel numbers are coded into each MIDI message.
Timbre:
The quality of the sound, e.g., flute sound, cello sound, etc.
Multimbral - capable of playing many different sounds at the same time
(e.g., piano, brass, drums, etc.)
KUMKUMO K. @DDUIoT
19 MIDI: Musical Instrument Digital Interface
Pitch:
The Musical note that the instrument plays
Voice:
Voice is the portion of the synthesizer that produces sound.
Synthesizers can have many (12, 20, 24, 36, etc.) voices.
Each voice works independently and simultaneously to produce sounds of
Different timbre and pitch.
Patch:
The control settings that define a particular timbre.
KUMKUMO K. @DDUIoT
20 MIDI: Data Format
Information traveling through the hardware is encoded in MIDI data
format.
The encoding includes note information like beginning of note,
frequency and sound volume; up to 128 notes
The MIDI data format is digital SS
The data are grouped into MIDI messages
Each MIDI message communicates one musical event between
machines. An event might be pressing keys, moving slider controls,
setting switches and adjusting foot pedals.
10 mins of music encoded in MIDI data format is about 200 Kbytes of
data. (compare against CD-audio!)
KUMKUMO K. @DDUIoT