Georgia Institute of Technology Introduction to Processing Digital Sounds.

Slides:



Advertisements
Similar presentations
Chp 13 Sound and Music.
Advertisements

Analog Representations of Sound Magnified phonograph grooves, viewed from above: When viewed from the side, channel 1 goes up and down, and channel 2 goes.
Introduction to Digital Audio
MULTIMEDIA TUTORIAL PART - III SHASHI BHUSHAN SOCIS, IGNOU.
Hearing. How hearing works First, the ear gathers the compressional waves. Next, the ear amplifies the waves. In the ear, the amplified waves are converted.
A Dan Turkel Production. What is sound?  Sound is a wave of pressure oscillation. Sound is measured in amplitude (the height of the wave, how loud it.
Digital Signal Processing
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.
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.
17.4 Sound and Hearing Sound waves are longitudinal waves that travel through a medium. Many behaviors of sound can be explained by using a few properties:
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.
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 5: Arrays: A Static Data Structure for Sounds.
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
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
CompSci Today’s topics Sound Upcoming ä Sound splicing ä Intellectual property ä Network analysis Reading Introduction to Computing & Programming.
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 Vibration and Motion.
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.
Sound
Georgia Institute of Technology Processing Sound Ranges Barb Ericson Georgia Institute of Technology July 2005.
UsingSoundRanges-part21 Processing Sound Ranges part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
Encoding and Simple Manipulation
EQ: How do different mediums affect the speed of sound?
Intensity of a Spherical Wave
CPSC1301 Computer Science 1 Chapter 8 Introduction to Processing Digital Sounds part 3.
CS 102 Computers In Context (Multimedia)‏ 03 / 30 / 2009 Instructor: Michael Eckmann.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 6: Modifying Sounds Using Loops.
Chapter 2 Basic Science: Analog and Digital Audio.
Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009.
CSCI-100 Introduction to Computing Hardware Part II.
CS1315: Introduction to Media Computation Sound Encoding and Manipulation.
Sound “A sound man…”. Frequency The frequency of a sound wave is perceived as the pitch (note) –High frequency → high pitch → high note –“Middle C” has.
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.
COSC 1P02 Introduction to Computer Science 5.1 Cosc 1P02 Week 5 Lecture slides Psychiatrist to patient "You have nothing to worry about - anyone who can.
Intro-Sound-Mod10-part31 Introduction to Processing Digital Sounds part 3 while loop, tracing, for loop, parameters Barb Ericson Georgia Institute of Technology.
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.
Working with Sounds Barb Ericson College of Computing Georgia Institute of Technology
The Physics of Sound.
Introduction to Media Computation
Georgia Institute of Technology
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.
17.4 Sound and Hearing.
Chapter 6: Modifying Sounds Using Loops
Introduction to Processing Digital Sounds part 2
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 part 3
Introduction to Processing Digital Sounds
Processing Sound Ranges part 2
Processing Sound Ranges
Assist. Lecturer Safeen H. Rasool Collage of SCIENCE IT Dept.
Processing Sound Ranges part 3
Introduction to Digital Audio
CS1315: Introduction to Media Computation
Presentation transcript:

Georgia Institute of Technology Introduction to Processing Digital Sounds

Georgia Institute of Technology 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

Georgia Institute of Technology 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

Georgia Institute of Technology 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?

Georgia Institute of Technology 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

Georgia Institute of Technology 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

Georgia Institute of Technology 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();

Georgia Institute of Technology 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 file

Georgia Institute of Technology Play and Explore a Sound Sound Explorer Type here

Georgia Institute of Technology 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

Georgia Institute of Technology 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();

Georgia Institute of Technology Changing the Value of a Sound Sample You can set the value of a SoundSample – sample.setValue(value); – This will change the value in the Sound object as well So how would you change the value to the original value * 2? SoundSample sample = sampleArray[0]; sample.setValue(sample.getValue() * 2);

Georgia Institute of Technology Increase Volume with For-Each Loop public void increaseVolume() { SoundSample[] sampleArray = this.getSamples(); int value = 0; // value at sample // loop through SoundSample objects for (SoundSample sample : sampleArray) { value = sample.getValue(); // get the value sample.setValue(value * 2); // set the value }

Georgia Institute of Technology Memory versus Disk When we read from a file we read from disk into memory – Computers only do calculations on memory We change the values in memory The file on the disk hasn’t changed To save our new sound we need to write a file to the disk – soundObj.write(fileName);

Georgia Institute of Technology Normalize Sounds Make the whole sound as loud as possible – How loud can it be? The max positive value is The max negative value is – First we need to find the largest value (positive or negative) in the current sound Create a variable to hold the max – And set it to the first value in the array And loop through the array and if the absolute value of the current value is greater – Store that one instead

Georgia Institute of Technology Find the Largest Value in an Array Start with the first value in the array – The one at index 0 int max = valueArray[0]; Loop through the rest of the items in the array – Compare the absolute value of the value at current index in the array to the absolute value of the largest If it is bigger store it in max for (int i = 1; i < valueArray.length; i++) { if (Math.abs(valueArray[i]) > Math.abs(max)) max = valueArray[i]; }

Georgia Institute of Technology Find the Largest Value in an Array int max = first element max = valueArray[0] = 2000; for (int i = 1; i < valueArray.length; i++) { if (Math.abs(valueArray[i]) > Math.abs(max) max = valueArray[i]; } 2000 | 1000 | | 100 | 3300

Georgia Institute of Technology Find the Largest Value in an Array What is the value of max each time through the loop? ivaluemax | 1000 | | 100 |

Georgia Institute of Technology Normalize Sound - Continued After we find the maximum value – Determine the factor that we can multiply all values by And not go over the maximum allowed value double multiplier = / max; – Call the method changeVolume with the multiplier Test with String file = FileChooser.getMediaPath(“double preamble.wav”); Sound soundObj = new Sound(file); soundObj.explore(); soundObj.normalize(); soundObj.explore();

The Sound class The Sound class is provided in your bookClasses directory. Bring it up in Dr. Java and run JavaDoc on it to see all of the functionality it has – blendSounds – Echo – Modify frequency – Reverse – Splice – And much more ….