Implementing 3D Digital Sound In “Virtual Table Tennis” By Alexander Stevenson.

Slides:



Advertisements
Similar presentations
Tamara Berg Advanced Multimedia
Advertisements

Digital Audio Teppo Räisänen LIIKE/OAMK. General Information Auditive information is transmitted by vibrations of air molecules The speed of sound waves.
Sound can make multimedia presentations dynamic and interesting.
SimPhonics, Inc. FXDirect Audio System for V+. SimPhonics, Inc. What Is FXDirect ® Audio Subsystem Add-on to V+ –Currently built-in Consists of Objects.
AVQ Automatic Volume and eQqualization control Interactive White Paper v1.6.
Final Year Project Progress January 2007 By Daire O’Neill 4EE.
SWE 423: Multimedia Systems Chapter 3: Audio Technology (2)
GAM666 – Introduction To Game Programming DirectX Audio, first appearing in DirectX 8, is the union of ● DirectSound – low level control of the audio hardware.
NSF REU JULY 27 TH, 2012 Sound Pixel Project. Building a Frame Design Concept  Transportable, study, and easily constructed Material: 80/20  Lightweight.
Tricks and Techniques for Sound Effect Design By Bobby Prince 97/sound_effect.htm.
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.
Introduction What is this ? What is this ? This project is a part of a scientific research in machine learning, whose objective is to develop a system,
EET 450 Chapter 18 – Audio. Analog Audio Sound is analog Consists of air pressure that has a variety of characteristics  Frequencies  Amplitude (loudness)
1 Manipulating Digital Audio. 2 Digital Manipulation  Extremely powerful manipulation techniques  Cut and paste  Filtering  Frequency domain manipulation.
Binaural Sound Localization and Filtering By: Dan Hauer Advisor: Dr. Brian D. Huggins 6 December 2005.
Digital Audio Multimedia Systems (Module 1 Lesson 1)
Seminar on Sound Card Presented by:- Guided by:-
By Breanna Myers Ms. Williams-Grant 5 th Period Business Computer Applications
Digital Sound and Video Chapter 10, Exploring the Digital Domain.
Lab #8 Follow-Up: Sounds and Signals* * Figures from Kaplan, D. (2003) Introduction to Scientific Computation and Programming CLI Engineering.
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
COMP Representing Sound in a ComputerSound Course book - pages
Creating Successful PowerPoint Presentations Created by the Instructional Technology Center.
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.
Robotics Simulation (Skynet) Andrew Townsend Advisor: Professor Grant Braught.
Basics of Digital Audio Outline  Introduction  Digitization of Sound  MIDI: Musical Instrument Digital Interface.
CMPD273 Multimedia System Prepared by Nazrita Ibrahim © UNITEN2002 Multimedia System Characteristic Reference: F. Fluckiger: “Understanding networked multimedia,
Sound and audio. Table of Content 1.Introduction 2.Properties of sound 3.Characteristics of digital sound 4.Calculate audio data size 5.Benefits of using.
Multimedia Elements: Sound, Animation, and Video.
Overview of Multimedia A multimedia presentation might contain: –Text –Animation –Digital Sound Effects –Voices –Video Clips –Photographic Stills –Music.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
Panning and Filters © Allan C. Milne Abertay University v
Games Development Practices Sound Effects & OpenAL CO2301 Games Development 1 Week 15.
Rumsey Chapter 16 Day 3. Overview  Stereo = 2.0 (two discreet channels)  THREE-DIMENSIONAL, even though only two channels  Stereo listening is affected.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - VIDEO. In this chapter How digital video differs from conventional analog video How digital video differs from.
Inspire School of Arts and Science Jim White. What is Reverb? Reverb or ‘reverberation’ is not simply just an effect which makes vocals sound nice! It.
Summing Amplifier.
3-D Sound and Spatial Audio MUS_TECH 348. Main Types of Errors Front-back reversals Angle error Some Experimental Results Most front-back errors are front-to-back.
Sound element Week - 11.
Digital Sound Actual representation of sound Stored in form of thousands of individual numbers (called samples) Not device dependent Stored in bits.
JEG AUDIO Justin McDowell Edward Jones Greg Fagula – SoC FPGA Design Laboratory (Final Project)
Digital Recording. Digital recording is different from analog in that it doesn’t operate in a continuous way; it breaks a continuously varying waveform.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
Audioprocessor for Automobiles Using the TMS320C50 DSP Ted Subonj Presentation on SPRA302 CSE671 / Dr. S. Ganesan.
Super Pong Andrew S. Dunsmore CSC436 August 2004.
CSCI-100 Introduction to Computing Hardware Part II.
Microcomputer Systems Final Project “Speaker and Sound Modulation”
IntroductiontMyn1 Introduction MPEG, Moving Picture Experts Group was started in 1988 as a working group within ISO/IEC with the aim of defining standards.
Planar® DirectLight™ LED Video Wall System
CO5023 Introduction to Digital Circuits. What do we know so far? How to represent numbers (integers and floating point) in binary How to convert between.
MDO4000C Series vs. Regular Scope FFTs Competitive Fact Sheet Benefits: ~20dB better dynamic range than a scope FFT RF support.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Starting Out with Games & Graphics in C++ Tony Gaddis Chapter 8 The.
Editing Digital AudioLab#7 Audacity is a free, easy-to-use and an open source platform audio editor and recorder for Windows, Mac OS, Linux and other operating.
Dan Nichols Head of Recording Services Internet2 Multimedia Specialist Northern Illinois University Your TV IS TOO SLOW.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Final Design Review By: Alireza Veiseh Anh-Thu Thai Luai Abou-Emara Peter Tsang.
Chapter 2 PHYSICAL LAYER.
Sound Card A sound card (also referred to as an audio card) is a peripheral device that attaches to the ISA or PCI slot on a motherboard to enable the.
Sound Card A sound card (also referred to as an audio card) is a peripheral device that attaches to the ISA or PCI slot on a motherboard to enable the.
Multimedia: making it Work
Data analysis and modeling: the tools of the trade
Multimedia Systems and Applications
Digital Design.
Does Spatialized Audio Change Everything?
Recap In previous lessons we have looked at how numbers can be stored as binary. We have also seen how images are stored as binary. This lesson we are.
♪ Embedded System Design: Synthesizing Music Using Programmable Logic
Presentation transcript:

