Sound and the Codec Output On the DE2. Sound Sound is transmitted in air through compressions and rarefactions (stretches) of the air. This can be represented.

Slides:



Advertisements
Similar presentations
Musical Sounds Physical Science101 Chapter twenty Amanda Hyer.
Advertisements

Chapter 22B: Acoustics A PowerPoint Presentation by
Chp 13 Sound and Music.
Analog Communications
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
Sound in Matlab & Cogent
Waves and Sound Review.
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.
Sound, Part 3. Multiple Echoes Here is a recipe to create multiple echoes: def echoes(sndfile, delay, num): s1 = makeSound(sndfile) ends1 = getLength(s1)
Sound Test Review Vibrations Back and forth movements of matter are called.
CMPS1371 Introduction to Computing for Engineers PROCESSING SOUNDS.
Music and Mathematics are they related?. What is Sound? Sound consists of vibrations of the air. In the air there are a large number of molecules moving.
Chapter-3-1CS331- Fakhry Khellah Term 081 Chapter 3 Data and Signals.
You are an acoustic engineer. You have recorded a pure note of music that is described mathematically as f ( t ) = 20 sin (880  t ), where t is time in.
Week 7 - Friday.  What did we talk about last time?  Array examples.
Introduction to electronics lab ENGRI 1810 Using: Solderless prototype board (white board) Digital multimeter (DMM) Power Supply Signal Generator Oscilloscope.
Properties of Sound Neil Freebern. Sound Sound is produced when something vibrates. Vibrations disturb the air, creating variations in air pressure. Variation.
The frequency spectrum
Significant Figures As you learned in a previous tutorial, an appropriate measurement for the length of the rectangle below is 3.76 cm. Because the “3”
Sound. Sound is Energy in Waves Specifically, longitudinal waves Different from transverse waves.
1 Why do we computer scientists need to know communication technologies? Professor R. C. T. Lee.
Digital Voice Communication Link EE 413 – TEAM 2 April 21 st, 2005.
What is sound?* Sound begins with a vibration. Sounds travel in waves through a medium.
1 Live Sound Reinforcement Audio measurements. 2 Live Sound Reinforcement One of the most common terms you will come across when handling any type of.
Playing Music With Palm Pipes (PCV)
MIT Museum. Fourier What did you learn?? Perception Can pick out one frequency.
Fall 2004EE 3563 Digital Systems Design Audio Basics  Analog to Digital Conversion  Sampling Rate  Quantization  Aliasing  Digital to Analog Conversion.
Live Sound Reinforcement
Computing with Digital Media: A Study of Humans and Technology Mark Guzdial, School of Interactive Computing.
ACOUSTICS AND THE ELEMENTS OF MUSIC Is your name and today’s date at the top of the worksheet now?
HOW TO PLAY A MAJOR SCALE A STEP BY STEP GUIDE. What is a major scale? Scale: a sequence of musical notes going up or down Major: A scale made up of eight.
ENEE 440 Chapter Timer 8254 Register Select The 8254 timer is actually 3 timers in one. It is an upgraded version of the 8253 timer which was.
Exam 1 February 6 – 7 – 8 – 9 Moodle testing centre.
Computer Some basic concepts. Binary number Why binary? Look at a decimal number: 3511 Look at a binary number: 1011 counting decimal binary
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.
Physics of Sound Part 1 Sound waves How they are generated and travel.
Sound and Waves.
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?
1 Rev 07/28/2015.  Describe: examples, definition,? 2.
The of SOUND What is it? There are two ingredients for sound. First, we need a VIBRATION, then a MEDIUM.
Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009.
Binary! Objectives How sound is stored in digital format What is meant by “sample interval” and how it affects quality The trade off between file size.
1/27/2016Tech I Lighting Unit1 Sound: Properties and Functions Technical Theatre I.
Significant Figures Hopefully you remember the rules for using analog equipment to make measurements. For example, an appropriate measurement for the length.
The Physics Of Sound Why do we hear what we hear? (Turn on your speakers)
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.
Frequency Range Of Speakers. Frequency Of Subs The Frequency of The 2subwoofers go from Hz.
1 CS 177 Week 7 Recitation Slides Modifying Sounds using Loops + Discussion of some Exam Questions.
SOUNDS RECORDING AND REPRODUCTION The Volume of the Wave n The Amplitude is a measure of volume n The wave pink is softer than the blue wave. n It represents.
Waves II Sound waves, Free and forced vibrations, Resonance, Standing waves (strings, open & closed pipes) & Beats.
The physics of hearing and other odds and ends. The range of human hearing The range of average human hearing is from about 15Hz to about 15,000Hz. Though.
Journal 4/21/16 What kind of music helps you worship God? Is it the same as the kind of music you listen to most of the time? Objective Tonight’s Homework.
Sound J.Sample Sound Sound is a form of energy produced and transmitted by vibrating matter. Sound must have a medium, (matter), to travel through.
Section Vocabulary  Pitch- the highness or lowness of sound  Hertz- unit used to measure the frequency of a sound wave  Octave- A series of 8 notes.
Pitch.
Write down all your GROUP MEMBER names. Number your papers 1-24.
Sound and Waves.
Hearing and Mechanoreceptors
Significant Figures As you learned in a previous tutorial, an appropriate measurement for the length of the rectangle below is 3.76 cm. Because the “3”
Part 3 Harmonics Standing Waves and Pitch
Elements of Acoustic Phonetics
Sound and Waves.
Cornell Notes Sound Waves
Which of these show ONE full wave?
Sound and Waves.
CS1315: Introduction to Media Computation
Part 3 Harmonics Standing Waves and Pitch
Sound and Waves.
Presentation transcript:

