Wednesday, April 18, 2012

Spatialization 01: Time - Part I v2

QUESTION 1
  •  Let S be an object at distances d1, d2  from microphones L and R, at angle Θ with respect to a reference line, at azimuthal angle Φ, and facing θ', φ' (local orientation).  
    Let L', R' be a pair of stereo speakers, and O' the listener.
    Let  f(t) = ( x(t),  y(t),  z(t) )    be an arbitrary, vector-valued space curve.

    How can the recording be manipulated so that, when broadcast from L' and R', the apparent location and orientation of S relative to the listener follow the directed path f(t)? 
____________________________
In signal processing, to align elements in space, we must manipulate time.   So I need to solve the relationships with respect to time.  We have:

                               Recording:   E           Playback:
                        Microphones   L, R         d         Speakers    L', R'
                        Listener          O' (implied)     i        Listener      O
                        Source            S    t        Source       S'   (implied)  

I changed the table to reflect the proper relationship between Source and Listener:  The relationship is essential:
 At any one time either the Listener or the Source is virtual.
     -When recording, the Source is real, the Listener is virtual.
     -At playback, the Source is virtual, the Listener real.


Solution, Part I
The general solution in three dimensions can be given directly, in Vector Calculus.
Fig. 1 - Arbitrary Path in Space


Let f(t) be a directed path in 3-dimensional space:

For each value of t there is a corresponding position vector S (shown in blue),


The tangent vector at any point (shown for S in turquoise) follows the usual definition of the derivative, evaluated componentwise:


The normalized (unit) tangent vector:


Where


The source may move at arbitrary speeds along its path; it may change direction.  I would also like to know distance traveled along the path, and relate it to time.  The arc length of the curve is given by:

 In Fig. 1, the integral would be over the interval ≤ t ≤ d.  
Lowercase s is the usual letter to denote arc length.  This is not the position vector S, which gives the x, y, z coordinates of the Source at any point along the curve.  The difference should be clear from context.  I will always write the position vector in bold.

Differentiating (6) gives the differential of arc length, called the arc 'element', ds:


By (5),  ds = |f'(t)| is always positive, so the integral s is nondecreasing.  This makes sense; as the total distance traveled, s increases whenever the object moves, even if the curve doubles back on itself.  (A good Odometer is an arc length function: It's 250 miles from Seattle to Ashland, even if I drive in reverse.)   As a continuous, nondecreasing function,  s has a unique inverse.  That is, we can give time t as function of distance s.

I find this tricky, so I break it down into five steps:
   ■ Differentiate f(t):  find f'(t),  tct ≤ td
   ■ Calculate |f'(t)|  
   ■ Integrate the arc length using (6)
   ■ This will give s as a function of t.   Now solve for t.  The result will be a function t(s).
   ■ Substitute this value of t back into f(t), turning it into a function of s.  Don't forget the bounds:


Note that g(s) gives the position of the Source as a function of distance traveled (arc length).  Time is no longer part of the equation.  Also note that the form is coordinate-system agnostic.

Because the unit measure of  g(s) is distance, its derivative is the unit tangent vector T in (4):


From here a navigation system for arbitrary changes of orientation in space can be defined.  However, the next step for this problem is to assemble the information presented, and clean up the mess left from section I. The equal-time-curves are important, and need to be presented clearly.

For now, I will leave off by giving the relationship between S, R and L:
L + A = S
R + B = S

Whew! That's better.  It's like a little advertisement for vectors.
Pointy hat-people! O hats. The sums of your motion in space;  bliss.

No comments:

Post a Comment