You are on page 1of 32

Information Technology and Arts Organizations

28/09/2007 1
Some of the following slides are extracted from:
• http://www.cs.sjsu.edu/faculty/kim/cs286/contents/
• Seminario di Ilaria Bartolini - Corso di Sistemi Informativi 2 –
Università di Bologna
www-db.deis.unibo.it/courses/SI2/slides/MMFormati.pdf
• Relazioni di Sistemi Informativi 2 – Università di Bologna
http://www-db.deis.unibo.it/courses/SI2/onlinerels.html
• Corso di L.Mainetti – Politecnico di Milano
http://www.elet.polimi.it/people/mainetti
• http://w3.westnet.gr/mp3/make_mp3s.htm
• http://grahammitchell.com/writings/vorbis_intro.html

! "

28/09/2007 2
# $ % & '(
) '( * )
# +
,
,

28/09/2007 3
!

!
"
#
!$$ %
&
!' (

) $* +$
, +$ * +$- " "
. +$- * !/
!/ * !$

0 1$$ * 1-
2 3 !- * 1-
28/09/2007 4
!

28/09/2007 5
" #
• The sound intensity is measured in Decibel
• The decibel of a generic physic quantity is defined as:

= ' - )
• Where is a reference value.
• In audio domain the Decibel is called dBspl an is
defined as:
= ' - )
• P0 is the reference level, and it is typically set at the
sound pressure in air equal to 2*10-5 Pascal

28/09/2007 6
$%
, "3 4
- % "3
" " "
"3
5

+$ %
1$ 3 3
7$ 3
!+$ -
!6$ 3
28/09/2007 7
"
&

28/09/2007 8
28/09/2007 9
" '& $ %
Phases
• Low-pass filtering:remove frequencies larger than f max
• Sampling: measure single value
• Quantization: Relate value to interval
• Encode: assign binary code
Important factors:
• Sampling rate
– number of points used to capture the sound wave in 1 second
– unit: Hertz
• Quantization depth:
– amount of information used to store the round-off amplitude of
each sample
– unit: bits
28/09/2007 10
& $%

28/09/2007 11
& $%

28/09/2007 ! 12
& $%

8 '
"3 " " 8'
+
9 "
: : 8'
+

4 ; <<!-
3
$ ++$=- 3

4> 3
? @ 3 AB #
6$$ 6<$$ 8 C *7D
28/09/2007 13
E

+ 6 <

"3 "
28/09/2007 14
E

%
7 !1

28/09/2007 15
( $#
• All that we said is true for sources with one audio
channel (“monophonic”)

• Stereophonic sound, commonly called stereo, is the


reproduction of sound, using two or more independent
audio channels, through a symmetrical configuration of
loudspeakers, in such a way as to create a pleasant and
natural impression of sound heard from various
directions, as in natural hearing.
– 1 channel: monophonic
– 2 channels : Stereophonic
– Professional studio: 16, 32, 64 channels

28/09/2007 16
$ $

• To store uncompressed format (CD quality) (1


sec, Bandwidth of 22050 Hz, 16 bit, stereo):
• 44100 samples * 16 bit * 2 / 8 = 176400 B ~ 172
KB
• A song of 4 min (240 sec): 40 MB
• Audio (as images) has to be compressed.

28/09/2007 17
) * $
• The WAVE (.wav) format is developed by IBM and Microsoft.
• WAV files are the default uncompressed audio in the pulse-code
modulation (PCM) format on Windows. It is recognized by almost all
computer systems.
• Lossless storage method, which keeps all the samples of an audio
track, professional users or audio experts may use the WAV format for
maximum audio quality.
• It is limited to files that are less than 6 GB in size, due to its use of a
32 bit unsigned integer to record the file size header
• A full pop song in WAVE format may take up to 40 MB of disk space
or more.
• Say you sample at 44 KHz for stereo audio; then effectively, you will
have 44 K * 2 samples. If you are using 16 bits per sample, then given
the duration of audio, you can calculate the total size of the wave file
as:
• Size [BYTE] = sampling rate * number of channels * (bits per sample /
8) * duration in seconds
• Number of samples per second = sampling rate * number of channels
28/09/2007 18
+ ,- $

• The Moving Picture Experts Group, commonly


referred to as simply MPEG, is a working group
charged with the development of video and
audio encoding standards
• MPEG has standardized the following compression
formats for audio/video:
– MPEG-1
– MPEG-2
– MPEG-4
• MPEG-1 Audio Layer 3, more commonly referred to as
MP3, is an audio encoding format.