Implementing 3D Digital Sound In “Virtual Table Tennis” By Alexander Stevenson

Introduction For our term project, Arthur Louie, Adrian Secord, Matthew Brown and I decided to produce a program capable of simulating and playing a virtual game of table tennis. “Virtual Table Tennis” is the result.

Introduction – What is VTT? Virtual Table Tennis incorporates physics simulation, AI solving, real-time graphical display, and a flexible input scheme (allowing several different devices, including a Fastrak, to control the paddles). Virtual Table Tennis allows either a player to face off against the computer, or for the computer to play against itself.

Introduction – VTT in Action

Introduction This talk however, will ignore all that. Instead we will focus on the topic of digital 3D positional sound, and how it is implemented in Virtual Table Tennis.

Overview  Our approach How digital sound works How we hear Computing the direction of the sound Results

Our Approach In deciding on how to produce sound for this project, we had several options. We decided on a sampled/playback approach to sound, as opposed to a fully simulated approach. This is because we had a narrow range of sounds to produce, easily captured by samples, and because we wished to devote most compute time to physics/AI.

Our Approach Further, we were implementing in C/C++ on a Linux platform. This precluded easy integration of some existing Java simulation packages. It was therefore decided that the best route was a module capable of mixing samples, and modulating them according to the virtual position of the sound they were simulating.

Overview Our approach  How digital sound works How we hear Computing the direction of the sound Results

Digital Sound – Sampling As with any digital representation of an analog signal, digital sound consists of evenly spaced samples of a sound wave.

Digital Sound – Sampling The frequency with which we sample determines the range of frequencies we can reproduce. (Nyquist rate) The number of bits with which we sample determines the dynamic range we can reproduce

Digital Sound - Sampling Our goal is CD quality sound. This means Hz, and 16 bit samples. At this rate, one second of stereo audio requires 2 x x 2 = bytes While this doesn’t seem computationally excessive, we must keep in mind that many sounds may be playing at once, and so our overhead for mixing/playback increases

