Beamforming Module#

The beamforming module provides amplitude tapering functions for sidelobe control, null steering for interference rejection, and multi-beam synthesis.

Amplitude Tapers (1D)#

phased_array.taylor_taper_1d(n, sidelobe_dB=-30.0, nbar=4)[source]#

Generate 1D Taylor window for sidelobe control.

Parameters:
  • n (int) – Number of elements

  • sidelobe_dB (float) – Desired peak sidelobe level in dB (negative)

  • nbar (int) – Number of nearly equal-level sidelobes

Returns:

taper – Amplitude taper weights (n,)

Return type:

ndarray

phased_array.chebyshev_taper_1d(n, sidelobe_dB=-30.0)[source]#

Generate 1D Dolph-Chebyshev window for equi-ripple sidelobes.

Parameters:
  • n (int) – Number of elements

  • sidelobe_dB (float) – Desired sidelobe level in dB (negative)

Returns:

taper – Amplitude taper weights

Return type:

ndarray

phased_array.hamming_taper_1d(n)[source]#

Generate 1D Hamming window.

phased_array.hanning_taper_1d(n)[source]#

Generate 1D Hanning (Hann) window.

phased_array.cosine_taper_1d(n)[source]#

Generate 1D cosine (sine) window.

phased_array.cosine_on_pedestal_taper_1d(n, pedestal=0.1)[source]#

Generate 1D cosine-on-pedestal window.

Parameters:
  • n (int) – Number of elements

  • pedestal (float) – Minimum amplitude at edges (0 to 1)

Returns:

taper – Amplitude taper

Return type:

ndarray

phased_array.gaussian_taper_1d(n, sigma=0.4)[source]#

Generate 1D Gaussian window.

Parameters:
  • n (int) – Number of elements

  • sigma (float) – Standard deviation as fraction of array (typical: 0.3-0.5)

Returns:

taper

Return type:

ndarray

Amplitude Tapers (2D)#

phased_array.taylor_taper_2d(Nx, Ny, sidelobe_dB=-30.0, nbar=4)[source]#

Generate 2D Taylor window (separable product).

Parameters:
  • Nx (int) – Number of elements in x and y

  • Ny (int) – Number of elements in x and y

  • sidelobe_dB (float) – Desired peak sidelobe level in dB

  • nbar (int) – Number of nearly equal-level sidelobes

Returns:

taper – 2D amplitude taper (Nx, Ny), flattened row-major

Return type:

ndarray

Examples

Apply Taylor taper for -30 dB sidelobes:

>>> import phased_array as pa
>>> taper = pa.taylor_taper_2d(16, 16, sidelobe_dB=-30)
>>> taper.shape
(256,)

Combine with steering weights:

>>> geom = pa.create_rectangular_array(16, 16, dx=0.5, dy=0.5)
>>> k = pa.wavelength_to_k(1.0)
>>> weights = pa.steering_vector(k, geom.x, geom.y, theta0_deg=30, phi0_deg=0)
>>> weights_tapered = weights * pa.taylor_taper_2d(16, 16, sidelobe_dB=-35)

Compare taper efficiency:

>>> taper = pa.taylor_taper_2d(16, 16, sidelobe_dB=-40)
>>> efficiency = pa.compute_taper_efficiency(taper)
>>> efficiency < 1.0  # Tapering reduces efficiency
True
phased_array.chebyshev_taper_2d(Nx, Ny, sidelobe_dB=-30.0)[source]#

Generate 2D Chebyshev window (separable product).

Parameters:
  • Nx (int) – Number of elements

  • Ny (int) – Number of elements

  • sidelobe_dB (float) – Desired sidelobe level in dB

Returns:

taper – 2D taper, flattened

Return type:

ndarray

phased_array.hamming_taper_2d(Nx, Ny)[source]#

Generate 2D Hamming window.

phased_array.hanning_taper_2d(Nx, Ny)[source]#

Generate 2D Hanning window.

phased_array.cosine_taper_2d(Nx, Ny)[source]#

Generate 2D cosine window.

phased_array.cosine_on_pedestal_taper_2d(Nx, Ny, pedestal=0.1)[source]#

Generate 2D cosine-on-pedestal window.

phased_array.gaussian_taper_2d(Nx, Ny, sigma=0.4)[source]#

Generate 2D Gaussian window.

Taper Analysis#

phased_array.compute_taper_efficiency(taper)[source]#

Compute aperture efficiency for a taper.

Efficiency = (sum of weights)^2 / (N * sum of weights^2) Uniform illumination gives 100% efficiency.

Parameters:

taper (ndarray) – Amplitude taper weights

Returns:

efficiency – Aperture efficiency (0 to 1)

Return type:

float

phased_array.compute_taper_directivity_loss(taper)[source]#

Compute directivity loss due to tapering in dB.

Parameters:

taper (ndarray) – Amplitude taper weights

Returns:

loss_dB – Directivity loss relative to uniform illumination (negative or zero)

Return type:

float

phased_array.apply_taper_to_geometry(geometry, taper_func='taylor', Nx=None, Ny=None, **taper_kwargs)[source]#

Apply an amplitude taper based on element positions.

For non-rectangular arrays, uses radial distance from center.

