multimedia technology digital sound krich sintanakul multimedia and hypermedia department of...

27
M u l t i m e d i a Technology Digital Sound Krich Sintanakul Multimedia and Hyper media Department of Comput er Education

Upload: alexander-dennis

Post on 26-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

Digital Sound Krich Sintanakul

Multimedia and Hyperm edia

Department of Compute r EducationKMITNB

Page 2: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 2

Facts about Sound

• Sound is a continuous wave that travels through the air.

• The wave is made up of pressure differences. Sound is detected by measuring the pressure level at a location.

• Sound waves have normal wave properties (reflection, refraction, diffraction, etc.).

• Human ears can hear in the range of 16 Hz to about 20 kHz. This changes with age.

• Hence, wavelengths vary from 21.3 m to 1.7 cm.

Page 3: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 3

Facts about Sound (con...)

• The intensity of sound can be measur ed in terms of Sound Pressure Level (

SPL) in decibels (dBs).

intensity level = 1 0 log (P / P0 ) dB,

where P and P0 are values of acousti c power, and P0 will deliver an inten

ssss ss sssss ss sss sssssssss ss sssss 10ng, which is -12 W/m2 (watts per

square meter).

Page 4: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 4

Sound Fundamentals

Page 5: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 5

Waveforms

Page 6: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 6

Analog Audio System

Page 7: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 7

Digital Audio

Sampling Rate must be twice the highest frequencyaudio with frequencies at 8000 Hz need 16000 samples per second

Page 8: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 8

Digitizing AudioQuestions for producing digital

audio (Analog-to-Digital Conversion):1. How often do you need to sample the signal?2. How good is the signal?3. How is audio data formatted?

Page 9: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 9

Nyquist Theorem• s ssssss ssss -- ss sss ss ssssss ssss s

- bandwidth limited signal can be fully reconstructed from its samples, if the

sampling rate is at least twice of the highest frequency in the signal.

Page 10: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 10

Digital Audio

bit depth is the amplitude resolution

state bit 1 bit2 bit30 0 0 01 1 0 02 0 1 03 1 1 04 0 0 15 1 0 16 0 1 17 1 1 1

Page 11: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 11

Digital Sound Files

Page 12: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 12

Signal to Noise Ratio (SNR)

• In any analog system, some of the voltage is what you want to measure (signal), and some of it is random fluctuations (noise).

• Ratio of the power of the two is called the signal to noise ratio (SNR). SNR is a measure of the quality of the signal.

• SNR is usually measured in decibels (dB).

Page 13: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 13

Signal to Quantization Noise Ratio (SQNR)

• The precision of the digital audio sample is deter mined by the number of bits per sample, typicall

y 8 or 1 6 bits.• The quality of the quantization can be measured

by the Signal to Quantization Noise Ratio (SQNR).

• The quantization error (or quantization noise) is t he difference between the actual value of the an

alog signal at the sampling time and the nearest quantization interval value.

• The largest (worst) quantization error is half of th e interval. Given Nto be the number of bits per s

- ample, the range of the digital signal is 2 exp (N- -1 ) to 2 exp (N 1 ).

Page 14: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 14

Signal to Quantization Noise Ratio (SQNR)

6In other words, each bit adds about dB o 1 1 1111 111111 1 1 1111, 1 6 111= 9 6 .

**( The above is for the worst case. Assume t 11111 111111 11 11111111111 111 111 1111111111,

on error is statistically independent and its mag nitude is uniformly distributed between 0 and

halfof t he i nt er val , =6 .02 + 1.76. [95, . 37])

Page 15: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 15

Digital sound system

Recording Playback

Page 16: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 16

Audio Quality vs. Data Rate

Quality Sample Rate Bi ts per Mono/ s sss s sss Frequency

(KHz) Sample Stereo (Uncompressed) Band

Telephone 8 8 Mono 8 KBytes/sec - 200 3,400 Hz

s s s ssss 11.025 8 Mono 11.0 KBytes/sec

FM Radio 22050. 16 Stereo 88 2. KBytes/sec

CD 44 1. 16 Stereo 176.4ssssssssss - 2020000, Hz

DAT 48 16 Stereo 192.0 KBytes/sec - 2020000, Hz

DVD Audio 192 24 Stereo - 1,152.0 KBytes/sec 20 20,000 Hz

Page 17: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 17

Digitization in General• 1111111 1111111 111111 1111111 11111111111-111111 , (

)• Togetaudioor vi deo i nt o a comput er , we must di gi t i ze i

t(converti t i nt o a st r eamof number s)• So, we have to understand discrete sampling (bo

th time and voltage)• Sampl i ng -- dividethehorizontalaxis(t he t i me di mensi on) i nt o di scr e

