Monday, January 18, 2010

Sampling:& Quantization

Sampling
The process of grabbing the sound into small increments.

These small increments will later form a series of discrete values coded in binary format

Sampling Rate: How often the sound is grabbed, The higher the sampling rate, the more parts are grabbed, the better quality of sound & bigger file size

(Unit: kHz)

Sampling Rate most often used are 22.05 KHz (most common), 44.1KHz (common for audio CD), and 11.025KHz




Quantization


The process of rounding off a continuous value horizontally so that it can be represented by a fixed no of binary bits

Unit: bits (can use 8-bit, 16-bit and so on to quantize sound)

If u choose 8-bit of quantization level to quantize the analog sound, mean the analog sound will be divided into 256 parts.
Similarly, sound quantized at 16-bit divides the waves into 65,536 parts per second, just like 8-bit graphics can convey 256 colors and 16-bits can display 65,536 types of colors.

The larger the bit, the better the sound, the larger the file size

Digitization

1.Our world and bodies are analog, functioning in a smooth and continuous flow (analog signal)
eg water current, wind, the flow of bloods etc.



2.The digital world is made of little chunks (digital signal)


Digital Signal



.The representation of info as a series of numbers

.A sequence of discrete values coded in binary format

.Humans deal with analog info

.Humans only perceive digital info when it has been transformed into analog domain

.Computer can only generate and accept info in digital form

.Therefore, we need “Digitization”


Digitization (Devices)


Two devices that allow human and computer interact: ADC and DAC

Analogue-to-Digital Converter (ADC):

Performs the process of converting from analog sound to digital sound

Digital-to-Analog Converter (DAC):

Performs the re-conversion back to analogue sound from digital sound

Found in mm hardware: sound card, audio recorders, graphic cards, video recorder, CD-audio players, printer, monitor, network card etc.


Digitization (Process)

Digitization (The transformation of analog signals into digital signals) requires 2 successive steps:

1.Sampling

2.Quantisation (resolution)

Types of sound

Sound effects

Message reinforcing: e.g. when discussing topics on nature, sounds of birds, waves etc. can enhance the message

Music
Narration: a voice describes some facts that pertaining to the topic
Voice-overs: Not to be confused with narration, this type of content sound is used in instances where short instructions may be necessary for the user to navigate the multimedia application.

Speech
Singing: Combines characteristics of speech and music

Characteristics of Sound (Frequency & Amplitude)

Two important sound characteristics:

frequency and amplitude

Frequency:


The number of cycles a sound wave creates in one second (pitch)
A cycle is measured from one wave peak to another
Unit: Herts (Hz) or cycles per second (cps)



Amplitude:



The volume or loudness of a particular sound
The louder the sound, the higher the amplitude will be
Unit: decibel (dB)

INTRO TO Sound:

Sound:
.Fluctuations in air pressure (Sound is vibrations in the air) that can be perceived by our ears with some qualitative attribute

.Produced by a source that creates vibration in the air

.The pattern of oscillation is called a waveform

Software Interrupts

Software in are used by programs to request system services

These interrupts are treated in the same way as the interrupts for the Hardware devises are\

In assembly we useINT instruction to perform such interrupts Syntax: name INT interrupt-number;comments Syntax (simplified): INT interrupt-number Example: INT 21h


These interrupts are used with there functions

Explanation

In order to use I/O operations we use interrupt 21h,
But in order to perform a specific task, like printing a string to a standard output device we have to use its function 09h

Example code

MOV AH 09h
LEA DX, string
INT 21h

Hardware Interrupt

..When an interrupt is generated by hardware

.It sends a signal request to the processor

.The processor suspends the current tasks it is executing

.Then the control is transferred to the interrupt routine

.Then the interrupt routine performs some I/O operations depending on which generated by the hardware

.Finally the control is transferred back to the previous executing task at the point where it was suspended.

How does interrupts work !?

.When the hardware needs service it will request an interrupt.

.A thread is defined as the path of action of software as it executes.

.The execution of the interrupt service routine is called a background thread.

.This thread is created by the hardware interrupt request

.The thread is killed when the interrupt service routine executes the instruction.

.A new thread is created for each interrupt request. It is important to consider each individual request as a separate thread because local variables and registers used in the interrupt service routine are unique and separate from one interrupt event to the next.

.In a multithreaded system we consider the threads as cooperating to perform an overall task.


.When an interrupt is generated

.It sends a signal request to the processor

.The processor suspends the current tasks it is executing

.Then the control is transferred to the interrupt routine

.Then the interrupt routine performs some I/O operations depending on which interrupt function is called or generated by the hardware

.Finally the control is transferred back to the previous executing task at the point
where it was suspended.

Introduction to Interrupts

Introduction to Interrupts

An interrupt is the automatic transfer of software execution in response to hardware that is asynchronous with the current software execution.

There are 3 main categories of interrupts, Hardware Interrupt Software Interrupt Processor Exception

Interrupts were originally created to allow hardware devices to interrupt the operations of the CPU.