Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

53
Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    1

Transcript of Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Page 1: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics

Thomas Wolfe

Page 2: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Introduction

Page 3: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Presentation Itinerary

Goals Motivation Reverberation Smoothed Particle Hydrodynamics New Algorithms Implementation Results Possible Future Work Conclusion

Page 4: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Goals of the Research

Is SPH is a viable method for simulation of sound waves?

Can we accurately simulate complex environments for the sound to interact with?

Is SPH robust enough to allow materials with different acoustic response properties?

Page 5: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Motivation

Create reverberation effects for music.

Expose strengths and weaknesses of SPH as an acoustic modeling platform.

Acoustic modeling Music industry Architecture Engineering Auto and marine industries

Page 6: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Reverberation

Page 7: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

What Is Reverberation?

Natural property of enclosed spaces. Sound continues to echo after source has

been removed. Sound reflects off of walls, floors and other

obstacles. These reflections are called reverberation of

the original sound.

Page 8: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Previous Reverberation Methods(physical) Chamber

Uses real reverberation chamber (such as room or hall) to capture a sound with its echoes.

Plate Metal plate that resonates according to a sound source and

is picked up via an electromagnetic transducer on the plate. Spring

Resonance in the spring induced by the transducer is recorded at the other end by a transducer.

Page 9: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Previous Reverberation Methods(other) DSP

Copies original sound source many times and adds the result back into the original sound.

Sound Tracing Adaptation of existing ray-tracing methods. Traces a “beam of sound” from the listener back

through reflections and then back to the sound source.

Page 10: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

SPH as a Possible Solution

Limitations of previous methods Physical methods are expensive and time-consuming to set

up properly. DSP methods are fast, but not accurate. Sound tracing methods only deal well with static, simple

environments. SPH can be used as DSP methods are now. SPH has the potential to be more accurate than

DSP methods. SPH can handle complex, dynamic environments.

Page 11: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Smoothed Particle Hydrodynamics

Page 12: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Smoothed Particle Hydrodynamics Lagrangian CFD method First used for astrophysics simulation in 1977 General enough for astrophysics, fluid

dynamics and deformable bodies Uses probability distribution to determine field

values Derivatives only apply to kernel

Page 13: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Smoothing Kernels

Probability function for the SPH summation Must satisfy the following constraints:

1, 3 rdhW rr

rrrr

hWh

,lim0

and

Page 14: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Monaghan’s B-spline kernel

2q if ,0

21 if ,24

1

10 if ,4

3

2

31

1, 3

32

3spline-B qq

qqq

hhW

r

Page 15: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Monaghan’s B-spline kernel

0.5 1 1.5 2

0.1

0.2

0.3

0.4

Page 16: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Desbrun’s “Spiky” kernel

otherwise ,0

0 if ,-15,

3

6spiky

hrrh

hhW

r

Page 17: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Desbrun’s “spiky” kernel

0.2 0.4 0.6 0.8 1

2

4

6

8

10

12

14

Page 18: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Müller’s Viscosity kernel

otherwise ,0

0 if ,1222

15, 2

2

3

3

3viscosityhr

r

h

h

r

h

r

hhW

r

Page 19: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Müller’s Viscosity kernel

0.2 0.4 0.6 0.8 1

5

10

15

20

25

Page 20: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Determining Field Values in SPH(continuous to discrete) A smoothed average is calculated by:

rdhWfff 3,rrrrr

For discrete particles:

hWm

ff j

N

j j

jj ,

1

rrr

Page 21: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Determining Field Values in SPH(gradient and Laplacian) The gradient of a field variable:

And similarly, the Laplacian:

hWm

ffN

j j

jj ,

1

rrr

hWm

ffN

j j

jj ,

1

22 rrr

Page 22: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

SPH Versions of the Equations of Motion (Density)

Density must be calculated at every time step:

hWm ji

N

jji ,

1

rr

Page 23: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

SPH Versions of the Equations of Motion (Pressure and Viscosity) Force due to pressure gradient:

hWPP

m ji

N

j j

jiji ,

21

pressure rrF

n

jji

j

ijji hW

km

1viscosity

2 ,viscosity rrv

F

Force due to viscosity:

Page 24: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Equation of State

Used to calculate pressure Ideal Gas Equation

nRTPV

kP Keeping temperature constant:

where k is a constant depending on the gas (78120.9 J/kg at 273.15 K for air).

Page 25: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Boundary Treatment(force field) At each timestep, for each particle/boundary

pair, add a force to the particle using:

where ks is the stiffness coefficient, kd is the dampening coefficient and x is the distance from the fluid particle to the boundary.

nnvnF ds kxkcol

Page 26: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Boundary Treatment(virtual particles) Boundaries are comprised of virtual fluid

particles. Virtual particles do not move with the fluid or

evolve parameters such as density. VPs exert a force on fluid particles according

to Lennard-Jones potential (simple mathematical model that includes a van Der Waal’s attractive force at long ranges and a Pauli repulsion force at short ranges).

Page 27: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Boundary Treatment(Lennard-Jones potential) In SPH, the Lennard-Jones potential is

represented by:

where n1 and n2 are 12 and 6, respectively, D is taken as the square of the largest velocity and r0 is the cutoff distance.

1 if , 0

1 if ,

0

02

00

21

ij

ijij

ij

n

ij

n

ijij

r

r

r

r

rr

r

r

rD

PB

x

Page 28: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

New Algorithms

Page 29: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Equilibrium

System runs with no acoustic input until kinetic energy is below a certain threshold (L is 0.00001 J):

LvmEn

iii

1

2system 2

1

After equilibrium is reached, the emitter and receiver are engaged.

Page 30: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Sound Emitter