Sound and the Codec Output On the DE2

Sound Sound is transmitted in air through compressions and rarefactions (stretches) of the air. This can be represented as a wave, symmetric around the central, “idle” value: As shown, the waves of different sounds are not the same

Volume & Frequency The volume is represented by the range of the wave up and down, that is its height above and below the “centre”. How many waves per second is the frequency. Volume 1 second Frequency = 5 waves per second

Waves The more waves per second, the higher the frequency and the higher the sound. Hertz (Hz) is the same as waves per second. Humans hear sounds from roughly 20 Hz (or waves per second) to 20,000 Hz or 20 KHz; human voice range is about 80 Hz to 1100 Hz, with musical instruments going beyond this.

Music Most people are aware of an octave. Two notes or sound waves are an octave apart if the higher note is double the frequency (or Hz) of the lower note. The two “do”s in the chromatic scale: do re mi fa so la ti do are an octave apart, thus double the frequency. (more next slide)

Octaves cont Piano keyboards have repeating patterns over an octave Each octave the frequency doubles. For our purposes, just note that the difference between say 100Hz and 200Hz will sound the same to humans as the difference between 1KHz and 2KHz. 1 Octave do re mi fa so la tido

The Codec We are only going to discuss one “channel” of the codec which is the thing to output sounds. (We also will ignore sound input.) There are two channels for stereo sound. We will assume you will treat both channels the same. The codec does NOT put out a sound. It puts out an instantaneous sample of how rarified the air should be at any specific time.

Codec Samples The codec expects 44,000 samples every second that it can put out to the speaker. The actual values are signed values, up to +/- 32,767 (ie 16 bits of significance) representing the deviation from the “neutral” centre point. The magnitude represents the volume. Here the black lines show the samples.

Sounds - easier To make your job easier, use square waves (the red in the figure) – this means you put out a single value for a certain length of time, then its negative, to represent a sound. The next slide shows the sampling >

Samples vary with frequency Higher sounds will change faster Low sound High sound

Updating the Channel To make things easier, each channel has a queue (or “FIFO”) in front of it. The channel, the speaker system, will grab values from the queue 44,000 times a second. Queue Channel

More updating You must provide the queue with samples often enough that it never gets empty. An interrupt will happen when the queue gets close to empty, at which time you will fill it up with the next samples from the wave you are generating. Queue Channel Wave samples Via your ISR

Coordination If you are doing a square wave, a counter can tell you when to change from the positive output to the negative output and back. Note that you continue to fill the queue from where you left off; you do not restart at the beginning of the sound! You could find you are part-way through a wave when the queue becomes full, and you need to start at that part-way point when the next queue interrupt comes.

Multiple Frequencies For multiple frequencies of sound going down the same channel: Add the values! Be sure the absolute value of the sum does not exceed 32,767 and go beyond the allowed range! (Limit the size of the summands!) Note that zeros into the channel means “off”.

Example Say you want to output a square wave with frequency of 1KHz. This is 1/1000 seconds per cycle, or a change from high to low or low to high every 1/2000 sec For a 44 KHz output rate to the channel, this means a change every 44000/2000=22 outputs. If we want to be able to add 3 different frequencies together and not overflow, we will pick a volume of 10,000 for this frequency. So every 22 outputs we will switch from loading a value of into the channel to , then switch back after loading 22 outputs of

For 3 Possible Inputs Queue Channel + Freq 1 or zero Freq 2 or zero Freq 3 or zero If you want the specific frequency, add it in, otherwise add in zero.