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.

Slides:



Advertisements
Similar presentations
Introduction to Digital Audio
Advertisements

Georgia Institute of Technology Introduction to Processing Digital Sounds.
Chapter 4 Fundamentals of Digital Audio “Computers and Creativity” Richard D. Webster, COSC 109 Instructor Office: 7800 York Road, Room 422 | Phone: (410)
What makes a musical sound? Pitch n Hz * 2 = n + an octave n Hz * ( …) = n + a semitone The 12-note equal-tempered chromatic scale is customary,
Properties of Sound Neil Freebern. Sound Sound is produced when something vibrates. Vibrations disturb the air, creating variations in air pressure. Variation.
SWE 423: Multimedia Systems Chapter 3: Audio Technology (1)
Digital Audio.
Digital audio recording Kimmo Tukiainen. My background playing music since I was five first time in a studio at fourteen recording on my own for six months.
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.
Acoustics in Twenty Words or Less. What is Acoustics? The Science of Sound!
1 Multimedia Systems 1 Dr Paul Newbury School of Engineering and Information Technology ENGG II - 3A11 Ext: 2615.
Fundamentals of Digital Audio. The Central Problem n Waves in nature, including sound waves, are continuous: Between any two points on the curve, no matter.
Digital Audio Multimedia Systems (Module 1 Lesson 1)
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.
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.
Digital audio. In digital audio, the purpose of binary numbers is to express the values of samples that represent analog sound. (contrasted to MIDI binary.
CSC 8610 & 5930 Multimedia Technology Lecture 4 Digital Audio Representation.
Lab #8 Follow-Up: Sounds and Signals* * Figures from Kaplan, D. (2003) Introduction to Scientific Computation and Programming CLI Engineering.
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.
1 4-Integrating Peripherals in Embedded Systems (cont.)
CompSci Today’s topics Sound Upcoming ä Sound splicing ä Intellectual property ä Network analysis Reading Introduction to Computing & Programming.
Dynamic Range and Dynamic Range Processors
Physics of Sound Part 1 Sound waves How they are generated and travel.
Introduction to SOUND.
More Meaningful Jargon Or, All You Need to Know to Speak Like a Geek Sound.
SOUND Longitudinal Wave Travels through some medium Cannot travel through a vacuum How does vibrating drum produce sound? Skin moving up presses air.
Properties of Sound Physical Science Ms. Pollock
Georgia Institute of Technology Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Sept 2005.
The Physics Of Sound Why do we hear what we hear?
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 3 – Digital Audio Representation Klara Nahrstedt Spring 2009.
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.
Digital Audio. Acknowledgement Some part of this lecture note has been taken from multimedia course made by Asst.Prof.Dr. William Bares and from Paul.
Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009.
CS1315: Introduction to Media Computation Sound Encoding and Manipulation.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 3 – Digital Audio Representation Klara Nahrstedt Spring 2014.
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.
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.
1 CS 177 Week 7 Recitation Slides Modifying Sounds using Loops + Discussion of some Exam Questions.
Physics Mrs. Dimler SOUND.  Every sound wave begins with a vibrating object, such as the vibrating prong of a tuning fork. Tuning fork and air molecules.
AUDIO Audio means "of sound" or "of the reproduction of sound". Specifically, it refers to the range of frequencies detectable by the human ear ム approximately.
Physical characteristics of sound Amplitude – The measure of displacement of the air pressure wave Frequency – Represents the number of periods.
Lifecycle from Sound to Digital to Sound. Characteristics of Sound Amplitude Wavelength (w) Frequency ( ) Timbre Hearing: [20Hz – 20KHz] Speech: [200Hz.
Chapter 4 Fundamentals of Digital Audio
The Physics of Sound.
Physics 7E Prof. D. Casper.
Introduction to Digital Audio
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Higher Intensity (Volume)
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
Properties of Sound Chapter 16 Section 2.
Introduction to Processing Digital Sounds
Assist. Lecturer Safeen H. Rasool Collage of SCIENCE IT Dept.
Introduction to Digital Audio
CS1315: Introduction to Media Computation
Presentation transcript:

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 to execute.” - Donald Knuth

COSC 1P02 Introduction to Computer Science 4.2 Sound  Waves of air pressure  increases in pressure (wave) called compressions  decreases in pressure (toughs) called rarefactions  Sound perceived based on shape, frequency and amplitude of wave  Sine wave  simplest sound (regular)  cycle  amplitude  Frequency

COSC 1P02 Introduction to Computer Science 4.3 Volume  we hear changes in intensity (amplitude)  Change (ratio) measured in decibels (dB)  Commonly volume expressed in dB as ratio to threshold of audibility (0 dB SPL)  normal speech: 60 dB SPL  shouting: 80 db SPL  Based on a logarithmic scale  10 db is 10x louder then 0 (silence)  20 db is 100x louder then 0 (silence)  30 db is 1000x louder etc….

COSC 1P02 Introduction to Computer Science 4.4 Pitch/Tone  All sounds are periodic  have cycles  Frequency is the number of cycles per second (measures in Hertz (Hz))  the A above middle C is 440Hz  we can hear from 2Hz to 22,000 Hz (or 22 kHz)  we hear pitch as the change in frequency  in standard tuning ratio of notes in neighboring octaves is 2:1 (e.g. 440Hz : 880Hz)  ratio of notes in different octaves remains constant

COSC 1P02 Introduction to Computer Science 4.5 Shape  Different sources of sound - sound different even when playing the same note  e.g. flute vs piano  Sounds seldom have a single frequency  overtones are other frequencies in the sound that are at lower amplitude  The central tone is called the fundamental tone  Sounds also vary by attack, fade and other characteristics

COSC 1P02 Introduction to Computer Science 4.6 Exploring Sounds  SoundInspector tool  Java program built using the BasicIO & Media libraries  draws sound wave and allows zooming in on parts of wave  E.g  c4.wav – sine wave - middle C  e4.wav – sine wave – E above C  bassoon-c4.wav – bassoon playing middle C  rabbit.wav  thisisatest.wav

COSC 1P02 Introduction to Computer Science 4.7 Encoding (Digitizing) Sounds  Microphone measures air (sound) pressure  record voltage (analog) as a number (digital) – analog-to- digital conversion (ADC)  Sound is change of air pressure over time  record samples of air pressure over time  Number of samples?  depends on highest frequency to capture  Nyquist’s theorem – to capture frequencies up to n Hz must have 2n samples per second  to handle 22,000 Hz need 44,000 samples per second  CDs are sampled at 44,100 samples per second  Sample size  CDs use 2 bytes (16 bits) per sample  65,536 (2 16 ) possible values (-32,768 to 32,767)  Note: 80 44,100 samples per second at 2 bytes per sample x 2 channels (stereo) = 846,720,000 bytes or approximately 800 Mb

COSC 1P02 Introduction to Computer Science 4.8 Sound & SoundPlayer  Sound  class in the Media library  provides access to sounds  sounds can be loaded from files (.wav )  SoundPlayer  class in the BasicIO library  provides a window with a button to play a sound  Sound objects placed on SoundPlayer  Example  Load and play a sound

COSC 1P02 Introduction to Computer Science 4.9 Making a Sound Louder  Increase amplitude of each sample  multiply each by some factor (parameter of a method)  Example  Sequence through all samples in sound  Sample class  for each  executes body once for each Sample in the Sound  index variable (now a Sample ) is each Sample in succession  Saving the result  Did it work?

COSC 1P02 Introduction to Computer Science 4.10 Generating Clipping  Clipping occurs when the sample value exceeds the maximum sample size (e.g. greater than 32,767 or less than -32,768 for a 2 byte sample).  sample value when clipped will be the maximum value (32,767 or -32,768)  If keep increasing volume, clipping occurs  What happens if all samples clipped?  Example  program to set all samples to maximum value  What does signal look like?  Note: we can still understand it!  if statement  choice between executing two alternatives  to handle maximum positive and maximum negative

COSC 1P02 Introduction to Computer Science 4.11 If Statement  Syntax  If condition is true, the first set of statements (then part) is executed, otherwise the second set of statements (else part) is executed  Condition  an expression that is either true or false  relational operators  note: also used in for statement (second part)

COSC 1P02 Introduction to Computer Science 4.12 Normalizing a Sound  What if we want to make a sound as loud as we can without causing clipping?  Need to know the largest (absolute value) amplitude (sample)  Can scale each sample by the ratio of this largest value to the maximum sample size ( 32,767 )  Finding maximum  sequence through all samples and if find one that is bigger than the biggest so far, change our guess of what the biggest value is  work with absolute value (i.e. don’t care if positive or negative)  need a starting guess  since looking at absolute value, no sample can be smaller than 0 so 0 can be starting guess  Example  Note: need two loops  one to find maximum  one to scale samples

COSC 1P02 Introduction to Computer Science 4.13 The end