Вы находитесь на странице: 1из 44

Sistem

Multimedia
K Candra Brata
andra.course@gmail.com

Tim Ajar Mata kuliah Sitem Multimedia 2017-2018


Digital Audio
◇ Sound
◇ Sampling
◇ Quantization
◇ Modulation
What is Sound?

Suara adalah (tekanan) gelombang yang diciptakan oleh benda bergetar.

3
How Sound Is Produced ?
• The vibrations by a vibrating object set particles in the surrounding
medium (typical air) in vibrational motion
• Molecules in air are disturbed, one bumping against another
• An area of high pressure moves through the air in a wave
• Thus a wave representing the changing air pressure can be used to
represent sound

4
The Sound Wave

• The sound wave is referred


to as a longitudinal wave.
• The result of longitudinal
waves is the creation of
compressions (memadat)
and rarefactions
(merenggang) within the
air.
5
Wavelength, Amplitude, Frequency of a Wave

6
Amplitude, Frequency, Wavelength, Velocity
• Amplitude : keras lemahnya bunyi atau tinggi rendahnya gelombang yang
dinyatakan dalam satuan decibel (dB)
• Frequency : Banyaknya periode dalam 1 detik (Hz) atau cycles per second (cps).
• 1 Hertz = 1 vibration/second
• Infrasound 0Hz-20Hz
• Pendengaran Manusia 20Hz-20KHz
• Ultrasound 20KHz-1GHz
• Hypersound 1GHz – 10THz
• Sistem multimedia menggunakan suara yang berada dalam range pendengaran
manusia yang dikenal sebagai “AUDIO” dan gelombangnya sebagai “ACCOUSTIC
SIGNALS”, Sedangkan suara diluar range pendengaran manusia disebut “NOISE”
7
Amplitude, Frequency, Wavelength, Velocity
• Wavelength: Panjang gelombang yang dirumuskan  c/f di mana c =
kecepatan rambat bunyi, f = frekuensi
Berapakah panjang gelombang untuk gelombang suara yang memiliki
kecepatan rambat 343 m/s dan frekuensi 20 kHZ?
Jawab: Wavelength = c/f = 343/20 = 17,15 mm
• Velocity: Kecepatan perambatan gelombang bunyi sampai ke telinga
pendengar (m/s). Pada udara kering dengan suhu 20°C kecepatan rambat
suara sekitar 343 m/s

8
MEASURING THE INTENSITY OF SOUND
• Normally, sound intensity is measured as a relative ratio to some standard
intensity ( Io )
• we define the relative sound intensity level as :

• I is the intensity of the sound expressed in watts per meter and Io is the
reference intensity defined to be 10-12w/m2. This value of Io is the threshold
(minimum sound intensity) of hearing at 1 kHz for a young person under the
best circumstances.

9
MEASURING THE INTENSITY OF SOUND
(example)
• If we measured a sound intensity to be 100 times greater that the threshold
reference, what would be the sound level expressed in dB?

10
MEASURING THE INTENSITY OF SOUND
(example)
• The threshold of pain is about 120 dB.
• How many times greater in intensity (in w/m2) is this?

11
Digitization of Sound

• Microphones, video cameras produce analog signals


(continuous-valued voltages) as illustrated in the figure below.

• To get audio or video into a computer, we have to digitize it


(convert it into a stream of numbers) Need to convert Analog-
to-Digital

12
Sampling and Quantization

1. Sampling - divide
the horizontal
axis (the time
dimension) into
discrete pieces
2. Quantization -
divide the
vertical axis
(signal strength)
into discrete
pieces

13
Sampling

• The rate at which sampling is performed • How many Samples to take?


is called the sampling frequency
• 11.025 KHz
• Frequencies over 22.01 kHz are filtered
out before sampling is done.
• -- Speech (Telephone 8KHz)
• The sampling rate must be at least twice • 22.05 KHz
the highest frequency component of the • -- Low Grade Audio
sound (Nyquist Theorem). • (WWW Audio, AM Radio)
• The human voice can reach
• 44.1 KHz
approximately 4 kHz, For audio, typical
sampling rates are from 8 kHz (8,000 • -- CD Quality
samples per second) to 48 kHz,

14
Quantization
• Sampling in the amplitude or voltage dimension is called
quantization.
• Typical uniform quantization rates are 8-bit and 16-bit
• 8-bit quantization divides the vertical axis into 256 levels, and 16-bit
divides it into 65,536 levels.

15
Nyquist's Sampling Theorem
• Nyquist Sampling Rate: Untuk memperoleh representasi akurat
dari suatu sinyal analog secara loseless, amplitudonya harus
diambil sample-nya setidaknya pada kecepatan (rate) sama atau
lebih besar 2x lipat komponen frekuensi maksimum yang akan
didengar.

