Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009.

Slides:



Advertisements
Similar presentations
Introduction to Digital Audio
Advertisements

MULTIMEDIA TUTORIAL PART - III SHASHI BHUSHAN SOCIS, IGNOU.
Georgia Institute of Technology Introduction to Processing Digital Sounds.
Digital Signal Processing
The frequency spectrum
Intro-Sound-part31 Introduction to Processing Digital Sounds part 3 Barb Ericson Georgia Institute of Technology Oct 2009.
Analog to Digital Conversion. 12 bit vs 16 bit A/D Card Input Volts = A/D 12 bit 2 12 = Volts = Volts = 2048 −10 Volts = 0 Input Volts.
From the air to the iPod. Minute disturbances in the air, caused by a vibrating object Air molecules bunch together, then spread out Changes in density.
Digital Audio.
Image and Sound Editing Raed S. Rasheed Sound What is sound? How is sound recorded? How is sound recorded digitally ? How does audio get digitized.
Sound and Hearing. Sound Waves Sound waves are mechanical and longitudinal waves What does this tell you about sound waves? Sound waves need a material.
Computer Science 101 Introduction to Programming with Sounds.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 6: Modifying Sounds Using Loops.
Introduction to Sound Sounds are vibrations that travel though the air or some other medium A sound wave is an audible vibration that travels through.
Intro-Sound-part21 Introduction to Processing Digital Sounds part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
The Human Ear fancy sub-heading. Parts of the ear Three main parts: The outer ear consists of the pinna, ear canal and eardrum The middle ear consists.
 Continuous sequence of vibrations of air  (Why no sound in space? Contrary to Star Wars etc.)  Abstraction of an audio wave:  Ear translates vibrations.
Introduction to Interactive Media 10: Audio in Interactive Digital Media.
Lecture # 22 Audition, Audacity & Sound Editing Sound Representation.
DTC 354 Digital Storytelling Rebecca Goodrich. Wave made up of changes in air pressure by an object vibrating in a medium—water or air.
CompSci Today’s topics Sound Upcoming ä Intellectual property ä Network analysis ä Security Reading.
Computing with Digital Media: A Study of Humans and Technology Mark Guzdial, School of Interactive Computing.
COMP Representing Sound in a ComputerSound Course book - pages
Art 321 Sound, Audio, Acoustics Dr. J. Parker. Sound What we hear as sound is caused by rapid changes in air pressure! It is thought of as a wave, but.
Georgia Institute of Technology Introduction to Media Computation Barb Ericson Georgia Institute of Technology May 2006.
Computer Some basic concepts. Binary number Why binary? Look at a decimal number: 3511 Look at a binary number: 1011 counting decimal binary
Announcements Chapter 11 for today No quiz this week Instructor got behind…. We'll be back in MGH389 on Friday.
CompSci Today’s topics Sound Upcoming ä Sound splicing ä Intellectual property ä Network analysis Reading Introduction to Computing & Programming.
Basics of Digital Audio Outline  Introduction  Digitization of Sound  MIDI: Musical Instrument Digital Interface.
Mechanical Waves and Sound
COSC 1P02 Introduction to Computer Science 4.1 Cosc 1P02 Week 4 Lecture slides “Programs are meant to be read by humans and only incidentally for computers.
Sound on the Web. Using Sound on a Web Site Conveying information  pronounce a word or describe a product Set a mood  music to match the web page scene.
Introduction to SOUND.
More Meaningful Jargon Or, All You Need to Know to Speak Like a Geek Sound.
Sound Waves Physic 11 · Chapter 9.
SOUND SOUND IS A FORM OF ENERGY SOUND IS A WAVE SOUND WAVES REQUIRE A MEDIUM SOUND HAS PROPERTIES: –AMPLITUDE –FREQUENCY SOUND VOLUME IS MEASURED IN DECIBELS.
Georgia Institute of Technology Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Sept 2005.
By Rhett Price. Speed of sound depends on density Correlation between speed and density Not as fast as light speed Also affected by pressure and temperature.
Sound
Georgia Institute of Technology Processing Sound Ranges Barb Ericson Georgia Institute of Technology July 2005.
1 Introduction to Information Technology LECTURE 6 AUDIO AS INFORMATION IT 101 – Section 3 Spring, 2005.
Properties of Sound Making Waves. Sound Waves ■Sound is created by vibrations.
Encoding and Simple Manipulation
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 6: Modifying Sounds Using Loops.
Chapter 2 Basic Science: Analog and Digital Audio.
CS1315: Introduction to Media Computation Sound Encoding and Manipulation.
Recording Arts…Audio Sound Waves Fall What does this all mean to you in this class? You are always working with sound waves – it is important to.
Multimedia Sound. What is Sound? Sound, sound wave, acoustics Sound is a continuous wave that travels through a medium Sound wave: energy causes disturbance.
Session 18 The physics of sound and the manipulation of digital sounds.
Digital Audio I. Acknowledgement Some part of this lecture note has been taken from multimedia course made by Asst.Prof.Dr. William Bares and from Paul.
Chapter 12 Preview Objectives The Production of Sound Waves
1 CS 177 Week 7 Recitation Slides Modifying Sounds using Loops + Discussion of some Exam Questions.
SOUND S4P2: Students will demonstrate how sound is produced by vibrating objects and how sound can be varied by changing the rate of vibration.
Sound and Hearing Chapter 17 Section Four. Science Journal Entry 35 Compare and contrast reflection, refraction and diffraction.
The Physics of Sound.
Introduction to Media Computation
Introduction to Digital Audio
Processing Sound Ranges part 3
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Chapter 6: Modifying Sounds Using Loops
Introduction to Digital Audio
Introduction to Digital Audio
How sound works: Acoustics, the physics of sound
Introduction to Digital Audio
Introduction to Processing Digital Sounds
Processing Sound Ranges
Processing Sound Ranges part 3
Introduction to Digital Audio
Sound.
CS1315: Introduction to Media Computation
Presentation transcript:

Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009

