taylor#
Generate a Taylor window.
The Taylor window holds the nbar sidelobes nearest the mainlobe at a nearly constant level sll dB below the
mainlobe and tapers the sidelobes beyond them. Parameters are passed in a TaylorWindowParams struct, so any member
that is not named in a designated initializer keeps its default.
Each sample is evaluated from a cosine series with nbar terms. The series coefficients are computed once on the host
and stored in a fixed array of MaxNbar entries (24 by default), so nbar must not exceed MaxNbar. A taper
without peaks at its edges needs nbar >= 2*A^2 + 0.5, where A = acosh(10^(sll/20)) / pi. With the default
MaxNbar this holds for sidelobe levels up to about 87 dB. For larger values of nbar, raise
MaxNbar, e.g. taylor<0, float, 32>({N}, {.nbar = 31, .sll = 100}).
sll must be positive and below about 6165 dB, so that 10^(sll/20) is finite. The parameters are
not otherwise restricted: an sll below about 15 dB, or an nbar far above 2*A^2 + 0.5, gives a window that
peaks at its edges or has negative samples.
A 2D window for a rectangular aperture, such as SAR range and azimuth weighting, is the product of two 1D windows.
The window_functions example (examples/window_functions.cu) compares the frequency response of the Taylor window
with the other windows MatX provides.
Added in version 1.2.0.
-
struct TaylorWindowParams#
Parameters for a Taylor window.
Aggregate with designated-initializer support, e.g.
taylor<0>({N}, {.nbar = 6, .sll = 40}). Members that are not named keep their defaults. Designators must appear in declaration order.Public Members
-
index_t nbar = 4#
Number of nearly constant-level sidelobes adjacent to the mainlobe. Must be in [1, MaxNbar]. A taper that falls off monotonically needs nbar >= 2*A^2 + 0.5, where A = acosh(10^(sll/20)) / pi, and an nbar far above that bound makes the window peak at its edges.
-
double sll = 30.0#
Desired suppression of the sidelobe level in dB relative to the mainlobe. Must be positive and below about 6165 dB, so that 10^(sll/20) is finite. Below about 15 dB, the window has negative samples or peaks at its edges.
-
bool norm = true#
When true, scale the window so that its center value is 1; other values are at most 1 only when the taper falls off monotonically (see nbar and sll). When false, the window is not rescaled, and a symmetric window’s mean (DC gain) is 1.
-
bool sym = true#
When true, generate a symmetric window for filter design. When false, generate a periodic window for spectral analysis.
-
index_t nbar = 4#
-
template<int Dim, typename T = float, int MaxNbar = 24, typename ShapeType>
inline auto matx::taylor(ShapeType &&s, TaylorWindowParams params = {})# Creates a Taylor window operator of shape s with the window applied along the specified dimension
The Taylor window approximates the Dolph-Chebyshev window’s constant sidelobe level for the nbar sidelobes nearest the mainlobe, then tapers the remaining sidelobes. It is widely used for SAR image formation and array tapering.
Each sample is evaluated from a cosine series with nbar terms. The series coefficients are stored in a fixed array of MaxNbar entries, so params.nbar must not exceed MaxNbar. A taper without edge peaking needs nbar >= 2*A^2 + 0.5, where A = acosh(10^(sll/20)) / pi. The default MaxNbar of 24 satisfies this for sidelobe levels up to about 87 dB. Other parameters are not restricted: sll below about 15 dB, or nbar far above that bound, gives a window that peaks at its edges or has negative samples.
Like other separable windows, a 2D window is the product of two 1D windows, e.g.
taylor<0>({R, C}) * taylor<1>({R, C}).Returns values for a Taylor window across the selected dimension.
- Template Parameters:
Dim – Dimension to create window over
T – Data type of the window (float or double)
MaxNbar – Largest nbar this window can hold
ShapeType – Type of the shape, deduced from s
- Parameters:
s – The shape of the tensor
params – Window parameters
- Throws:
matxInvalidParameter – if params.nbar is outside [1, MaxNbar], or params.sll is not positive or is so large that 10^(sll/20) overflows (above about 6165 dB)
-
template<int Dim, typename T = float, int MaxNbar = 24, int RANK>
inline auto matx::taylor(const index_t (&s)[RANK], TaylorWindowParams params = {})# Creates a Taylor window operator of C-array shape s with the window applied along the specified dimension
Returns values for a Taylor window across the selected dimension.
- Template Parameters:
Dim – Dimension to create window over
T – Data type of the window (float or double)
MaxNbar – Largest nbar this window can hold
RANK – The RANK of the shape, can be deduced from shape
- Parameters:
s – C array representing shape of the tensor
params – Window parameters
- Throws:
matxInvalidParameter – if params.nbar is outside [1, MaxNbar], or params.sll is not positive or is so large that 10^(sll/20) overflows (above about 6165 dB)
Examples#
// Assign a Taylor window of size `win_size` with the default parameters (nbar = 4, sll = 30 dB) to `ov`
(ov = taylor<0>({win_size})).run(exec);
// Members of TaylorWindowParams that are not named keep their defaults (norm = true, sym = true)
(ov = taylor<0, TestType>({win_size}, {.nbar = 6, .sll = 40})).run(exec);
// A 100 dB taper needs nbar = 31, which is above the default MaxNbar of 24, so raise MaxNbar
// (the third template argument) to make room for the larger coefficient array
(ov = taylor<0, TestType, 32>({win_size}, {.nbar = 31, .sll = 100})).run(exec);
// Separable 2D Taylor weighting of a `rows` x `cols` image, with different parameters along each dimension
(img = img * taylor<0, TestType>({rows, cols}, {.nbar = 5, .sll = 35})
* taylor<1, TestType>({rows, cols}, {.nbar = 4, .sll = 30})).run(exec);