Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct DOA Rotation #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jun 9, 2024

  1. Correct DOA Rotation

    Reasoning
    ---------
    
    Let
    r: DOA in room coordinates
    h: DOA in head coordinates
    Z: Rotation Matrix around z-axis with azimuth angle of head
    Y: Rotation Matrix around y-axis with elevation angle of head
    
    We start with the fact that the DOA in head coordinates can be forward
    transformed to the room coordinates by
    r = ZYh
    because the z-direction must only depend on elevation (Y) and not on
    azimuth (Z). Since the matrix Z does not touch the z-component, this
    order ensures that.
    
    Invert the formula by multiplying from the left by Y^(-1)Z^(-1):
    h = Y^(-1)Z^(-1)r,
    yielding the now implemented formula.
    
    Note that the inverse rotation matrix is either the transpose or the
    rotation matrix with the negative angle. The negative angle variant is
    now implemented.
    
    Example
    -------
    
    Imagine a auralizing a source straight above the listener, i.e. at 90°
    elevation. The listener is looking upwards 45° and and 90° to the left.
    
    By intuition, the source should be heard from the front at 45° upwards
    elevation.
    
    Imagine first rotating around the y-axis by -45° (downwards), then
    around the z-axis by -90° (right). This is wrong, as you would hear the
    source from the right instead of the front.
    
    Instead, imagine first rotating around the y-axis by -90° (right), then
    the y-axis by -45° (downwards). In the first step, the location of the
    source is not changed at all, then it is moved to the front. This is
    as expected.
    Firionus committed Jun 9, 2024
    Configuration menu
    Copy the full SHA
    97513ca View commit details
    Browse the repository at this point in the history