Parameters:
  • geometry (ArrayGeometry) – Array geometry

  • taper_func (str) – ‘taylor’, ‘chebyshev’, ‘hamming’, ‘hanning’, ‘gaussian’, ‘cosine’

  • Nx (int, optional) – For rectangular arrays, specify dimensions

  • Ny (int, optional) – For rectangular arrays, specify dimensions

  • **taper_kwargs – Additional arguments for the taper function

Returns:

taper – Amplitude weights for each element

Return type:

ndarray

Null Steering#

phased_array.null_steering_projection(geometry, k, theta_main_deg, phi_main_deg, null_directions, initial_weights=None)[source]#

Compute weights with nulls using orthogonal projection.

Projects the desired weight vector onto the null-space of the steering vectors for the null directions.

Parameters:
  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • theta_main_deg (float) – Main beam theta in degrees

  • phi_main_deg (float) – Main beam phi in degrees

  • null_directions (list of (theta_deg, phi_deg) tuples) – Directions for placing nulls

  • initial_weights (ndarray, optional) – Starting weights (default: uniform with steering)

Returns:

weights – Complex weights with nulls placed

Return type:

ndarray

Examples

Place nulls at specific interference directions:

>>> import numpy as np
>>> import phased_array as pa
>>> geom = pa.create_rectangular_array(16, 16, dx=0.5, dy=0.5)
>>> k = pa.wavelength_to_k(1.0)
>>> # Main beam at 30 deg, nulls at 45 and 60 degrees
>>> null_dirs = [(45, 0), (60, 0)]
>>> weights = pa.null_steering_projection(
...     geom, k, theta_main_deg=30, phi_main_deg=0,
...     null_directions=null_dirs
... )
>>> weights.shape
(256,)

Verify null depth:

>>> null_depth = pa.compute_null_depth(geom, k, weights, null_dirs[0])
>>> null_depth < -30  # Deep null achieved
True
phased_array.null_steering_lcmv(geometry, k, constraints, noise_covariance=None)[source]#

LCMV (Linearly Constrained Minimum Variance) beamformer.

Minimizes output power subject to linear constraints on response in specified directions.

Parameters:
  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • constraints (list of (theta_deg, phi_deg, response) tuples) – Each constraint specifies (direction, desired complex response) Use response=1+0j for unity gain, response=0 for null

  • noise_covariance (ndarray, optional) – N x N noise covariance matrix (default: identity)

Returns:

weights – Complex LCMV weights

Return type:

ndarray

phased_array.compute_null_depth(weights, geometry, k, theta_deg, phi_deg, theta_main_deg, phi_main_deg)[source]#

Compute null depth relative to main beam in dB.

Parameters:
  • weights (ndarray) – Array weights

  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • theta_deg (float) – Null direction

  • phi_deg (float) – Null direction

  • theta_main_deg (float) – Main beam direction

  • phi_main_deg (float) – Main beam direction

Returns:

depth_dB – Null depth (negative, lower is deeper)

Return type:

float

Multi-Beam Synthesis#

phased_array.multi_beam_weights_superposition(geometry, k, beam_directions, amplitudes=None, tapers=None)[source]#

Compute weights for multiple simultaneous beams via superposition.

The weights are a weighted sum of individual steering vectors. This creates multiple beams but with reduced gain per beam.

Parameters:
  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • beam_directions (list of (theta_deg, phi_deg) tuples) – Directions for each beam

  • amplitudes (list of float, optional) – Relative amplitude for each beam (default: equal)

  • tapers (list of ndarray, optional) – Amplitude taper for each beam (default: uniform)

Returns:

weights – Combined complex weights

Return type:

ndarray

phased_array.multi_beam_weights_orthogonal(geometry, k, beam_directions)[source]#

Compute separate weight vectors for orthogonal digital beamforming.

Each beam has its own weight vector, allowing digital combination with no loss per beam (requires N receive channels).

Parameters:
  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • beam_directions (list of (theta_deg, phi_deg) tuples) – Directions for each beam

Returns:

weight_vectors – List of complex weight vectors, one per beam

Return type:

list of ndarray

phased_array.compute_beam_isolation(weights_list, geometry, k, beam_directions)[source]#

Compute isolation between multiple beams.

Parameters:
  • weights_list (list of ndarray) – Weight vector for each beam

  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • beam_directions (list of (theta_deg, phi_deg)) – Direction of each beam

Returns:

isolation_matrix – N_beams x N_beams matrix of isolation in dB Diagonal is 0 dB, off-diagonal is negative (isolation)

Return type:

ndarray

Special Patterns#

phased_array.monopulse_weights(geometry, k, theta0_deg, phi0_deg, mode='sum')[source]#

Compute monopulse tracking weights.

Parameters:
  • geometry (ArrayGeometry) – Array geometry

  • k (float) – Wavenumber

  • theta0_deg (float) – Nominal beam direction theta

  • phi0_deg (float) – Nominal beam direction phi

  • mode (str) – ‘sum’ - sum pattern (normal beam) ‘delta_az’ - azimuth difference pattern ‘delta_el’ - elevation difference pattern

Returns:

weights – Complex weights for the specified mode

Return type:

ndarray