• Misal:
Untuk sinyal analog dengan bandwidth 15Hz-10kHz  sampling rate = 2
x 10kHz = 20 kHz

16
Nyquist's Sampling Theorem
• Analog Audio Signal

17
Nyquist's Sampling Theorem

If we sample at 1 time per cycle, we can think it's a constant.

18
Nyquist's Sampling Theorem
If we sample at 1.5 times per cycle, we can think it's a lower frequency
sine wave

19
Nyquist's Sampling Theorem
Nyquist rate --For lossless digitization, the sampling rate should be at least twice the
maximum frequency responses. Indeed many times more the better.

20
Nyquist's Sampling Theorem

• Teorema sampling Nyquist menjamin sample data mengandung semua


informasi dari sinyal asli (original).
• Voice data (speech) limited to below 4000Hz
• Membutuhkan 8000 sample per detik (2x4000Hz Nyquist)
• Sistem telepon dapat mendigitalisasi voice dengan 128 level atau 256 level.
• Level-level tersebut disebut level kuantisasi
• Jika128 level, maka bit tiap sampel = 7 bits (2 ^ 7 = 128).
• Jika 256 level, maka bit tiap sampel = 8 bits (2 ^ 8 = 256).

• 8000 samples/sec x 7 bits/sample = 56Kbps for a single voice channel.


• 8000 samples/sec x 8 bits/sample = 64Kbps for a single voice channel.

21
Quantization Interval
• If Vmax is the maximum positive and negative signal amplitude and n is the
number of binary bits used, then the magnitude of the quantization interval, q, is
defined as follows:
2Vmax
q n
2
• For example, what if we have 8 bits and the values range from –1000 to +1000?

22
Signal-to-Quantization-Noise Ratio (SQNR)
• nilai kualitas keluaran ADC yang ditentukan oleh Rasio daya sinyal
terhadap daya kebisingan (noise).
• For digital signals, we must take into account the fact that only
quantized values are stored.
• Digital audio signal, the precision of each sample is determined by the
number of bits per sample, typically 8 or 16.
• This introduces a round off error. Although it is not really “noise,” it is
called quantization noise (or quantization error).

• The actual signal may differ from the code word by up to plus or
minus q/2, where q is the size of the quantization interval. 23
Quantization
Intervals and
Resulting
Error

24
Linear Vs. Non-Linear Quantization
• Linear quantization., Audio digital disample secara kontinyu pada fixed rate.
Setiap sample direpresentasikan dengan jumlah bit yang tetap,

• non-linear quantization, menggunakan lebih banyak digit (bit) atau lebih sedikit
untuk mewakili sampel di beberapa level.

• Untuk media suara, lebih penting untuk memiliki representasi yang lebih halus
(lebih banyak bit) untuk sinyal amplitudo rendah daripada tinggi karena sinyal
amplitudo rendah lebih sensitif terhadap noise. Dengan demikian, kuantisasi
non-linear digunakan.

25
Linear Vs. Non-Linear Quantization

Quantizing level
15 15
14 14
13
13
12
11 12
Strong signal
10 11
10
9
8 Weak signal 9
8
7 76
6 5
5 4
4 3
3 2
2
1
1
0 0

Without nonlinear encoding With nonlinear encoding


26
Delta Modulation (DM)
• Pada Delta Modulation, sinyal analog ditracking.
• Analog input diaproksimasi dengan staircase function
• Apakah Move up (naik) atau down (turun) satu level () pada tiap interval
sampel
• Bit 1 digunakan untuk merepresentasi kenaikan level tegangan pd sinyal, dan bit
0 untuk merepresentasi turunnya level tegangan. -> Output dari DM adalah bit
tunggal untuk setiap sample
• Digunakan juga pada berbagai teknik Kompresi Data
• e.g. Interframe coding techniques for video

27
Delta Modulation

28
Delta Modulation

Staircase function

Delta Modulation output

29
Pulse Code Modulation (PCM)
Representasi digital dari sinyal analog, di mana gelombang di-sample secara
beraturan berdasarkan interval waktu tertentu, yang kemudian diubah ke biner
(Quantisasi)
Original signal

3.9 3.4 4.2


3.2 2.8
PAM pulse 1.2

PCM pulse 3 4 3 3 4
with quantized error 1
011 100 011 011 001 100

PCM output 011100011011001100


30
31
Pulse Code Modulation (PCM)
• PCM menggunakan pengkodean kuantisasi non-linear:
spasi amplituda dari tiap level tidak linear
• Ada step kuantisasi yang lebih banyak pada amplituda rendah
(low)
• Ini untuk mengurangi distorsi sinyal secara overall.