Intro-Sound-part1 Learning Goals Learn about sounds –How do we hear? –How do we digitize sound? –Why do we digitize sound? –How is digitized sound represented? How to play a sound in Java –How to create Sound objects –How to play them –How to explore them

Intro-Sound-part1 How does Hearing Work? The outer ear “catches” sounds The eardrum vibrates The inner ear translates the vibrations to nerve impulses for the brain to interpret

Intro-Sound-part1 Acoustics, the physics of sound Sounds are waves of air pressurewaves of air pressure –Sound comes in cycles –The frequency of a wave is the number of cycles per second (cps), or Hertz (Complex sounds have more than one frequency in them.) –The amplitude is the maximum height of the wave

Intro-Sound-part1 Volume and Pitch Our perception of volume is related (logarithmically) to changes in amplitude –If the amplitude doubles, it’s about a 3 decibel (dB) change. –A decibel is a ratio between two intensities: 10 * log 10 (I 1 /I 2 ) –As an absolute measure, it’s in comparison to threshold of audibility 0 dB can’t be heard. Normal speech is 60 dB. A shout is about 80 dB Our perception of pitch is related (logarithmically) to changes in frequency –Higher frequencies are perceived as higher pitches –We can hear between 5 Hz and 20,000 Hz (20 kHz) –A above middle C is 440 Hz

Intro-Sound-part1 Try It Attach a microphone to your computer Open the Windows-MediaTools folder Drag the mediatools-v5-sa.image file and drop it on SqueakVM.exe This will start Squeak with the media tools loaded Click on the Sound Tools window –It will expand Click on Record Viewer and Record –And do high and low sounds in the microphone Notice that high sounds have more cycles per second Click on Quit to exit Squeak

Intro-Sound-part1 Sound Tools in Squeak

Intro-Sound-part1 Digitizing Sound In calculus you learn to estimate a curve by creating rectangles We can do the same to estimate the sound curve –Analog-to-digital conversion (ADC) will give us the amplitude at an instant as a number: a sample –How many samples do we need?

