# Steering vector for beamforming in 3D

I am trying to implement a steering vector in 3D for beamforming. Let $$A\in \mathbb{R}^{M\times 3}$$ be a matrix containing the $$(x,y,z)$$ coordinates for $$M$$ sensors and the impinging source direction of arrival (DOA) is $$\Theta = (\varphi,\theta)$$, inclination and azimuth respectively. I am following the example from a 2D implementation (line 27). And I am not sure about my implementation.

I first convert the DOA to $$(x,y,z)$$ coordinates by: $$z_{DOA}=\cos(\varphi)$$ $$y_{DOA}=\sin(\varphi)\sin(\theta)$$ $$x_{DOA}=\sin(\varphi)\cos(\theta)$$ Then I project the microphones on that DOA by a dot product (once), and build the steering vector for each frequency $$d(f)$$: $$P=A\cdot\left[\begin{matrix}x_{DOA} \\y_{DOA} \\z_{DOA}\end{matrix}\right]\in \mathbb{R}^{M\times 1}$$ $$d(f) = e^{\frac{-2\pi jf\cdot P}{c}}\in \mathbb{R}^{M\times 1}$$ Where $$P$$ is the projection, $$C$$ is the speed of sound and $$j=\sqrt{-1}$$. This corresponds to lines 42-36 in the original implementatino.

Note that I have replaced the loop over microphones and the dot multiplication operation in a matrix-vector multiplication.

I can see three points that I cannot understand here:

• Why did the author "flip" the DOA by multiplying with $$-1$$ (line 31)? How does that correspond with my implementation?
• Why do I need to get the hermit of this vector (line 37)? Is that not enough for a steering vector?
• Must I normalize (line 38)? what is the implication of not normalizing? Is that a frequency-wise normalization or a spatial (microphone-wise) normalization?
• Is there any way to visualize the steering vector and see that it is correct? If so, what should I expect to see?

This is my implementation. Kindly, remark if neede:

def sph_2_cart(self,azi,inc):
r=1
z = r * np.cos(inc)
rcosinc = r * np.sin(inc)
x = rcosinc * np.cos(azi)
y = rcosinc * np.sin(azi)
return np.array([x,y,z])

def get_steering_vector(self,direction):
d = np.ones((len(self._f),self._microphones.shape[0]),dtype =np.complex64)
projection = np.dot(self._microphones,direction.T)
for i,f in enumerate(self._f):
d[i,:] = np.exp( (-2j)*np.pi*f*projection/self._c)
return d

direction=sph_2_cart(azi,inc)
steering_vec = get_steering_vector(direction)