32
How about Memory Space?
• AUDIO: a sequence of
microphone readings on
several channels.
• Readings (samples) are
normally taken at 11000,
22K or 44K per second and
may be 8, 12 or 16-bit values.

• Q: Berapa banyak memori dibutuhkan untuk menyimpan rekaman


audio selama 5 menit dengan menggunakan 2 channel dan 16 bit per
sample?

33
How about Memory Space?
KB = 1024 bytes MB = 1,048,576 bytes GB = 1,073,741,824 bytes
Jika: Fs = 11000 Hz
• Nsampel = 5 (menit) x 60 (detik/menit) x 11000 (sampel/detik) =
3.300.000 sampel
• Nbit = 16 (bit/sampel) x 3.300.000 sampel = 52.800.000 bit =
6.600.000 byte = 6,295 MB
• Nbit Stereo (2 channel) = 6,295 MB x 2 ≈ 12,6 MB

Jika: Fs = 44100 Hz
• Nsampel = 5 (menit) x 60 (detik/menit) x 44100 (sampel/detik)
= 13.230.000 sampel
• Nbit = 16 (bit/sampel) x 13.230.000 sampel
= 211.680.000 bit = 26.460.000 byte ≈ 25,234 MB
• Nbit Stereo = 25,234 MB x 2 ≈ 50,468 MB  satu lagu pada CD audio

34
Raw Digital Audio ..

• Makin besar FS, makin baik kualitas rekaman audio, makin banyak jumlah
bit yang dibutuhkan!
• Makin besar jumlah bit / sampel, makin baik kualitas rekaman audio, makin
banyak jumlah bit yang dibutuhkan!, demikian pula sebaliknya
• Kualitas Audio Digital adalah linear dengan kebutuhan memori!

35
AUDIO FILE FORMAT
• Uncompressed Audio Formats
1. PCM
2. WAV
Lossy Compressed Audio Formats
1. MP3
2. AAC
Lossless Compressed Audio Formats
1. FLAC
2. ALAC
36
PCM
• PCM stands for Pulse-Code Modulation, a digital representation of
raw analog audio signals.
• There is no compression involved. The digital recording is a close-to-
exact representation of the analog sound.
• PCM is the most common audio format used in CDs and DVDs

37
WAV [.wav]
• WAV stands for Waveform Audio File Format (also called Audio for Windows at some
point but not anymore). It’s a standard that was developed by Microsoft and IBM
back in 1991.
• A lot of people assume that all WAV files are uncompressed audio files, but that’s not
exactly true. WAV is actually just a Windows container for audio formats. This means
that a WAV file can contain compressed audio, but it’s rarely used for that.
• Most WAV files contain uncompressed audio in PCM format. The WAV file is just a
wrapper for the PCM encoding, making it more suitable for use on Windows systems.
However, Mac systems can usually open WAV files without any issues.

38
MP3 [.mp3]
• MP3 stands for MPEG-1 Audio Layer 3. It was released back in 1993 and quickly
exploded in popularity, eventually becoming the most popular audio format in
the world for music files.
• The main pursuit of MP3 is to cut out all of the sound data that exists beyond the
hearing range of most normal people and to reduce the quality of sounds that
aren’t as easy to hear, and then to compress all other audio data as efficiently as
possible.

39
AAC [.m4a]
• AAC stands for Advanced Audio Coding. It was developed in 1997 as the
successor to MP3.
• The compression algorithm used by AAC is much more advanced and technical
than MP3, so when you compare a particular recording in MP3 and AAC formats
at the same bitrate, the AAC one will generally have better sound quality.
• AAC is standard audio compression method used by YouTube, Android, iOS,
iTunes, later Nintendo portables, and later PlayStations.

40
FLAC
• FLAC stands for Free Lossless Audio Codec.
• FLAC can compress an original source file by up to 60% without losing a single bit
of data.
• FLAC is an open source and royalty-free format rather than a proprietary one,
• FLAC is supported by most major programs and devices and is the main
alternative to MP3 for CD audio. With it, you basically get the full quality of raw
uncompressed audio in half the file size

41
ALAC
• ALAC stands for Apple Lossless Audio Codec.
• It was developed and launched in 2004 as a proprietary format but
eventually became open source and royalty-free in 2011.
• iTunes and iOS both provide native support for ALAC and no support
at all for FLAC.

42
MIDI
• MIDI, which dates from the early 1980s, is an acronym that stands for
Musical Instrument Digital Interface.
• a protocol that enables computer, synthesizers, keyboards, and other musical
device to communicate with each other.
• Components of a MIDI System : Synthesizer, Sequencer, Track,
Channel,Timbre, Pitch, Voice, Path

43
TERIMA KASIH
SEMOGA BERMANFAAT

44