Multimedia Digital Audio 1 LECTURE 4 FARAZ KHAN

  • Slides: 61
Download presentation
Multimedia Digital Audio 1 LECTURE # 4 FARAZ KHAN

Multimedia Digital Audio 1 LECTURE # 4 FARAZ KHAN

Outline 2 Audio Basic Digital Audio Concepts Streaming Audio Web Audio Formats

Outline 2 Audio Basic Digital Audio Concepts Streaming Audio Web Audio Formats

Sound 3 q Sound comprises the spoken word, voices, music and even noise. q

Sound 3 q Sound comprises the spoken word, voices, music and even noise. q It is a complex relationship involving a vibrating object (sound source), a transmission medium (usually air), a receiver (ear) and a perceptor (brain). Example banging drum. q As the sound vibrates it bumps into molecules of the surrounding medium causing pressure waves to travel away from the source in all directions

Sound 4 q So, Sound are rapid vibrations that are transmitted as variations in

Sound 4 q So, Sound are rapid vibrations that are transmitted as variations in air pressure.

Waveforms 5 q Sound waves are manifest as waveforms q q A waveform that

Waveforms 5 q Sound waves are manifest as waveforms q q A waveform that repeats itself at regular intervals is called a periodic waveform Waveforms that do not exhibit regularity are called noise q The unit of regularity is called a cycle q This is known as Hertz (or Hz) after Heinrich Hertz One cycle = 1 Hz q Sometimes written as k. Hz or kilo. Hertz (1 k. Hz = 1000 Hz) q

Waveforms 6 Time for one cycle Cycle distance along wave

Waveforms 6 Time for one cycle Cycle distance along wave

The characteristics of sound waves 7 1. Sound is described in terms of two

The characteristics of sound waves 7 1. Sound is described in terms of two characteristics: 1. 2. Frequency Amplitude (or loudness) 2. Frequency 1. 2. 3. 4. the rate at which sound is measured Number of cycles per second or Hertz (Hz) Determines the pitch of the sound as heard by our ears The higher frequency, the clearer and sharper the sound the higher pitch of sound

The characteristics of sound waves 8 q Amplitude q q Sound’s intensity or loudness

The characteristics of sound waves 8 q Amplitude q q Sound’s intensity or loudness The louder the sound, the larger amplitude. q In addition, all sounds have a duration and successive musical sounds is called rhythm

The characteristics of sound waves 9 Time for one cycle Amplitude distance along wave

The characteristics of sound waves 9 Time for one cycle Amplitude distance along wave pitch Cycle

Example waveforms 10 Piano Pan flute Snare drum

Example waveforms 10 Piano Pan flute Snare drum

Capture and playback of digital audio 11 Air pressure variations Converts back into voltage

Capture and playback of digital audio 11 Air pressure variations Converts back into voltage Captured via microphone Analogue to Digital ADC Converter Signal is converted into binary (discrete form) 010100110101111 Air pressure variations Digital to Analogue Converter DAC

The Analogue to Digital Converter (ADC) 12 q An ADC is a device that

The Analogue to Digital Converter (ADC) 12 q An ADC is a device that converts analogue signals into digital signals q An analogue signal is a continuous value q It can have any single value on an infinite scale q A digital signal is a discrete value q It has a finite value (usually an integer) q An ADC is synchronised to some clock

The Analogue to Digital Converter (ADC) 13 q It will monitor the continuous analogue

The Analogue to Digital Converter (ADC) 13 q It will monitor the continuous analogue signal at a set rate and convert what it sees into a discrete value at that specific moment in time q The process to convert the analogue to digital sound is called Sampling. Use PCM (Pulse Code Modulation)

Digital sampling Sampling frequency 14

Digital sampling Sampling frequency 14

Digital sampling Sampling frequency 15

Digital sampling Sampling frequency 15

Sampling 16 q Two parameters: Sampling Rate q q Frequency of sampling Measure in

Sampling 16 q Two parameters: Sampling Rate q q Frequency of sampling Measure in Hertz The higher sampling rate, higher quality sound but size storage is big. Standard Sampling rate: - 44. 1 KHz for CD Audio - 11. 025 KHz for spoken - 5. 1025 KHz for audio effect

Sampling 17 Size sample The resolution of a sample is the number of bits

Sampling 17 Size sample The resolution of a sample is the number of bits it uses to store a given amplitude value, e. g. q q q 8 bits (256 different values) 16 bits (65536 different values) A higher resolution will give higher quality but will require more memory (or disk storage)