Intro-Sound-part1 Nyquist Theorem We need twice as many samples as the maximum frequency in order to represent (and recreate, later) the original sound. The number of samples recorded per second is the sampling rate –If we capture 8000 samples per second, the highest frequency we can capture is 4000 Hz That’s how phones work –If we capture more than 44,000 samples per second, we capture everything that we can hear (max 22,000 Hz) CD quality is 44,100 samples per second

Intro-Sound-part1 Try It Call a friend on a phone and play some music over the phone –How does it sound? –Phones only transmit 8,000 samples per second –The highest frequency you can transmit by phone is 4000 Hz –This is fine for voice but what does it do to music?

Intro-Sound-part1 How does Recorded Sound Work? Phonograph recordings capture sound continuously, as an analog signalPhonograph recordings CDs and DVDs sample sounds and record numbers that represent the sound at the time of the sampleCD –44,100 samples per second

Intro-Sound-part1 Why Digitize Sound? High fidelity –Reproduced sound is very similar to the original Perfect reproduction –Sounds the same every time Easy to transmit –Download as data Easier to manipulate on a computer –Even though there are billions of bits

Intro-Sound-part1 Playing a Sound We can create a Sound object just as we created a Picture object –Get a file name and save a reference to it String fileName = FileChooser.pickAFile(); –Pick a file that ends in.wav –Create the sound object by asking the class to create a new Sound object and initialize it by reading data from the given file name Sound sound1 = new Sound(fileName); –Play the Sound sound1.play();

Intro-Sound-part1 Play Sound Exercise Try creating a Sound object and playing it –You can do this all at once Shown on top –Or you can name each part Shown on bottom How would you play the same sound twice?

Intro-Sound-part1 Digitizing Sound in the Computer Each sample is stored as a number (two bytes) What’s the range of available combinations? –16 bits, 2 16 = 65,536 –But we want both positive and negative values To indicate compressions and rarefactions. –What if we use one bit to indicate positive (0) or negative (1)? –That leaves us with 15 bits –15 bits, 2 15 = 32,768 –One of those combinations will stand for zero We’ll use a “positive” one, so that’s one less pattern for positives so the range is from -32,768 to 32,767

Intro-Sound-part1 Sound Basics new Sound(fileName) –Will create a new Sound object from the data in the file with the passed file name soundObj.play() –Will start the sound playing soundObj.explore(); –Will open a sound explorer on the object soundObj.blockingPlay() –Will play the sound and wait to return until the sound is finished soundObj.write(String fileName) –Will write out the sound to the specified file

Intro-Sound-part1 Play and Explore a Sound Sound Explorer Type here

Intro-Sound-part1 The Sound Explorer Not all of the sound is shown when you explore a sound –Skips values to fit in the window You can zoom in –To see all sample values You can zoom out –To fit the sound in the window again

Intro-Sound-part1 Getting the Sound Sample Values A Sound has many values in it –Numbers that represent the sound at that time in the sample You can get an array of SoundSample objects –SoundSample[] sampleArray = sound1.getSamples();

Intro-Sound-part1 Explore the Sound Sample Values Zoom in to see all the sound values Click here to go to the next index Type in an index See the value Click here to pick an index

Arrays Store many items of the same type in memory in contiguous space You can use an index value to access an item stored in the array Intro-Sound-part1 012

Print the Sound Sample Value You can get a SoundSample object from the array at an index –SoundSample sample = sampleArray[0]; And then get the value from that –System.out.println(sample.getValue()); What are the first 5 values of the Sound created from the file croak.wav?

Intro-Sound-part1 Summary Sounds are made by changes in air pressure –Compression followed by refraction The pitch is based on the frequency –Distance between cycles The volume is based on the amplitude (height of the wave) We can create Sound objects, play them, and explore them A sound sample is a value from -32,768 to 32,767 We need to capture 2x the max frequency –44,000 samples per second on a CD for a max frequency of 22,000 Sounds values are stored in an array