28/09/2007 19
+ ,- $
• It uses a lossy compression algorithm that is designed to
greatly reduce the amount of data required to represent
the audio recording
• The compression removes certain parts of sound that
are outside the hearing range of most people. It provides
a representation of pulse-code modulation — encoded
audio in much less space than straightforward methods,
by using psychoacoustic models to discard components
less audible to human hearing, and recording the
remaining information in an efficient manner.
• Similar principles are used by JPEG, an image
compression format.

28/09/2007 20
+ ,- $ #
• “WAV” files can be converted into MP3
files using different bit-rate, that
represent the “compression ratio”
(inversely proportional) for this
compressed format

28/09/2007 21
+ ,- $

The Mpeg compression algorithm is very complex, but it


provides a very high compression ratio (from 5:1 to 10:1)
and good sound quality.
It includes three steps:
1. The audio signal is first converted in to the frequency
domain. Complete frequency range of MPEG file is divided
in subbands There are 32 subbands.
2. For each subband we compute the amplitude of the audio
signal and the noise level
3. Each subband is quantized considering the audible noise

28/09/2007 22
+ ,- $

The audio MPEG standard specify three compression levels:


1. Layer 1: represents the base version of the algorithm and
provides low compression, low complexity, and maximum
speed of transmission - it uses 4 bit encoding
2. Layer 2 and 3: they improve the level 1 in terms of
compression but increasing the complexity;

Example: using audio compression algorithm MPEG-2-layer 3


(MP3) to an audio file *.WAV of 3 M, we obtain a drastic
space reduction (600-900K) without compromising the
sound.

28/09/2007 23
+ ,. / / 0

28/09/2007 24
+ " $
• The Musical Instrument Digital Interface (MIDI) is a
universally adopted language to exchange musical
information between synthesizers and computers.
• At minimum, a MIDI representation of a sound includes
values for the note's pitch, length, and volume. It can
also include additional characteristics, such as attack
and delay time.
• Since a MIDI file only represents control information, it is
far more concise than formats that record the sound
directly. An advantage is very small file size.
• MIDI devices:
– Controllers: create MIDI message (Keyboards)
– MIDI synthesizers: receive messages and create sound

28/09/2007
http://www.harmony-central.com/MIDI/Doc/tutorial.html 25
* # $

• Lossy compression (similar to MP3)


• Open Source, patent free (on the contrary
MP3 is patented)
• Never-solved debate on which format is
“the best”
– Simply because all formats have their
advantages and disadvantages
• http://www.vorbis.com/
28/09/2007 26
,. $

• The aim of Monkey's Audio is to preserve


an exact reproduction of the original file in
as small a space as possible
• Lossless format
• Specifically developed for audio
• Proprietary format (not open/public)
• Compression ratio ~2:1
• http://www.monkeysaudio.com
28/09/2007 27
1 $
• Free Lossless Audio Codec (FLAC) is a file format for audio data
compression.
• FLAC is a lossless compression format and so it does not remove
information from the audio stream, as lossy compression formats
such as MP3 and Vorbis do.
• Like other methods of compression, FLAC's main advantage is the
reduction of storage requirements, but without sacrificing the
integrity of the audio source.
• For example, a digital recording (such as a CD) encoded to FLAC
can be decompressed into an identical copy of the audio data.
• FLAC achieves compression rates of 30 - 50% for most music, with
significantly greater compression for voice recordings. This leads to
bitrates of roughly 800 - 950 kbit/s.
• FLAC's free and open source royalty-free nature makes it well-
supported by many software applications.

28/09/2007 28
#

• Editing audio tool


• Version Professional/Standard
• http://www.adobe.com/special/products/audition/syntrillium.html

28/09/2007 29
Information Technology and Arts Organizations

.( "

28/09/2007 30
.2 3

A digital camera takes photographs with a


resolution of 1600x1200 pixels with a color
depth of 24 bits per pixel .

1. If you use a jpg compression algorithm with a


compression ratio (CR) of 5 what is the size of
the image? Give the answer in Bytes and in
MegaBytes.
2. If the digital camera has a storage card of size
128 MB, how many images can it hold?

28/09/2007 31
.2
A digital videocamera is connected to a computer
and acquires video with a resolution of
320x240 pixels with a color depth of 16bit per
pixel.

1. Calculate how much space is occupied (in


Bytes and Mbytes) after you have recorded 30
seconds in an uncompressed video format at
10 frames per second (fps).
2. How much time do you need to transfer the film
to a cd if the recording happens at a speed of
1500 KB/sec?
28/09/2007 32

You might also like