Quantisation 18 q Samples are usually represented the audio sample as a integers(discrete number)

Quantisation 18 q Samples are usually represented the audio sample as a integers(discrete number) or digital

Basic Terms 19 Term Definition Bit Binary value 0 or 1 Kilobit (Kb) 1,

Basic Terms 19 Term Definition Bit Binary value 0 or 1 Kilobit (Kb) 1, 000 bits (approx. ) Byte 8 bits Kilobyte (KB) 1, 000 bytes Megabyte (MB) 1, 000 bytes Gigabyte (GB) 1, 000, 000 bytes Kbps Kilobits per second (1, 000 bits in a second) KB/sec Kilobytes per second (1, 000 bytes in a second)

Analog vs. Digital 20 Analog: A signal that has a continuous nature rather than

Analog vs. Digital 20 Analog: A signal that has a continuous nature rather than a pulsed or discrete nature. Note: Electrical or physical analogies, such as continuously varying voltages, frequencies, or phases, may be used as analog signals. Digital: A signal in which discrete steps are used to represent information.

Digital Signal 21 Use Pulse Code Modulation (PCM) to represent an audio signal by

Digital Signal 21 Use Pulse Code Modulation (PCM) to represent an audio signal by digital data.

ADC & DAC 22 Figure 4. 3 Conversion from Analog to Digital requires an

ADC & DAC 22 Figure 4. 3 Conversion from Analog to Digital requires an Analog-to-Digital Converter Figure 4. 4 Conversion from Digital to Analog requires a Digital-to-Analog Converter

Basic Digital Audio Concepts 23 Sampling rate Number of sample taken of a signal

Basic Digital Audio Concepts 23 Sampling rate Number of sample taken of a signal in a given time (usually one second) Bit depth Describes the accuracy of the audio data Channels E. g. Stereo has two channels Bit rate Measured in kilobits per second (Kbps) is a function of the bit depth and sampling rate

Sampling rate 24 The more sample taken per second, the higher the accuracy. Typically

Sampling rate 24 The more sample taken per second, the higher the accuracy. Typically measured in kilohertz (KHz). CD audio has 44, 100 samples per second (44. 1 KHz). 8 KHz produces lower quality radio sound. Standard sampling rates include “ 8 KHz”, “ 11. 025 KHz”, … The high-end 96 K is used in DVD, but is not applicable to the Web.

Sampling Rate 25 demo

Sampling Rate 25 demo

Bit depth 26 Also called “sampling resolution” or “word length”. The more bits, the

Bit depth 26 Also called “sampling resolution” or “word length”. The more bits, the better is the quality of the audio (and a larger file of course). Common bit depths are 8 -bit (telephone like), 16 -bit (CD quality), and 20, 24, 32, 48 -bit depths. How many signal can a 8 -bit and a 16 -bit data represent? 0000 1111 0000 1111

Quantization 27 demo

Quantization 27 demo

Channels 28 Audio file can support one to six channels of audio formats. Mono

Channels 28 Audio file can support one to six channels of audio formats. Mono – one channel Stereo – two channels Some others – three, four channels. Six channels – 5. 1 -channel surround sound. More multi-channel formats announce in the coming years.

Channel Examples 29

Channel Examples 29

Bit rate 30 Audio files are measured in terms of bit rate which is

Bit rate 30 Audio files are measured in terms of bit rate which is measured in kilobits per second (Kbps). It can be calculated by dividing the file size by the time (in second) to play the audio clip. E. g. 3 Mb file play in 30 seconds 3000 k / 30 = 100 kbps. Quality at different compression rates

Optimizing for the Web 31 Length of the audio clip Keep the audio clip

Optimizing for the Web 31 Length of the audio clip Keep the audio clip as short as possible. E. g. just keep the most sweetest part of your greeting. Number of channels A mono audio file is halved the space of a stereo file. Depends on your actual needs.

Optimizing for the Web 32 Bit depth Audio file on the Web are usually

Optimizing for the Web 32 Bit depth Audio file on the Web are usually 8 -bits. Half the size of a 16 -bit file. Sampling rate Half the sampling rate will also halve the space needed. Voice only audio file can be reduced to 8 KHz. 22 KHz music clips are acceptable. Putting all things together: Mono, 8 -bit, 22 KHz, MP 3 compression.

