Digital Audio Processing: By: Eng. Mohanned Dawoud
Digital Audio Processing: By: Eng. Mohanned Dawoud
• Public spaces
• Music production
• Voice
• Broadcasting
• Marketing
Audio compression (data)
• Audio compression is a form of data compression
designed to reduce the size of audio files.
• Audio compression algorithms are implemented
in computer software as audio codecs.
• Generic data compression algorithms perform
poorly with audio data.
• Consequently, specific audio "lossless" and
"lossy" algorithms have been created.
• In both lossy and lossless compression,
information redundancy is reduced.
Audio compression (data)
Lossless audio compression
• Lossless audio compression allows one to
preserve an exact copy of one's audio files.
• Compression ratios are similar to those for
generic lossless data compression (around 50–
60% of original size).
• Compression ratios are substantially less for
lossy compression (which typically yield 5–
20% of original size).
Audio compression (data)
Use of Lossless audio compression
• The primary use of lossless encoding are:
– Archives : For archival purposes, one naturally
wishes to maximize quality.
– Audio quality: Being lossless, these formats
completely avoid compression artifacts.
Audio compression (data)
Use of Lossless audio compression (cont.)
• A specific application is to:
– Store lossless copies of audio.
– Produce lossily compressed versions for a digital audio
player.
– As formats and encoders improve, one can produce
updated lossily compressed files from the lossless master.
• As file storage and communications bandwidth have
become less expensive and more available, lossless
audio compression has become more popular.
Audio compression (data)
Formats of Lossless audio compression
• Shorten was an early lossless format; newer ones include
Free Lossless Audio Codec (FLAC), Apple's Apple Lossless,
MPEG-4 ALS, Monkey's Audio, and TTA.
• Some audio formats feature a combination of a lossy
format and a lossless correction; this allows stripping the
correction to easily obtain a lossy file. Such formats include
MPEG-4 SLS (Scalable to Lossless), WavPack, and
OptimFROG DualStream.
• Some formats are associated with a technology, such as:
– Direct Stream Transfer, used in Super Audio CD
– Meridian Lossless Packing, used in DVD-Audio and Dolby
TrueHD, used in in Blu-ray and HD DVD
Audio compression (data)
Difficulties in lossless compression of audio data
It is difficult to maintain all the data in an audio
stream and achieve substantial compression.
• First, the vast majority of sound recordings are
highly complex, recorded from the real world.
• Second, The values of audio samples change very
quickly, so generic data compression algorithms
don't work well for audio, and strings of
consecutive bytes don't generally appear very
often.
Audio compression (data)
Evaluation criteria of Lossless audio compression
Lossless audio codecs have no quality issues,
so the usability can be estimated by
– Speed of compression and decompression
– Degree of compression
– Software and hardware support
– Robustness and error correction
Audio compression (data)
Lossy audio compression
• Lossy audio compression is used in an extremely wide
range of applications.
• Digitally compressed audio streams are used in many
applications, for example:
– Video DVDs.
– Digital television.
– Streaming media on the internet.
– Satellite and cable radio.
– Increasingly in radio broadcasts.
• Lossy compression typically achieves far greater
compression than lossless compression (5-20% of the
original stream, rather than 50-60% in the Lossless.
Audio compression (data)
Lossy audio compression (cont.)
• In lossy audio compression, data that can not be
perceived by the human auditory system are
coded with decreased accuracy or not coded at
all.
• Most lossy compression reduces perceptual
redundancy.
• Removing or reducing 'unhearable' sounds may
account for a small percentage of bits saved in
lossy compression.
Audio compression (data)
Lossy audio compression (cont.)
• Reducing the number of bits used to code a signal
increases the amount of noise in that signal (Recall
SNR).
• The real key in lossy compression, is to 'hide' the noise
generated by the bit savings in areas of the audio
stream that cannot be perceived.
• This is done by, for instance, using very small numbers
of bits to code the high frequencies of most signals.
– human ear can only perceive very loud signals in this
region
– so that softer sounds 'hidden' there simply aren't heard.
Audio compression (data)
Lossy audio compression (cont.)
• If reducing perceptual redundancy does not achieve
sufficient compression for a particular application, it
may require further lossy compression.
• Depending on the audio source, this still may not
produce perceptible differences. Speech for example
can be compressed far more than music.
• Most lossy compression schemes allow compression
parameters to be adjusted to achieve a target rate of
data, usually expressed as a bit rate.
Audio compression (data)
Lossy audio compression (cont.)
• Because data is removed during lossy
compression and cannot be recovered by
decompression, some people may not prefer
lossy compression for archival storage.
• People use lossy compression may wish to
keep a losslessly compressed archive for other
applications.
Audio compression (data)
Applications of lossy compression
• Due to the nature of lossy algorithms, audio
quality suffers when a file is decompressed
and recompressed (digital generation loss).
• Lossy compression unsuitable for storing the
intermediate results in professional audio
engineering applications.
• Popular with end users (particularly MP3).
Audio compression (data)
Evaluation criteria
Usability of lossy audio codecs is determined by:
• Perceived audio quality
• Compression factor
• Speed of compression and decompression
• Inherent latency of algorithm (critical for real-
time streaming applications; explained later)
• Software and hardware support
Audio compression (data)
Inherent latency of algorithm
• Lossy formats are often used for the distribution
of streaming audio, or interactive applications.
• In such applications, the data must be
decompressed as the data flows.
• Not all audio codecs can be used for streaming
applications.
• For such applications a codec designed to stream
data effectively will usually be chosen.
Audio compression (data)
Inherent latency of algorithm (cont.)
• Latency results from the methods used to
encode and decode the data.
• Some codecs will analyze a longer segment of
the data to optimize efficiency.
• Often codecs create segments called a
"frame" to create discrete data segments for
encoding and decoding.
Audio compression (data)
Inherent latency of algorithm (cont.)
• Latency refers to the number of samples which
must be analysed before a block of audio is
processed.
• In the minimum case, latency is 0 zero samples
(e.g., if the coder/decoder simply reduces the
number of bits used to quantize the signal).
• Time domain algorithms have low latencies,
hence their popularity in speech coding for
telephony.