Digital Sound – Playback Our program must play sound continuously (2 samples every 2.27e-5 seconds) But we also need to draw graphics, simulate physics, calculate AI, etc… Even putting sound in another thread does not let us achieve this.

Digital Sound – Playback Solution: DMA (Direct Memory Access) – By preloading a buffer with sound information, we can have the sound card play it back automatically while we process other things (graphics, physics, input, AI, etc.) – Then, while we are off processing other things, the sound card continues to play sound. When we return from processing, we refill the buffer, and continue.

Digital Sound – Lag vs. Skipping The response of the system becomes very dependent on the size of the sound buffer. Large buffers result in a greater buffer against long processing times, but also mean that more data must be played before a new event can be heard. A size of 4096 bytes produces a lag of seconds, which is acceptable for our frame rates. (> 45 fps)

Overview Our approach How digital sound works  How we hear Computing the direction of the sound Results

How We Hear We have ears! Ideally two of them. This lets us position sounds in space by comparing the relative volumes we hear in each ear, as well as the timing difference a sound takes to get from one ear to the other. For an inter-aural distance of 15cm, this time is as much as (0.15m)/(344m/s)=4.36e-4 seconds. This is around 38 (mono) samples!

How We Hear Of course, how this actually sounds ends up depending on a user’s speaker placement, which is rarely ideal. Therefore, we’ll ignore the timing differences between ears, and focus solely on the volume differences.

Overview Our approach How digital sound works How we hear  Computing the direction of the sound Results

Computing the sound’s direction Given a head location, H(x,y,z), a look-at point L(x,y,z), and a sound origin S(x,y,z), we need to figure out where to place the sound in stereo. Keeping in mind the speakers are in front of us, we would like to put a sound which is 90 degrees to our right, entirely in the right speaker, and 90 degrees to our left in the left speaker.

Computing the Sound’s Direction First, we will make the simplifying assumption that our head is vertical. That is, that our up vector is (0,0,1). This means we need only consider angles in the X-Y plane. Thus H(x,y,z), S(x,y,z), L(x,y,z) become H(x,y), S(x,y), L(x,y).

Computing the Sound’s Direction Now, translate everything by –H(x,y). This centers things at the origin, and we end up with the following: Y X L(x,y) S(x,y)

Computing the Sound’s Direction We now need to determine how far the sound is panned. To do this, we compute the angle between the vector L(x,y) and S(x,y). This narrows the sound down to two locations: L(x,y) S(x,y) θθ

Computing the Sound’s Direction Now, if θ is > 90, then we set θ=180 – θ. This allows us to treat situations where the sound is in front or behind us the same.

Computing the Sound’s Direction Finally, to figure out whether the sound is to our left or to our right, we compute the angle between S(x,y) and L(y,-x): L(x,y) S(x,y) θ2 L(y,-x) If θ2 < 90 then the sound is on our right, otherwise it is on our left.

Computing the Sound’s Direction Now that we know how many degrees, and to which side, the sound is positioned, we can adjust the panning of the sound appropriately, and mix this sound into our play buffer.

Overview Our approach How digital sound works How we hear Computing the direction of the sound  Results

Results – Features Virtual Table Tennis has a flexible sound module which supports mixing of multiple streams of digital audio, all with independent stereo positions. Further, the panning of each sound is dynamically updated as the camera moves, even if the sound is still playing. This is because mixing is done only one buffer at a time.

Results – Features You can also specify that a sound has no position, allowing things like background music, or referee voices, to simply play center- panned over the speakers.

Results – Performance Our 3D positional audio mixer performs very well. – It uses only 3 integer operations per sample, (multiply and shift to set volume, and then an addition to mix the sound into the buffer) – We can successfully mix > 8 continuous streams on an Athlon 850 MHz CPU. – It sounds great!

Future Work Things we have not added are scaling ball collision volume in proportion to the velocity of the impact, and delaying the samples between the speakers to simulate the inter-aural lag. These might add subtly, but are not critical.

The End!