39
Physics and Sound Zhimin & Dave

Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Embed Size (px)

Citation preview

Page 1: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Physics and Sound

Zhimin & Dave

Page 2: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Motivation

• Physical simulation

• Games

• Movies

• Special effects

Page 3: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

What is done now?

• Foley artist

Lucasfilm Foley Artist

Page 4: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Vibration Pressure Wave Perception

How sound works

• Transverse waves

• Doppler effect

Page 5: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Why sound rendering is hard

• Very small time step

• Ideally 44.1kHz

• Small time step at lest 10-6

• Stability

Page 6: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering

• Method for synchronized soundtracks and animations

• Sound scripts

• Sound rendering pipeline

• Key framing audio, Approximate refraction, Different models for sound generation, etc.

Page 7: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering

• Sound rendering definition– The process of creating a composite sound

track from component sound objects

• Sound scripts– Control sound instantiation and

modification• User specified• From system, ex. simulation, periodic, etc.

Page 8: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering Pipeline

Vibrational Analysis

Instantiate Sound

Propagation Resample

Modeling

Rendering

Page 9: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Vibrational Analysis

• Generate prototype sound, characteristic of each object and interaction with other objects

• Physically Based– FEM, Natural vibration modes,

Approximation

• Friction and Turbulence• Procedural Sounds (what they used)

Page 10: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Instantiate Sound

• Prototype sound instantiate

• Attach to some 3D object

• Start energy of sound wave

• Use of sound scripts

Page 11: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Propagate

• Physical Simulation

• Beam tracing

• Frustum tracing

• Refraction

• Effects - reverberation, refraction

Page 12: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Resampling

• Sound prototype to sound track– Sound at time steps (key-frame audio)

• Amplitude - linear interpolation• Frequency - high order approximation or very dense

sampling

• Like texture mapping– Object space algorithm– Image space algorithm– Warning: aliasing problems similar to texture

mapping, solved similar methods

Page 13: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering Demo

Page 14: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering Pipeline

Vibrational Analysis

Instantiate Sound

Propagation Resample

Modeling

Rendering

DeformablebodySimulation

Page 15: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Deformable objects

• Piggy back on top of deformable body simulator

• Use audible vibrational component of simulation

• Generate sound pressure and model sound propagation

Page 16: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Requirements

• Temporal resolution higher then 10-5

• Dynamic deformation– FEM– mass spring

• Explicit Surface Representation• Physical Realism, if not

– sounds will reveal errors in motion– strange sound responses

Page 17: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Modeling surface vibration

• I will put the details of this here (commming soon)

Page 18: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Deformable objects Demo

Page 19: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering Pipeline

Vibrational Analysis

Instantiate Sound

Propagation Resample

Modeling

Rendering

PhysicalShapes

Page 20: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

NOTE to Ming

• Some of the slides on Sound of Physical Shapes I am going to replace with an example using a Circular membrane, since I have pictures that it may be more clear.

Page 21: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

The Sound of Physical Shapes

•Sounds of physical shapes are important for enhance realism

•Sounds produced by colliding objects depend on object material, shape and the location of contact.•Sounds provide listeners with clues about the object.

Page 22: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

The framework

•Precompute characteristic frequencies

•Divide object boundary into small regions

•Determine the amplitudes of excitation for an impulse applied to a region

•Normalize energies energies, so only scaling is needed when rendering

Page 23: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Vibrating Shapes from Impact

•Calculating the Modes:•Vibration of the object obeys the wave equation:

•Initial conditions:

•Norm of the eigenfunctions:

2

2 2

1( ) ( , ) ( , )A x t F x t

C tμ∂

− =∂

0

0

( ,0) ( ),

( ,0)( ).

x y x

xv x

t

μμ

=∂

=∂

2 ( ) kn n

S

x d xα = Φ∫

Page 24: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

•Calculating the Modes:•Solution to the wave equation:

• are related to eigenvalues of That is

1

( , ) ( sin( ) cos( )) ( )n n n n nn

x t a ct b ct xη ω ω∞

=

= + Φ∑nω A

2 2( ) ( ) 0n nA xω+ Φ =

Vibrating Shapes from Impact

Page 25: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

•Calculating the Modes:•Calculating the amplitudes of the vibration modes

•Time averaged energy of the vibration •(if mass distributed uniformly)

0

0

( ) ( ),

( ) ( )

knn

n nS

knn

nS

v x xa d x

c

y x xb d x

α ω

α

Φ=

Φ=

2 2 2n

1

constant ( )n n nn

E a bα ω∞

=

= × +∑

Vibrating Shapes from Impact

Page 26: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

•Initial conditions:

• ,the k-dimensional Dirac delta function•The amplitudes are:

•The energy is:

0

0

( ) 0,

( ) ( ).

y x

v x x pδ== −

( )xδ

( ),

0.

nn

n n

n

pa

c

b

α ωΦ

=

=2

1

( )constant

fnn

n n

pE

α=

Φ= ×∑

Mode Amplitudes from Impact Location

Page 27: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

•Compute sound emitted from the vibration:•Intensity of the sound emitted:

It integrates the intensity of the vibration.

2 2( ) constant ( )n n n n

S

I E x p= Φ = ×Φ∫

Sound Sources from Vibrating Shapes

Page 28: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

•Each mode decays with decay time:

• is the internal friction parameter, which depends on material only.

•Having emulated the external damping of object, sound-wave:

1

taniif

τπ φ

=

φ

0/ tan

1

( ) sin(2 )f

i

nt tfS

s i ii

p t e a e f tτ π φ π− −

=

= ∑

Sounds and Material Properties

Page 29: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

•Store the pre-computed frequency spectrum

, and the excitation spectrum for a number of locations on the surface.

•Treat two sounds and as the same, if the

the difference between them ,

where is a threshold.

2n

i

cf

ωπ

= ia

1S 2S

1 2 0( , )d S S d<

0d

Sound Map

Page 30: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

http://www.cs.ubc.ca/spider/kvdoel/app6JavaSound/demo.html

Live Demo

Page 31: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound Rendering Pipeline

Vibrational Analysis

Instantiate Sound

Propagation Resample

Modeling

Rendering

RigidbodySimulation

Page 32: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Sound from Rigid body simulations

• Precompute shape and frequency of deformation modes– Result, quick computation of vibrational

response at runtime

• Numerically via eigen-decomposition of system of matrices from FEM model

• Model sound from geometric description and material paarameters

Page 33: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Modal Analysis

• Zhimin and I were planning on ommiting the calculation of the eigenvectors from this so she can speak about it in Nikunj’s paper, as it uses the same process.

Page 34: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Rigid body simulation

• Normal rigid body simulation – One change, export collision forces to

sound synthesizing process.

• One thing…– Sound synthesis can reveal flaws of bad

rigid body simulator

Page 35: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Deforming the model

• Need to be able to generate K, C and M

• Mass spring, FEM etc.

• FEM used, because of past success, see [OSG02] for details

Page 36: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

A Sound Generation Alg

• Details of the alg here

Page 37: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

How to speed up

• Eval 18 use previous values e^{\omega(t+s)} = e^{\omega*t} + e^{\omega*s}

Page 38: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Other effects

• Cost of additional impulses is low (analytical solution)

• Convolve with Gaussian kernel– Force for soft collisions– Noise for small scale friction

Page 39: Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects

Rigid body Demo