I have 4ch Spatial Audio (Ambisonic) WAV file and I want to calculate sound source position and put it on 2D plane.
What I know so far is the following:
WAV file consists of signals that support of 360 video playback
- Channel 1 = omnidirectional sphere (named W: $w(t) = p(t)$)
- Channel 2 = left-right dipole (named Y: $y(t) = \sqrt{2}p(t)\sin(a)\cos(b)$)
- Channel 3 - has no data
- Channel 4 = front-back dipole (named X: $x(t) = \sqrt{2}p(t)\cos(a)\cos(b)$)
How to calculate sound source position at any point of time using these data?
Edit:
calculation like this gives mess:
theta = Math.Atan2(y, x);
px = r * Math.Cos(theta);
py = r * Math.Sin(theta);
Edit 2:
So imagine we have Spatial Audio/Ambisonic/B-Format WAV file and we need to draw/visualize a microphone in the center of screen and a sound source around the microphone at any time reading WAV file
Edit 3:
We use H2n SPATIAL AUDIO mode that gives 1 WAV file with 4 Channel Using the suggested wiki-formula here is our result for first 1000 ticks using MatLab (does not look proper):