Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMP1 5.4. Representing Sound in a ComputerSound Course book - pages 124 - 131.

Similar presentations


Presentation on theme: "COMP1 5.4. Representing Sound in a ComputerSound Course book - pages 124 - 131."— Presentation transcript:

1 COMP1 5.4. Representing Sound in a ComputerSound Course book - pages 124 - 131

2 Input-Process-Output Inputcomputers read incoming data Processes or operate on it OutputDisplay or print information INPUTPROCESSINGOUTPUT

3 Data versus Information Data  the raw material which a computer accepts as input and then processes into useful information Information  processed data that provides understandable and useful information

4 Sound and data What is sound?  A pressure wave sensed by our ears. Analogue Sound  Pressure wave is captured by a transducer (often a microphone)  Transducer produces electrical voltage or current that varies in proportion to the sound pressure Transducer  Electrical signal then transmitted by telephone etc.  At receiving end electrical signal is used to create the sound by vibrating some mechanical surface in a loudspeaker, reproducing the original pressure wave

5 What is a transducer? A transducer is a device, that converts one type of energy to another for various purposes including measurement or information transfer. E.g  Antenna  Cathode Ray Tube  Loudspeaker  microphone

6 Coding Schemes Data is represented using various coding schemes. Different forms of information:  ASCII  Unicode  Binary Numbers  Gray Code  Boolean Values  Digitised Sound  Bit-mapped graphics / pixel

7 Analog data and analog signals Analog data Data that varies in a continuous manner E.g temperature Speech etc Analog signals An electrical signal that varies in a continuous manner E.g. electrical signals using a transducer (microphone) temp time 0 1 2 3

8 Digital data and digital signals Digital data Digital quantities vary in steps Analog quantities are sampled and become digital data: Digital Signals An electrical signal with voltage changes that are abrupt or in discreet steps HourTemp 117 218 319 420 521 624 voltage interval

9 Sound- key terms Wavelength Sampling rate Frequency Interval Bit rate

10 Wavelength The wavelength is the distance between any point on one wave and the corresponding point on the next one; that is, the distance the wave travels in one cycle.

11 FrequencyFrequency * The frequency (f) is the number of waves, or vibrations, that pass a given point per second. (how many times per second the wave peaks) Frequency is measured in Hertz (Hz), where 1 Hz = 1 vibration/second

12 Amplitude The larger the amplitude, the louder the tone; the smaller the amplitude, the softer the tone. Loudness is measure in decibels. Smaller amplitude (A1) = softer sound Larger amplitude (A2) = louder sound

13 Digital Sound Digital Sound is represented in discreet steps – a binary pattern, so that the sound can be stored and processed by a computer Intervals: how often the sound is ‘sampled’ Amplitude: digital number representing height of wave amplitude interval

14 Converting Analogue to Digital SoundConverting Analogue to Digital Sound * Hardware needed to convert is : Analogue to Digital (A to D) converter to convert analogue to digital Digital to Analogue (D to A) converter to recreate sound wave Transforms wave form input to a digital from i.e. a binary pattern, so that it can be stored and processed

15

16 A-to-D Converter Analogue signals can be converted into digital form by using the variations in frequency (pitch) and the variation in amplitude (loudness) of the sound

17 A-to-D Converter and quantisation noise Height of analogue wave form can be sampled at regular spaced intervals, with the height being represented by say a 16 bit code Sampling resolution: Sampling resolution: The number of bits used to store one sound sample Sampling rateSampling rate: * the frequency at which samples are taken, the higher the sampling rate the more faithful the sound is represented

18 The conversion has three stages: Sampling of amplitude signals (PAM pulses) – sampling rate at least twice the highest frequency in the analog signal (Nyquist Theorem) Digitizing of the amplitude signals (PCM pulses) - PAM samples are quantised- the height of each PAM pulse is assigned a digital value. Encoding of the stream of bits. Each value is translated into e.g. a 7-bit number (8 th bit is sign)

19 Quantisation noise/error The difference between the original amplitude and its sampled value is known as quantisation noise. Quantisation error is due either to rounding or truncation

20 Sound Sampling

21 Sampled Sound and Nyquist’s TheoremNyquist’s Theorem Sampling at 1 time per cycle Sampling at 1.5 times per cycle Sampling at 2 times per cycle

22 Digital Audio Is typically created by taking 16-bit samples over a spectrum of 44.1 KHz. Stereo sound doubles the number of samples taken, with 44,100 samples per second taking 32 bits each. CD quality sound requires 1,4 million bits of data per second.

23 Sound Synthesis (sound generation) Sound can be generated using analogue or digital techniques Digital sound generation  Numbers representing sound waves are manipulated  Sampled sounds as well as pure tones and arithmetic operations are carried out on the bit patterns representing the sound

24 MIDI Musical Instrument Digital Interface Is a particular form of serial interface built into or added to the parts of an electronic music system  E.g. Microphone, electronic keyboard with MIDI It does not store sound waves but a digital representation of the notes to be played.

25 Streaming audio E.g. RealPlayer Streaming client receives the audio data – put into a buffer until it’s used. The client player reads the data from the buffer and plays it. As long as player is not trying to access data that hasn’t been received, the streaming is successful. Streaming avoids the need to download and store large files. It also prevents copying.

26 Factors that affect the quality of recorded sound 1) frequency range of the sound which is sampled/played back, The Loudness war*The Loudness war 2) the sample rate at which the sound is initially sampled in the recording process 3) the conversions that occur after sampling to reproduce the final digital sound (characterised by its bitrate) which gets played back.

27 File formats WAV format – supported by Windows. 1 minute requires 2.5Mb of disk space MPEG (Mp2, mpa, mp3, mp4) – is a compression algorithm. It removes frequencies that the brain and ear will not miss (psychoacoustic). 1 minute MP3 requires.25Mb

28 Example Analog signal of frequency 1,000 Hz is converted to PCM digital signal by sampling at a frequency of 2,000Hz (2000 samples per second). Each sample uses 8 bits. How many Bytes are required for the PCM-coded result if recording 10 seconds of analog signal?

29 Answer Sampling frequency of 2,000 Hz means 2,000 samples are taken per second. In 10 seconds this is 20,000 samples. One byte per sample Therefore 20,000 bytes of storage needed

30 Activity - In pairs Each group creates 2 questions on topic with a marking scheme Question to the rest of the class


Download ppt "COMP1 5.4. Representing Sound in a ComputerSound Course book - pages 124 - 131."

Similar presentations


Ads by Google