steering_vectors#
- sionna.phy.isac.steering_vectors(positions: torch.Tensor, theta: float | torch.Tensor, phi: float | torch.Tensor, wavelength: float | torch.Tensor, *, mode: str = 'cartesian', precision: Literal['single', 'double'] | None = None) torch.Tensor[source]#
Generate normalized steering vectors.
For an array with \(M\) antennas at positions \(\mathbf{d}_m\in\mathbb{R}^3\), this function computes the normalized steering vector \(\mathbf{a}(\theta,\varphi)\in\mathbb{C}^M\) with elements
\[a_m(\theta,\varphi) = \frac{1}{\sqrt{M}} \exp\left( j\frac{2\pi}{\lambda} \mathbf{d}_m^{\mathsf{T}} \widehat{\mathbf{r}}(\theta,\varphi) \right), \quad m=1,\dots,M,\]where \(\lambda\) is the carrier wavelength and
\[\begin{split}\widehat{\mathbf{r}}(\theta,\varphi) = \begin{bmatrix} \sin(\theta)\cos(\varphi)\\ \sin(\theta)\sin(\varphi)\\ \cos(\theta) \end{bmatrix}.\end{split}\]This is the array response used by the Sionna channel models, normalized to unit norm. Beamforming therefore conjugates it, as in
angular_delay_doppler_spectrum(), and the matched transmit precoder for direction \((\theta,\varphi)\) is \(\mathbf{a}(\theta,\varphi)^*\).- Parameters:
positions (torch.Tensor) – Antenna positions \(\mathbf{d}_m=(x,y,z)\) in meters, shape [num_ant, 3].
theta (float | torch.Tensor) – Zenith angles in radians. Values must lie in \([0,\pi]\).
phi (float | torch.Tensor) – Azimuth angles in radians. Values conventionally lie in \([-\pi,\pi]\), but any finite value is accepted because the steering vector is \(2\pi\)-periodic in \(\varphi\).
wavelength (float | torch.Tensor) – Scalar carrier wavelength in meters.
mode (str) – If
"cartesian", both inputs must be scalar or one-dimensional and all combinations are generated. If"paired",thetaandphiare broadcast and interpreted as angle pairs. Defaults to"cartesian".precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.
- Outputs:
a – […, num_ant], torch.complex. Unit-norm steering vectors. For Cartesian mode, the shape is always [num_theta, num_phi, num_ant], where scalar angles contribute an axis of length one. For paired mode, the shape is the broadcast shape of
thetaandphifollowed by [num_ant].
Notes
This function only models the phase shifts caused by antenna positions. Antenna patterns and polarization-dependent gains are not included. Co-located polarization components therefore receive identical phases.
Examples
import torch from sionna.phy.isac import steering_vectors positions = torch.tensor([[0., -0.025, 0.], [0., 0.025, 0.]]) # By default, all combinations of the two angles are generated theta = torch.tensor([torch.pi/3, torch.pi/2]) phi = torch.tensor([0., torch.pi/4, torch.pi/2]) w = steering_vectors(positions, theta, phi, wavelength=0.1) # w.shape = torch.Size([2, 3, 2]) # [num_theta, num_phi, num_ant] # Paired mode instead broadcasts the angles into direction pairs w = steering_vectors(positions, theta, phi[:2], wavelength=0.1, mode="paired") # w.shape = torch.Size([2, 2]) # [num_directions, num_ant]