tepieces. Uni f or msampl i ng i s ubi qui t ous.• Quanti zati on -- 111 11111111 1111 1111111 11(

- rength) into pieces. Sometimes, a non linear fun ctioni s appl i ed.

8 bit quantization divides the vertical axis int o 2 5 6 levels. 1 6 bit gives you 6 5 5

36 levels.

Page 18: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 18

Synthetic Sounds

• -- FM (Frequency Modulation) Synthesis us - - 4ed in low end Sound Blaster cards, OPL c

sss• -- Wavetable synthesis wavetable generate

d from sound waves of real instruments• FM Synthesis is good for creating new so

unds. Wavetables can store sounds of e xisting instruments nicely.

• The wavetables are stored in memory on the sound card and they can be manipul

ated by software.• To save memory space, a variety of spec

ial techniques, such as sample looping,sssss

• shifting, mathematical interpolation, an d polyphonic digital filtering can be appl

ied.

Page 19: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 19

Wave and MIDI

Page 20: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 20

MIDI (Musical Instrument Digital Interface)

MIDI: a protocol that enables computer, synthesizers, keyboards, and other musical

device to communicate with each other.

Synthesizer: It is a sound generator (various pitch, loudness, tone col

or). Sequencer: - It can be a stand alone unit or a software program for a

personal computer.

It has one or more MIDI INs and MIDI OUTs.Track: Track in sequencer is used to organize the

recordings.

Tracks can be turned on or off on recording or playingback.

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.

Page 21: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 21

MIDI (Continue)

Timbre: The quality of the sound, e.g., flute sound, cello sound,etc.

-- Multitimbral capable of playing many dif ferentsoundsatthesametime(e.g.,piano,brass,drums,etc.)

Pitch: musi cal note that the i nstrument pl aysVoice:

Voice is the portion of the synthesizer tha tproduces sound.

Synthesizers can have many (1 6 , 2 0 , 2 4 , 3 2 , 6 4 , etc.) voices.

Each voice works independently and simu ltaneouslytoproduce sounds of di ff erent ti mbre andpitch.

Patch: thecontrol setti ngs that defi ne a parti cul artimbre.

Page 22: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 22

MIDI connectorsthree 5-pin ports found on the back of

every MIDI unitMIDI IN: the connector via which

the device receives all MIDI data.MIDI OUT: the connector through

which the device transmits all the MIDI data it generates itself.

MIDI THROUGH: the connector by which the device echoes the data receives from MIDI IN.

Note: It is only the MIDI IN data that is echoed by MIDI through. All the data generated by device itself is sent through MIDI OUT.

Page 23: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 23

MIDI connectors

• MIDI OUT of synthesizer is connected to MIDI IN of sequencer.• MIDI OUT of sequencer is connected to MIDI IN of synthesizer and

"through" to each of the additional sound modules.• During recording, the keyboard-equipped synthesizer is used to send

MIDI message to the sequencer, which records them.• During play back: messages are send out from the sequencer to the

sound modules and the synthesizer which will play back the music.

Page 24: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 24

MIDI Messages •MIDI messages are used by MIDI devices to communicate with each other.•Structure of MIDI messages:

•MIDI message includes a status byte and up to two data bytes.

•Status byte•The most significant bit of status byte

is set to 1.•The 4 low-order bits identify which

channel it belongs to (four bits produce 16 possible channels).

•The 3 remaining bits identify the message.

•The most significant bit of data byte is set to 0.

Page 25: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 25

MIDI Messages Classification of MIDI messages:

|----- voice messages| ---- channel messages ------|| |----- mode messages|

MIDI messages ----|| |---- common messages----- system messages --------- |---- real-time

messages|---- exclusive

messages

Page 26: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 26

General MIDI MIDI + Instrument Patch Map + Percussion Key -- Map > a piece of MIDI music sounds the same a

nywhere it is played•sssssss sss sssss s ss ss s ssssssss sssssss ssss

consisting of1 2 8 patch types.• Percussion map specifies 47 percussion sounds.

• - Key based percussion is always transmitted on M IDI channel 1 0 .

Requirements for General MIDI Compatibility:• Supportall 1 6 channels.• Each channel can play a different instrumen

t/program (multitimbral).• Each channel can play many voices (polyphony).

• Minimum of 24 fully dynamically allocated voices.

Page 27: Multimedia Technology Digital Sound Krich Sintanakul Multimedia and Hypermedia Department of Computer Education KMITNB

Mu

ltimed

iaTechnology

724421 27

Reference•http://www.cs.sfu.ca/CourseCe

ntral/3 6 5•http://www.cooledit.com