Calculate audio size 33 8 -bit mono: seconds x KHz 16 -bit mono: (seconds

Calculate audio size 33 8 -bit mono: seconds x KHz 16 -bit mono: (seconds x KHz) x 2 8 -bit stereo: (seconds x KHz) x 2 16 -bit stereo: ([seconds x KHz] x 2)x 2 E. g. the file size of 30 seconds of 16 -bit, 11 KHz mono audio: (30 x 11) x 2 = 660 K.

Streaming Audio 34 What is it? Play almost immediately after the request, continues playing

Streaming Audio 34 What is it? Play almost immediately after the request, continues playing the transferring data. Advantages: Address the problem of long download time. Control distribution and protect copyright, because the user cannot get a copy of the file. Disadvantages: Sound quality may be be affected by low speed or unstable Internet connection. Reference

What is Streaming? 35

What is Streaming? 35

How does it work? Streaming audio 36 Packet are sent to a buffer on

How does it work? Streaming audio 36 Packet are sent to a buffer on the receiving Computer, the Real. Player will play the sound File when buffer full Web browser request a Real. Audio from the web server Real. Audio Server Web server

Quality Comparison 37 http: //www. cit. cornell. edu/atc/itsupport/streamcompare. shtml

Quality Comparison 37 http: //www. cit. cornell. edu/atc/itsupport/streamcompare. shtml

Web Audio Formats 38 WAV/AIFF (. wav/. aiff) The Waveform Audio File format (.

Web Audio Formats 38 WAV/AIFF (. wav/. aiff) The Waveform Audio File format (. wav) was developed by Microsoft, supports arbitrary sampling rates and bit depths. The Audio Interchange File format (. aif, . aiff) was developed for Macintosh platform. They are less likely used on the Web, because people use “mp 3” or “streaming”.

http: //www. nuance. com/prodserv/demo_vocalizer. html WAV/AIFF 39 Try the Bell-lab synthesis link. http: //www.

http: //www. nuance. com/prodserv/demo_vocalizer. html WAV/AIFF 39 Try the Bell-lab synthesis link. http: //www. bell-labs. com/project/tts/voices. html Select the Audio format

MP 3 (. mp 3) 40 Able to maintain excellent sound quality at very

MP 3 (. mp 3) 40 Able to maintain excellent sound quality at very small file sizes. The compression reduces an audio file to one-tenth of its original size. E. g. 40 MB file 3. 5 MB MP 3 is actually MPEG-1 Layer-III Good for distribution of HQ audio. Demo: www. mp 3. com

What is MP 3 digital encoding? 41 MP 3 is actually the file extension

What is MP 3 digital encoding? 41 MP 3 is actually the file extension for MPEG, audio layer 3. Layer 3 is one of three coding schemes (layer 1, layer 2, and layer 3) for the compression of audio signals. Layer 3 uses perceptual audio coding and psychoacoustic compression to remove all superfluous information. (More specifically, it removes the redundant and irrelevant parts of a sound signal--the stuff the human ear doesn't hear anyway). It also adds a MDCT (Modified Discrete Cosine Transform) that implements a filter bank, increasing the frequency resolution 18 times higher than that of layer 2.

MP 3 Players 42

MP 3 Players 42

Apple Quick. Time Audio (. mov) 43 Quick. Time is a well-known video format,

Apple Quick. Time Audio (. mov) 43 Quick. Time is a well-known video format, but it can create audio-only movies. Quick. Time is a container format, which is able to store still images, movie formats, … Excellent compression, true streaming Netscape and IE have Plug-in now. Quicktime : demo

MIDI (. mid/. midi) 44 MIDI stands for “Musical Instrument Digital Interface” which is

MIDI (. mid/. midi) 44 MIDI stands for “Musical Instrument Digital Interface” which is developed for electronic musical instruments. MIDI files are very compact and very good for lowbandwidth delivery. Instruments are “piano, drums, bass, orchestral strings, …” It is very attractive for adding MIDI file to your website with very little download time. Demo: www. findmidis. com

MIDI 45 http: //www. findmidis. com/

MIDI 45 http: //www. findmidis. com/

Real. Media/Real. Audio (. rm/. ra) 46 Real. Audio is a server-based streaming audio

Real. Media/Real. Audio (. rm/. ra) 46 Real. Audio is a server-based streaming audio format. The Real. Server responses to the requests and delivers the streaming packets, including the bandwidth negotiation. A robust Real. Server can support thousands of simultaneous listeners. Good for continuous-playing audio and live broadcasts to a large group of people. Example: RTHK Radio

Real. Media/Real. Audio 47

Real. Media/Real. Audio 47

Windows Media (. wma/. asf) 48 Windows Media is a streaming system. It wraps

Windows Media (. wma/. asf) 48 Windows Media is a streaming system. It wraps all media elements into a Active Streaming File (. asf). Audio may be saved as non-streaming Windows Media Audio format (. wma). Good for continuous-play audio. The encoder and player is Free, shipped with Windows OS.

Windows Media 49

Windows Media 49

Choosing an audio format 50 Audio Needs Suggested formats Short voice greetings WAV, AIFF,

Choosing an audio format 50 Audio Needs Suggested formats Short voice greetings WAV, AIFF, MP 3 News broadcasts Streaming solutions (Real. Audio, Windows Media) Background music MIDI, WAV Music samples for some audience MP 3 or Quick. Time Radio-style or Live broadcasting Real. Media System Musical E-greeting card MIDI, WAV

Add Audio to your Web Page 51 A simple link <A HREF=“audio/song. wav”>Play the

Add Audio to your Web Page 51 A simple link <A HREF=“audio/song. wav”>Play the song </A> <A HREF=“music. mp 3”><IMG SRC=“buttons/play. gif”></A> Background Sound <BGSOUND SRC=“audio/song. mid” LOOP=3> Link to Real. Media <A HREF=“song. ram”>Link to the song</A> pnm: //domainname. com/song. rm

Digital audio editing software 52 q One of the most powerful and professional PC-based

Digital audio editing software 52 q One of the most powerful and professional PC-based packages is a tool called Sound Forge http: //www. sonicfoundry. com /

Editing Digital Audio 53 1. Simple audio editing software allows: 1. Recording of digital

Editing Digital Audio 53 1. Simple audio editing software allows: 1. Recording of digital audio segments 2. Trimming 3. Splicing and assembly 4. Volume adjustments of the entire segment 5. Reversing Sounds 6. Copy, cut, paste and delete segments of digital audio 2. Others audio editing software: 1. COOL Edit Pro 2. Gold Wave 3. PROSONIQ Sonic. WORX 4. Samplitude Studio

Editing Digital Recording There abundance of sound editor available such as Sound. Forge (commercial),

Editing Digital Recording There abundance of sound editor available such as Sound. Forge (commercial), Goldwave (shareware), and Audacity(freeware). The basic sound editing operations that most commonly needed are: • Trimming • Fade-ins and Fade-outs • Splicing and Assembly • Equalization • Volume adjustment • Time Stretching • Format conversion • Digital Signal Processing • Resampling and Downsampling • Reversing Sound

Editing Digital Recording Trimming Removing “dead air” or silence space from the front of

Editing Digital Recording Trimming Removing “dead air” or silence space from the front of recording to reduce file size. Splicing and Assembly Cutting and Pasting different recording into one. Volume adjustment If you combining several recordings into one there is a good chance that you won’t get a consistent volume level. It is best to use a sound editor to normalize the combined audio about 80% – 90% of the maximum level. If the volume is increased too loud, you will hear a distortion.

Editing Digital Recording Format conversion Saving into different file formats. Resampling and Downsampling If

Editing Digital Recording Format conversion Saving into different file formats. Resampling and Downsampling If you have recorded your sounds at 16 -bit sampling rates, you can downsample to lower rates by downsampling the file to reduce the file size.

Editing Digital Recording Fade-ins and Fade-outs To smooth the beginning and the end of

Editing Digital Recording Fade-ins and Fade-outs To smooth the beginning and the end of the sound file by gradually increasing or decreasing volume. Equalization Some program offer digital equalization capabilities to modify the bass, treble or midrange frequency to make the audio sounds better.

Editing Digital Recording Time stretching Alter the length (in seconds) of a sound file

Editing Digital Recording Time stretching Alter the length (in seconds) of a sound file without changing its pitch. Reversing sound Spoken dialog can produce a surreal effect when played backward.

Advantages and Disadvantages of using audio 59 Sound adds life to any multimedia application

Advantages and Disadvantages of using audio 59 Sound adds life to any multimedia application and plays important role in effective marketing presentations. q Advantages q Ensure important information is noticed q Add interest q Can communicate more directly than other media

Advantages and Disadvantages of using audio 60 q Disadvantages q Easily overused q Requires

Advantages and Disadvantages of using audio 60 q Disadvantages q Easily overused q Requires special equipment for quality production q Not as memorable as visual media

Summary 61 q There are two main types of digital audio q Sampled audio

Summary 61 q There are two main types of digital audio q Sampled audio q q Captured by sampling an analogue waveform at a set rate MIDI data Instructions on how to perform some musical composition q Sampled audio requires more storage space than MIDI information q