Acts as a boundary to the fluid. Allowed to move according to an input sound

file. The movement from DC is computed

according to:

tt ksxx rest

where st is the input sample at time t and k is the deflection factor.

Page 31: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Sound Receiver

Captures density fluctuations caused by sound waves propagating through the fluid.

When simulation first reaches equilibrium, the receiver computes its reference density.

The density deflection from reference is computed and stored as an audio sample according to:

tts 0

Page 32: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Implementation

Page 33: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Implementation

Original idea was realtime reverb effects processing.

C++ and OpenGL were chosen for speed and visualization.

Part of system code was taken from previous SPH water simulation created for the Computer Animation and Scientific Visualization course in Spring 2005.

Page 34: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class Hierarchycd Class Model

SPHSimulator

SPHKernel

SPHKernelPoly6 SPHKernelSpikySPHKernelViscosity

SPHParticle

SPHBoundary

SPHCylinderBoundary SPHDiscBoundarySPHRectangleBoundary

SPHGrid SPHGridCell

SPHSoundReceiv er

SPHSoundEmitter

Camera

WAVFile

Page 35: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class SPHSimulator

Main program class Manages ALL SPH-related objects in the

simulation. Provides the following methods:

Load() – Load a new scene file StepSimulation() – Progress the simulation one

time step and render the results both to the screen and to the output sound file.

Page 36: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

SPHSimulator::StepSimulation()1. For each particle, assign neighboring particles to neighbor list.2. For each particle, compute its density.3. For each particle, compute its pressure.4. For each particle, compute the force acting on the particle due

the pressure gradient and the viscosity.5. For each particle, compute the force acting on the particle due

to the boundary forces (either using the Lennard-Jones potential or the boundary force equation).

6. Integrate the equations of motion to find the new velocity and position.

7. For each sound emitter, read the next sample in the input WAV file and move the emitter accordingly.

8. For each sound receiver, compute the deflection from the reference density and store it as a sample in an output WAV file.

Page 37: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class SPHParticle

Stores a single particle’s state: Density (kg/m3) Mass (kg) Pressure (Pa) Fluid viscosity constant Position vector (m) Velocity vector (m/s) Acceleration vector (m/s2) List of neighboring particles

Page 38: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class SPHKernel & Derivatives SPHKernel is an abstract class that exposes

the following methods: W() – Kernel dW() – Kernel derivative lap() – Kernel Laplacian

3 kernels are currently implemented: Monaghan’s B-spline for density Desbrun’s “spiky” kernel for pressure gradient Müeller’s viscosity kernel

Page 39: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Classes SPHGrid and SPHGridCell Used to find neighboring particles for a given

particle. SPH kernels have compact support, so any

potential neighboring particles beyond a distance of h from the current particle can be ruled out as neighbors.

The grid is divided into cells of length h and a nearest neighbor search is performed for each particle.

Page 40: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

SPHGrid::AssignNeighbors()

1. For each SPHGridCell in SPHGrid, clear the particle list.

2. For each particle i,a) Clear the neighbor list.

b) Add i to the neighbor list (i is its own neighbor).

c) Search the cell adjacent to the cell containing i for neighbors.

d) A particle j in an adjacent cell is considered a neighbor of i only if the distance from i to j < h. If j is a neighbor of i, add a reference to j to i’s neighbor list

e) Add a reference to i to the current cell’s contents.

Page 41: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class SPHBoundary & Derivatives Encapsulates a boundary (wall, floor,

obstacle). Base class has position and orientation. Subclassing SPHBoundary allows for

different shapes and/or collision detection and response algorithms.

Page 42: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class SPHSoundEmitter

Derived from one of the SPHBoundary concrete classes.

A configured maximum deflection allows for amplitude control of the output sound file.

At each time step, the emitter reads the next sample in the input sound file and moves itself along its local x-axis accordingly.

Page 43: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class SPHSoundReceiver

Computes reference density at its local origin when equilibrium is first reached.

At each time step, the density is again computed and the deflection from its reference density is stored as an output sound sample.

The deflections are initially stored as double-precision floating point numbers from -1 to 1.

When stored in the WAV file, they are converted to 16-bit signed integers.

Page 44: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class WAVFile

Stores the contents of a WAV audio file in memory.

Allows for random and sequential access to the audio sample data.

Page 45: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Class Camera

Used to visualize the particle system. Allows the viewer to pan and rotate in all

three dimensions.

Page 46: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Results

Page 47: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Simulation Test Run Setup

The runs are set up as scene files with user-definable parameters.

Using scene files allows the simulation results to be compared on a change-by-change basis to determine the best parameters for the system.

Most of the simulation parameters are exposed, including: Timestep Fluid parameters (number, initial volume, mass, viscosity,

stiffness). Boundary parameters (shape, size, orientation and collision

response algorithm). Emitter and receiver parameters (input and output sound

filenames and emitter deflection constant).

Page 48: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Simulation Results

Audio Results

Movie 1 (boundary force)

Movie 2 (virtual particles)

Page 49: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Future Work

Page 50: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Future Work

Improve the reverberation accuracy. Equation of state Thermal energy Smoothing kernels

Acoustic Modeling Building design Auto, aircraft and marine Music production

Page 51: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Conclusion

Page 52: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Conclusion

History of reverberation modeling. History and theory of Smoothed Particle

Hydrodynamics. Pointed out a lack of a general solution to acoustic

modeling of reverberation. Using SPH, we created new algorithms for acoustic

modeling. Results show promise, but more research must be

done before it can be considered a replacement for current techniques.

We DID get results!

Page 53: Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics Thomas Wolfe.

Acoustic Modeling of Reverberation using Smoothed Particle Hydrodynamics

Thomas Wolfe