Tapering window functions for spectral analysis, filter design and signal processing.
Every window is a function (window N) or (window N options) which returns a sequence of N doubles; (window) returns 256 samples. N must be an integer valued number >= 0; anything else throws ex-info (:type :invalid-input, :function, :property, :value, :expected). N = 0 returns () and N = 1 returns (1.0) for every window (with the default :normalize?). Most windows are registered by name in fastmath.kernel/window, which also handles the periodic variant.
Conventions:
f on [-0.5, 0.5] with the integral 1 (the -continuous functions and the constructors ->name), sampled at N evenly spaced points including both ends. The window functions have support [-0.5, 0.5]; the kernels of fastmath.kernel.density are the standard forms with support [-1, 1], so a window is the kernel shape at 2x (for example welch is the Epanechnikov shape).triangular and parzen default paths, dolph-chebyshev, ultraspherical, saramaki, legendre, shayesteh-kashtiban, kaiser-bessel-derived, vorbis, cosine) are defined directly on the index.:normalize? false): continuous windows have the integral 1, the discrete windows of Doerry (dolph-chebyshev, ultraspherical, saramaki, legendre, shayesteh-kashtiban) have the mean 1; kaiser-bessel-derived (power complementary), vorbis and cosine (formula values) keep their own scale and have the default :normalize? false, as rectangular05.:normalize?: true divides by the value of the window function at the middle for the continuous model windows (for even N the maximum is below 1, as in scipy and Octave) and by the maximum (:LInf) for the discrete windows; false is the raw scale; :LInf (alias :Linf), :L1, :L2, :N and a finite non-zero number are accepted, see normalize-coefficients. nil or a missing key selects the default of the window, any other value throws.:alpha, :order, ...) are validated against their documented domains; nil is a missing parameter and a value outside of the domain throws ex-info. No window returns NaN for an accepted parameter.:symmetric? is ignored by the functions of this namespace, they always return the symmetric window. Only fastmath.kernel/window handles it: a periodic window of N samples is the symmetric window of N + 1 samples without the last one.:blackman-harris is the Nuttall three-term minimum sidelobe window (0.4243801 0.4973406 0.0782793, peak sidelobe -71.5 dB), not the window called blackmanharris by scipy, Matlab and Octave, which is blackman-harris-92db. blackman-nutall is scipy nuttall and nutall-1st is Octave nuttallwin. The names are spelled nutall-*.lanczos has the default :L 3.0; the usual Lanczos window of scipy is :L 1.0. taylor is sampled at -0.5, ..., 0.5 including both ends, which differs from the grid of scipy taylor and Octave taylorwin.:level of dolph-chebyshev is the achieved peak sidelobe level. For ultraspherical, saramaki, legendre and taylor it is Doerry's design parameter and the achieved peak sidelobe level differs from it by up to about 17 dB (higher for ultraspherical, saramaki and taylor with a small :n, about 3 dB lower for legendre); the measured levels are in the docstrings of these windows.Functions:
normalize-coefficients, sample-window, continuous->window-fn, discrete->window-fn, idftrectangular, rectangular05, triangular, trapezoid, tukey, welch, parzen, b-spline, parzen-algebraic, singla-singh, connessinc, fejer, de-la-vallee-poussin, lanczoscosine, hann, hamming, hamming-exact, raised-cosine, webster-hamming, power-of-cosine, raised-power-of-cosine, parzen-cosine, bohman, bartlett-hann, vorbisblackman, blackman-exact, blackman-harris, blackman-harris-61db, blackman-harris-67db, blackman-harris-74db, blackman-harris-92db, blackman-nutall, nutall-3-1st, nutall-3-3rd, nutall-1st, nutall-3rd, nutall-5th, mottaghi-kashtiban-shayesteh, blackman-harris-family (user coefficients, scipy general_cosine)flat-top (scipy), flat-top-3, flat-top-hp, flat-top-srs, flat-top-bk (Octave flattopwin), hft70, hft90d, hft95, hft116d, hft144d, hft169d, hft196d, hft223d, hft248dkaiser, kaiser-bessel, kaiser-bessel-derived, cosh, avci-nacaroglu, knab, bessel-I1gaussian, general-gaussian, exponential, hanning-poisson, cauchy, parzen-exponential, parzen-geometricdolph-chebyshev, ultraspherical, saramaki, legendre, taylor, shayesteh-kashtibanname-continuous (fixed windows) or ->name (parametrized windows) returning the continuous function, which can be used with sample-window.scipy.signal.windows and Octave signal equivalents (default options): boxcar and rectwin are rectangular; triang is triangular; bartlett is triangular with :shift 0; parzen and parzenwin are parzen; bohman and bohmanwin, barthann and barthannwin, blackman, hamming, hann, tukey and tukeywin have the same names; cosine is cosine; lanczos is lanczos with :L 1.0; general_cosine is blackman-harris-family; general_hamming is raised-cosine; blackmanharris is blackman-harris-92db; nuttall is blackman-nutall; nuttallwin is nutall-1st; flattop is flat-top; flattopwin of Octave is flat-top-bk; gaussian and gausswin are gaussian (:alpha is (N - 1) / (2 std) for scipy and a for Octave); general_gaussian is general-gaussian; exponential is exponential (:alpha is (N - 1) / (2 tau)); kaiser is kaiser; kaiser_bessel_derived is kaiser-bessel-derived (:alpha is beta / pi); chebwin is dolph-chebyshev (:level is -at); taylor and taylorwin are taylor (different sampling grid).
Literature: A. W. Doerry, Catalog of Window Taper Functions for Sidelobe Control, SAND2017-4042; F. J. Harris, On the use of windows for harmonic analysis with the discrete Fourier transform, Proc. IEEE 66(1), 1978; A. H. Nuttall, Some windows with very good sidelobe behavior, IEEE Trans. ASSP 29(1), 1981; G. Heinzel, A. Ruediger and R. Schilling, Spectrum and spectral density estimation by the Discrete Fourier Transform (DFT), including a comprehensive list of window functions and some new flat-top windows, 2002.
Tapering window functions for spectral analysis, filter design and signal processing. Every window is a function `(window N)` or `(window N options)` which returns a sequence of `N` doubles; `(window)` returns `256` samples. `N` must be an integer valued number `>= 0`; anything else throws `ex-info` (`:type :invalid-input`, `:function`, `:property`, `:value`, `:expected`). `N = 0` returns `()` and `N = 1` returns `(1.0)` for every window (with the default `:normalize?`). Most windows are registered by name in `fastmath.kernel/window`, which also handles the periodic variant. Conventions: - Continuous model windows (most of them) are a continuous function `f` on `[-0.5, 0.5]` with the integral `1` (the `-continuous` functions and the constructors `->name`), sampled at `N` evenly spaced points including both ends. The window functions have support `[-0.5, 0.5]`; the kernels of `fastmath.kernel.density` are the standard forms with support `[-1, 1]`, so a window is the kernel shape at `2x` (for example `welch` is the Epanechnikov shape). - Discrete windows (`triangular` and `parzen` default paths, `dolph-chebyshev`, `ultraspherical`, `saramaki`, `legendre`, `shayesteh-kashtiban`, `kaiser-bessel-derived`, `vorbis`, `cosine`) are defined directly on the index. - Raw scale (`:normalize? false`): continuous windows have the integral `1`, the discrete windows of Doerry (`dolph-chebyshev`, `ultraspherical`, `saramaki`, `legendre`, `shayesteh-kashtiban`) have the mean `1`; `kaiser-bessel-derived` (power complementary), `vorbis` and `cosine` (formula values) keep their own scale and have the default `:normalize? false`, as `rectangular05`. - Option `:normalize?`: `true` divides by the value of the window function at the middle for the continuous model windows (for even `N` the maximum is below `1`, as in scipy and Octave) and by the maximum (`:LInf`) for the discrete windows; `false` is the raw scale; `:LInf` (alias `:Linf`), `:L1`, `:L2`, `:N` and a finite non-zero number are accepted, see [[normalize-coefficients]]. `nil` or a missing key selects the default of the window, any other value throws. - The parameters of the windows (`:alpha`, `:order`, ...) are validated against their documented domains; `nil` is a missing parameter and a value outside of the domain throws `ex-info`. No window returns `NaN` for an accepted parameter. - The option `:symmetric?` is ignored by the functions of this namespace, they always return the symmetric window. Only `fastmath.kernel/window` handles it: a periodic window of `N` samples is the symmetric window of `N + 1` samples without the last one. - `:blackman-harris` is the Nuttall three-term minimum sidelobe window (`0.4243801 0.4973406 0.0782793`, peak sidelobe -71.5 dB), not the window called blackmanharris by scipy, Matlab and Octave, which is `blackman-harris-92db`. `blackman-nutall` is scipy `nuttall` and `nutall-1st` is Octave `nuttallwin`. The names are spelled `nutall-*`. - `lanczos` has the default `:L 3.0`; the usual Lanczos window of scipy is `:L 1.0`. `taylor` is sampled at `-0.5, ..., 0.5` including both ends, which differs from the grid of scipy `taylor` and Octave `taylorwin`. - The `:level` of `dolph-chebyshev` is the achieved peak sidelobe level. For `ultraspherical`, `saramaki`, `legendre` and `taylor` it is Doerry's design parameter and the achieved peak sidelobe level differs from it by up to about 17 dB (higher for `ultraspherical`, `saramaki` and `taylor` with a small `:n`, about 3 dB lower for `legendre`); the measured levels are in the docstrings of these windows. Functions: - helpers: [[normalize-coefficients]], [[sample-window]], [[continuous->window-fn]], [[discrete->window-fn]], [[idft]] - rectangular and triangular: [[rectangular]], [[rectangular05]], [[triangular]], [[trapezoid]], [[tukey]], [[welch]], [[parzen]], [[b-spline]], [[parzen-algebraic]], [[singla-singh]], [[connes]] - sinc family: [[sinc]], [[fejer]], [[de-la-vallee-poussin]], [[lanczos]] - cosine family: [[cosine]], [[hann]], [[hamming]], [[hamming-exact]], [[raised-cosine]], [[webster-hamming]], [[power-of-cosine]], [[raised-power-of-cosine]], [[parzen-cosine]], [[bohman]], [[bartlett-hann]], [[vorbis]] - sum of cosines: [[blackman]], [[blackman-exact]], [[blackman-harris]], [[blackman-harris-61db]], [[blackman-harris-67db]], [[blackman-harris-74db]], [[blackman-harris-92db]], [[blackman-nutall]], [[nutall-3-1st]], [[nutall-3-3rd]], [[nutall-1st]], [[nutall-3rd]], [[nutall-5th]], [[mottaghi-kashtiban-shayesteh]], [[blackman-harris-family]] (user coefficients, scipy general_cosine) - flat-top (amplitude accuracy): [[flat-top]] (scipy), [[flat-top-3]], [[flat-top-hp]], [[flat-top-srs]], [[flat-top-bk]] (Octave flattopwin), [[hft70]], [[hft90d]], [[hft95]], [[hft116d]], [[hft144d]], [[hft169d]], [[hft196d]], [[hft223d]], [[hft248d]] - Kaiser-Bessel family and DPSS approximations: [[kaiser]], [[kaiser-bessel]], [[kaiser-bessel-derived]], [[cosh]], [[avci-nacaroglu]], [[knab]], [[bessel-I1]] - exponential family: [[gaussian]], [[general-gaussian]], [[exponential]], [[hanning-poisson]], [[cauchy]], [[parzen-exponential]], [[parzen-geometric]] - sidelobe level design: [[dolph-chebyshev]], [[ultraspherical]], [[saramaki]], [[legendre]], [[taylor]], [[shayesteh-kashtiban]] - every continuous window has `name-continuous` (fixed windows) or `->name` (parametrized windows) returning the continuous function, which can be used with [[sample-window]]. scipy.signal.windows and Octave signal equivalents (default options): boxcar and rectwin are `rectangular`; triang is `triangular`; bartlett is `triangular` with `:shift 0`; parzen and parzenwin are `parzen`; bohman and bohmanwin, barthann and barthannwin, blackman, hamming, hann, tukey and tukeywin have the same names; cosine is `cosine`; lanczos is `lanczos` with `:L 1.0`; general_cosine is `blackman-harris-family`; general_hamming is `raised-cosine`; blackmanharris is `blackman-harris-92db`; nuttall is `blackman-nutall`; nuttallwin is `nutall-1st`; flattop is `flat-top`; flattopwin of Octave is `flat-top-bk`; gaussian and gausswin are `gaussian` (`:alpha` is `(N - 1) / (2 std)` for scipy and `a` for Octave); general_gaussian is `general-gaussian`; exponential is `exponential` (`:alpha` is `(N - 1) / (2 tau)`); kaiser is `kaiser`; kaiser_bessel_derived is `kaiser-bessel-derived` (`:alpha` is `beta / pi`); chebwin is `dolph-chebyshev` (`:level` is `-at`); taylor and taylorwin are `taylor` (different sampling grid). Literature: A. W. Doerry, Catalog of Window Taper Functions for Sidelobe Control, SAND2017-4042; F. J. Harris, On the use of windows for harmonic analysis with the discrete Fourier transform, Proc. IEEE 66(1), 1978; A. H. Nuttall, Some windows with very good sidelobe behavior, IEEE Trans. ASSP 29(1), 1981; G. Heinzel, A. Ruediger and R. Schilling, Spectrum and spectral density estimation by the Discrete Fourier Transform (DFT), including a comprehensive list of window functions and some new flat-top windows, 2002.
(->avci-nacaroglu alpha)Returns the Avci-Nacaroglu window function A exp(pi alpha (sqrt(1 - 4x^2) - 1)) (integral 1, the constant by quadrature), alpha > 0.
Returns the Avci-Nacaroglu window function `A exp(pi alpha (sqrt(1 - 4x^2) - 1))` (integral `1`, the constant by quadrature), `alpha > 0`.
(->b-spline order)Returns the b-spline window function of the integer order >= 1: order * B(order * x) where B is the centered cardinal b-spline of order (degree order - 1), the integral over [-0.5, 0.5] is 1; computed with the stable Cox-de Boor recurrence in O(order^2) per call.
Returns the b-spline window function of the integer `order >= 1`: `order * B(order * x)` where `B` is the centered cardinal b-spline of `order` (degree `order - 1`), the integral over `[-0.5, 0.5]` is `1`; computed with the stable Cox-de Boor recurrence in `O(order^2)` per call.
(->bessel-I1 alpha)Returns the Bessel I1 window function A I1(pi alpha s) / (I1(pi alpha) s), s = sqrt(1 - 4x^2) (integral 1), alpha > 0.
Returns the Bessel I1 window function `A I1(pi alpha s) / (I1(pi alpha) s)`, `s = sqrt(1 - 4x^2)` (integral `1`), `alpha > 0`.
(->blackman-harris coeffs)(->blackman-harris coeffs clip?)Returns the sum of cosines window function A (a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + ...) with A = 1 / a0 (integral 1); coeffs are the positive magnitudes [a0 a1 ...] (the centered form of the classical alternating signs formula, as scipy.signal.windows.general_cosine). With clip? true (default) the negative values of the sum are replaced by 0.0, with false the sum is kept as it is.
Returns the sum of cosines window function `A (a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + ...)` with `A = 1 / a0` (integral `1`); `coeffs` are the positive magnitudes `[a0 a1 ...]` (the centered form of the classical alternating signs formula, as `scipy.signal.windows.general_cosine`). With `clip?` `true` (default) the negative values of the sum are replaced by `0.0`, with `false` the sum is kept as it is.
(->cauchy alpha)Returns the Cauchy window function A / (1 + (2 alpha x)^2) (integral 1), alpha > 0.
Returns the Cauchy window function `A / (1 + (2 alpha x)^2)` (integral `1`), `alpha > 0`.
(->connes alpha)Returns the Connes window function A (1 - (2x/alpha)^2)^2 (integral 1) for alpha > 0.
Returns the Connes window function `A (1 - (2x/alpha)^2)^2` (integral `1`) for `alpha > 0`.
(->cosh alpha)Returns the cosh window function A cosh(pi alpha sqrt(1 - 4x^2)) / cosh(pi alpha) (integral 1), alpha > 0.
Returns the cosh window function `A cosh(pi alpha sqrt(1 - 4x^2)) / cosh(pi alpha)` (integral `1`), `alpha > 0`.
(->dolph-chebyshev level)Returns a function of N >= 2, which returns the Dolph-Chebyshev window of N coefficients (mean 1) with the sidelobe level in dB.
Returns a function of `N >= 2`, which returns the Dolph-Chebyshev window of `N` coefficients (mean `1`) with the sidelobe `level` in dB.
(->exponential alpha)Returns the exponential window function A exp(-2 alpha abs(x)) (integral 1), alpha > 0.
Returns the exponential window function `A exp(-2 alpha abs(x))` (integral `1`), `alpha > 0`.
(->gaussian alpha)Returns the truncated gaussian window function A exp(-2 alpha^2 x^2) (integral 1), alpha > 0.
Returns the truncated gaussian window function `A exp(-2 alpha^2 x^2)` (integral `1`), `alpha > 0`.
(->general-gaussian p sig)Returns the generalized gaussian window function A exp(-0.5 abs(x / sig)^(2 p)) (integral 1), p > 0, sig > 0 (a fraction of the window length). Throws ex-info for a sig so small that the window has no non-zero sample.
Returns the generalized gaussian window function `A exp(-0.5 abs(x / sig)^(2 p))` (integral `1`), `p > 0`, `sig > 0` (a fraction of the window length). Throws `ex-info` for a `sig` so small that the window has no non-zero sample.
(->hanning-poisson alpha)Returns the Hanning-Poisson window function (the Hann window times exp(-2 alpha abs(x)), integral 1), alpha > 0.
Returns the Hanning-Poisson window function (the Hann window times `exp(-2 alpha abs(x))`, integral `1`), `alpha > 0`.
(->kaiser beta)Returns the Kaiser window function A I0(beta sqrt(1 - 4x^2)) (integral 1), beta >= 0; the same function as ->kaiser-bessel with alpha = beta / pi, beta = 0 is the rectangular window function.
Returns the Kaiser window function `A I0(beta sqrt(1 - 4x^2))` (integral `1`), `beta >= 0`; the same function as [[->kaiser-bessel]] with `alpha = beta / pi`, `beta = 0` is the rectangular window function.
(->kaiser-bessel alpha)Returns the Kaiser-Bessel window function A I0(pi alpha sqrt(1 - 4x^2)) (integral 1), alpha > 0; alpha = beta / pi of the Kaiser window of scipy.
Returns the Kaiser-Bessel window function `A I0(pi alpha sqrt(1 - 4x^2))` (integral `1`), `alpha > 0`; `alpha = beta / pi` of the Kaiser window of scipy.
(->kaiser-bessel-derived alpha)Returns a function of N >= 2, which returns the Kaiser-Bessel-derived window of N coefficients; alpha = beta / pi.
Returns a function of `N >= 2`, which returns the Kaiser-Bessel-derived window of `N` coefficients; `alpha = beta / pi`.
(->knab alpha)Returns the Knab window function A sinh(pi alpha s) / (sinh(pi alpha) s), s = sqrt(1 - 4x^2) (integral 1), alpha > 0.
Returns the Knab window function `A sinh(pi alpha s) / (sinh(pi alpha) s)`, `s = sqrt(1 - 4x^2)` (integral `1`), `alpha > 0`.
(->lanczos L)Returns the Lanczos window function A sinc(2x)^L (integral 1) for L >= 0.
Returns the Lanczos window function `A sinc(2x)^L` (integral `1`) for `L >= 0`.
(->legendre level)Returns a function of N >= 2, which returns the Legendre window of N coefficients (mean 1) with the design level (Doerry, eq. 266: 1.0754 abs(level) + 1.7388 dB).
Returns a function of `N >= 2`, which returns the Legendre window of `N` coefficients (mean `1`) with the design `level` (Doerry, eq. 266: `1.0754 abs(level) + 1.7388` dB).
(->parzen-algebraic gamma u)Returns the Parzen algebraic window function A (1 - gamma abs(2x)^u) (integral 1) for 0 < gamma <= 1, u > 0.
Returns the Parzen algebraic window function `A (1 - gamma abs(2x)^u)` (integral `1`) for `0 < gamma <= 1`, `u > 0`.
(->parzen-cosine m gamma)Returns the Parzen cosine window function A (1 + cos(pi gamma abs(2x)^m)) (integral 1, the constant by quadrature) for 0 <= gamma <= 1, m > 0.
Returns the Parzen cosine window function `A (1 + cos(pi gamma abs(2x)^m))` (integral `1`, the constant by quadrature) for `0 <= gamma <= 1`, `m > 0`.
(->parzen-exponential alpha r)Returns the Parzen exponential window function A exp(-abs(2 alpha x)^r) (integral 1, the constant by quadrature).
Returns the Parzen exponential window function `A exp(-abs(2 alpha x)^r)` (integral `1`, the constant by quadrature).
(->parzen-geometric alpha r)Returns the Parzen geometric window function A / (1 + abs(2 alpha x)^r) (integral 1, the constant by quadrature).
Returns the Parzen geometric window function `A / (1 + abs(2 alpha x)^r)` (integral `1`, the constant by quadrature).
(->power-of-cosine m)Returns the power of cosine window function A cos(pi x)^m (integral 1) for m >= 0.
Returns the power of cosine window function `A cos(pi x)^m` (integral `1`) for `m >= 0`.
(->raised-cosine alpha)Returns the raised cosine window function 1 + ((1 - alpha) / alpha) cos(2 pi x) (integral 1) for 0.5 <= alpha <= 1.
Returns the raised cosine window function `1 + ((1 - alpha) / alpha) cos(2 pi x)` (integral `1`) for `0.5 <= alpha <= 1`.
(->raised-power-of-cosine m alpha)Returns the raised power of cosine window function A (alpha + (1 - alpha) cos(pi x)^m) (integral 1) for 0 <= alpha <= 1, m >= 0.
Returns the raised power of cosine window function `A (alpha + (1 - alpha) cos(pi x)^m)` (integral `1`) for `0 <= alpha <= 1`, `m >= 0`.
(->singla-singh order)Returns the Singla-Singh window function of the integer order >= 0: 2 (1 - I_t(order + 1, order + 1)) with t = abs(2x) and I the regularized incomplete beta function (integral 1).
Returns the Singla-Singh window function of the integer `order >= 0`: `2 (1 - I_t(order + 1, order + 1))` with `t = abs(2x)` and `I` the regularized incomplete beta function (integral `1`).
(->taylor level n)Returns the Taylor window function (not clipped) with the design sidelobe level in dB and n >= 2 nearly constant level sidelobes.
Returns the Taylor window function (not clipped) with the design sidelobe `level` in dB and `n >= 2` nearly constant level sidelobes.
(->trapezoid alpha)Returns the trapezoid window function (flat for abs(x) <= alpha, linear to zero at the ends, integral 1) for 0 <= alpha <= 0.5.
Returns the trapezoid window function (flat for `abs(x) <= alpha`, linear to zero at the ends, integral `1`) for `0 <= alpha <= 0.5`.
(->triangular-discrete shift)Returns a function of N (a long >= 2) which returns the discrete triangular window 1 - abs(n - (N-1)/2) / floor((N - 1 + shift) / 2), n = 0, ..., N-1, for the integer shift >= 1; shift = 2 is equal to scipy.signal.windows.triang.
Returns a function of `N` (a long `>= 2`) which returns the discrete triangular window `1 - abs(n - (N-1)/2) / floor((N - 1 + shift) / 2)`, `n = 0, ..., N-1`, for the integer `shift >= 1`; `shift = 2` is equal to `scipy.signal.windows.triang`.
(->tukey alpha)Returns the Tukey (tapered cosine) window function (integral 1); alpha >= 0 is the tapered fraction of the window, alpha >= 1 is the Hann window.
Returns the Tukey (tapered cosine) window function (integral `1`); `alpha >= 0` is the tapered fraction of the window, `alpha >= 1` is the Hann window.
(->ultraspherical level alpha)Returns a function of N >= 2, which returns the ultraspherical window of N coefficients (mean 1) for the parameter level (Doerry's mu) and alpha > -1; alpha = 0 is the Dolph-Chebyshev window.
Returns a function of `N >= 2`, which returns the ultraspherical window of `N` coefficients (mean `1`) for the parameter `level` (Doerry's `mu`) and `alpha > -1`; `alpha = 0` is the Dolph-Chebyshev window.
(->webster-hamming v)Returns the Webster (generalized Hamming) window function (integral 1) for v > -0.5.
Returns the Webster (generalized Hamming) window function (integral `1`) for `v > -0.5`.
(avci-nacaroglu)(avci-nacaroglu N)(avci-nacaroglu N opts)Avci-Nacaroglu window A exp(pi alpha (s - 1)), s = sqrt(1 - 4x^2), an exponential approximation of the DPSS (Slepian) window.
The ends are exp(-pi alpha) of the middle value.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 2.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser-bessel, cosh, knab, bessel-I1.
Avci-Nacaroglu window `A exp(pi alpha (s - 1))`, `s = sqrt(1 - 4x^2)`, an exponential approximation of the DPSS (Slepian) window.
The ends are `exp(-pi alpha)` of the middle value.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `2.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser-bessel]], [[cosh]], [[knab]], [[bessel-I1]].(b-spline)(b-spline N)(b-spline N opts)B-spline window: the centered cardinal b-spline of the given order, scaled to the support [-0.5, 0.5].
The window is order * B(order * x) with B the cardinal b-spline of order (degree order - 1), the convolution of order rectangles; it is non-negative and has the integral 1. The orders 1, 2 and 4 are the rectangular, the triangular (Bartlett) and the continuous Parzen windows, a high order approaches a gaussian. The recurrence is stable, the order is limited only to keep the cost O(order^2) per sample reasonable.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:order - integer in [1, 1000], default 3:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
The cost is O(order^2) per sample.
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also rectangular, triangular, parzen, gaussian.
B-spline window: the centered cardinal b-spline of the given order, scaled to the support `[-0.5, 0.5]`.
The window is `order * B(order * x)` with `B` the cardinal b-spline of `order` (degree `order - 1`), the convolution of `order` rectangles; it is non-negative and has the integral `1`. The orders `1`, `2` and `4` are the rectangular, the triangular (Bartlett) and the continuous Parzen windows, a high order approaches a gaussian. The recurrence is stable, the order is limited only to keep the cost `O(order^2)` per sample reasonable.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:order` - integer in `[1, 1000]`, default `3`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
The cost is `O(order^2)` per sample.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[rectangular]], [[triangular]], [[parzen]], [[gaussian]].(bartlett-hann)(bartlett-hann N)(bartlett-hann N opts)Bartlett-Hann window 0.62 - 0.48 abs(x) + 0.38 cos(2 pi x), a linear combination of the triangular and the Hann window.
Equal to scipy.signal.windows.barthann and Octave barthannwin. The ends are almost zero (0.0, up to rounding).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also triangular, hann, blackman.
Bartlett-Hann window `0.62 - 0.48 abs(x) + 0.38 cos(2 pi x)`, a linear combination of the triangular and the Hann window.
Equal to `scipy.signal.windows.barthann` and Octave `barthannwin`. The ends are almost zero (`0.0`, up to rounding).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[triangular]], [[hann]], [[blackman]].(bartlett-hann-continuous x)Bartlett-Hann window, continuous function 2 (0.62 - 0.48 abs(x) + 0.38 cos(2 pi x)) on [-0.5, 0.5] (integral 1).
Bartlett-Hann window, continuous function `2 (0.62 - 0.48 abs(x) + 0.38 cos(2 pi x))` on `[-0.5, 0.5]` (integral `1`).
(bessel-I1)(bessel-I1 N)(bessel-I1 N opts)Modified Bessel window of the first order A I1(pi alpha s) / (I1(pi alpha) s), s = sqrt(1 - 4x^2), an approximation of the DPSS (Slepian) window.
I1 is the modified Bessel function of the first kind and order 1; at the ends (s = 0) the function has the limit value pi alpha / (2 I1(pi alpha)) of the middle value.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 2.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser-bessel, cosh, knab, avci-nacaroglu.
Modified Bessel window of the first order `A I1(pi alpha s) / (I1(pi alpha) s)`, `s = sqrt(1 - 4x^2)`, an approximation of the DPSS (Slepian) window.
`I1` is the modified Bessel function of the first kind and order 1; at the ends (`s = 0`) the function has the limit value `pi alpha / (2 I1(pi alpha))` of the middle value.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `2.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser-bessel]], [[cosh]], [[knab]], [[avci-nacaroglu]].(blackman)(blackman N)(blackman N opts)Blackman window 0.42 + 0.5 cos(2 pi x) + 0.08 cos(4 pi x), three cosine terms (centered form).
Equal to scipy.signal.windows.blackman and Octave blackman. The ends are zero, the peak sidelobe level is about -58.1 dB, the sidelobes drop as 1/f^3.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-exact, hann, hamming, blackman-harris-family.
Blackman window `0.42 + 0.5 cos(2 pi x) + 0.08 cos(4 pi x)`, three cosine terms (centered form).
Equal to `scipy.signal.windows.blackman` and Octave `blackman`. The ends are zero, the peak sidelobe level is about -58.1 dB, the sidelobes drop as `1/f^3`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-exact]], [[hann]], [[hamming]], [[blackman-harris-family]].(blackman-continuous x)Blackman window, continuous function A (0.42 + 0.5 cos(2 pi x) + 0.08 cos(4 pi x)) (integral 1, zero ends).
Blackman window, continuous function `A (0.42 + 0.5 cos(2 pi x) + 0.08 cos(4 pi x))` (integral `1`, zero ends).
(blackman-exact)(blackman-exact N)(blackman-exact N opts)Exact Blackman window (7938 + 9240 cos(2 pi x) + 1430 cos(4 pi x)) / 18608, the three-term cosine sum which cancels the first two sidelobes.
Equal to scipy.signal.windows.general_cosine with the coefficients [7938 9240 1430] / 18608. The ends are small (0.0069), the peak sidelobe level is about -68.2 dB.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman, hamming-exact, blackman-harris-family.
Exact Blackman window `(7938 + 9240 cos(2 pi x) + 1430 cos(4 pi x)) / 18608`, the three-term cosine sum which cancels the first two sidelobes.
Equal to `scipy.signal.windows.general_cosine` with the coefficients `[7938 9240 1430] / 18608`. The ends are small (`0.0069`), the peak sidelobe level is about -68.2 dB.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman]], [[hamming-exact]], [[blackman-harris-family]].(blackman-exact-continuous x)Exact Blackman window, continuous function A (7938 + 9240 cos(2 pi x) + 1430 cos(4 pi x)) / 18608 (integral 1).
Exact Blackman window, continuous function `A (7938 + 9240 cos(2 pi x) + 1430 cos(4 pi x)) / 18608` (integral `1`).
(blackman-harris)(blackman-harris N)(blackman-harris N opts)Blackman-Harris window in the Nuttall three-term minimum sidelobe form (Heinzel et al. 2002: Nuttall3b).
The window is A (0.4243801 + 0.4973406 cos(2 pi x) + 0.0782793 cos(4 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -71.5 dB. This is not scipy.signal.windows.blackmanharris or Octave blackmanharris (those are the four-term -92 dB window, blackman-harris-92db), and not scipy nuttall (blackman-nutall). Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-harris-92db, blackman-nutall, blackman-harris-67db, blackman-harris-family.
Blackman-Harris window in the Nuttall three-term minimum sidelobe form (Heinzel et al. 2002: Nuttall3b).
The window is `A (0.4243801 + 0.4973406 cos(2 pi x) + 0.0782793 cos(4 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -71.5 dB. This is not `scipy.signal.windows.blackmanharris` or Octave `blackmanharris` (those are the four-term -92 dB window, [[blackman-harris-92db]]), and not scipy `nuttall` ([[blackman-nutall]]). Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-harris-92db]], [[blackman-nutall]], [[blackman-harris-67db]], [[blackman-harris-family]].(blackman-harris-61db)(blackman-harris-61db N)(blackman-harris-61db N opts)Blackman-Harris three-term window (Harris 1978), named -61 dB after the rounded sidelobe level of the paper.
The window is A (0.44959 + 0.49364 cos(2 pi x) + 0.05677 cos(4 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -62.0 dB. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-harris, blackman-harris-67db, blackman-harris-74db.
Blackman-Harris three-term window (Harris 1978), named -61 dB after the rounded sidelobe level of the paper.
The window is `A (0.44959 + 0.49364 cos(2 pi x) + 0.05677 cos(4 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -62.0 dB. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-harris]], [[blackman-harris-67db]], [[blackman-harris-74db]].(blackman-harris-61db-continuous x)Blackman-Harris -61 dB window, continuous function A (0.44959 + 0.49364 cos(2 pi x) + 0.05677 cos(4 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Blackman-Harris -61 dB window, continuous function `A (0.44959 + 0.49364 cos(2 pi x) + 0.05677 cos(4 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(blackman-harris-67db)(blackman-harris-67db N)(blackman-harris-67db N opts)Blackman-Harris three-term window (Harris 1978), named -67 dB after the rounded sidelobe level of the paper.
The window is A (0.42323 + 0.49755 cos(2 pi x) + 0.07922 cos(4 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -70.8 dB. The name is Harris' label; the sidelobe level of the coefficients is lower than the label (the measured level is the value above). Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-harris, blackman-harris-61db, blackman-harris-74db.
Blackman-Harris three-term window (Harris 1978), named -67 dB after the rounded sidelobe level of the paper.
The window is `A (0.42323 + 0.49755 cos(2 pi x) + 0.07922 cos(4 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -70.8 dB. The name is Harris' label; the sidelobe level of the coefficients is lower than the label (the measured level is the value above). Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-harris]], [[blackman-harris-61db]], [[blackman-harris-74db]].(blackman-harris-67db-continuous x)Blackman-Harris -67 dB window, continuous function A (0.42323 + 0.49755 cos(2 pi x) + 0.07922 cos(4 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Blackman-Harris -67 dB window, continuous function `A (0.42323 + 0.49755 cos(2 pi x) + 0.07922 cos(4 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(blackman-harris-74db)(blackman-harris-74db N)(blackman-harris-74db N opts)Blackman-Harris four-term window (Harris 1978), named -74 dB after the rounded sidelobe level of the paper.
The window is A (0.40217 + 0.49703 cos(2 pi x) + 0.09892 cos(4 pi x) + 0.00188 cos(6 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -74.4 dB. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-harris, blackman-harris-92db, blackman-harris-67db.
Blackman-Harris four-term window (Harris 1978), named -74 dB after the rounded sidelobe level of the paper.
The window is `A (0.40217 + 0.49703 cos(2 pi x) + 0.09892 cos(4 pi x) + 0.00188 cos(6 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -74.4 dB. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-harris]], [[blackman-harris-92db]], [[blackman-harris-67db]].(blackman-harris-74db-continuous x)Blackman-Harris -74 dB window, continuous function A (0.40217 + 0.49703 cos(2 pi x) + 0.09892 cos(4 pi x) + 0.00188 cos(6 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Blackman-Harris -74 dB window, continuous function `A (0.40217 + 0.49703 cos(2 pi x) + 0.09892 cos(4 pi x) + 0.00188 cos(6 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(blackman-harris-92db)(blackman-harris-92db N)(blackman-harris-92db N opts)Blackman-Harris four-term window (Harris 1978) with the sidelobe level of -92 dB.
The window is A (0.35875 + 0.48829 cos(2 pi x) + 0.14128 cos(4 pi x) + 0.01168 cos(6 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -92.0 dB. Equal to scipy.signal.windows.blackmanharris, Octave blackmanharris and Matlab blackmanharris. The ends are 6e-5 of the middle value (almost zero), the sidelobes drop as 1/f. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-harris, blackman-nutall, nutall-1st, blackman-harris-family.
Blackman-Harris four-term window (Harris 1978) with the sidelobe level of -92 dB.
The window is `A (0.35875 + 0.48829 cos(2 pi x) + 0.14128 cos(4 pi x) + 0.01168 cos(6 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -92.0 dB. Equal to `scipy.signal.windows.blackmanharris`, Octave `blackmanharris` and Matlab `blackmanharris`. The ends are `6e-5` of the middle value (almost zero), the sidelobes drop as `1/f`. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-harris]], [[blackman-nutall]], [[nutall-1st]], [[blackman-harris-family]].(blackman-harris-92db-continuous x)Blackman-Harris -92 dB window, continuous function A (0.35875 + 0.48829 cos(2 pi x) + 0.14128 cos(4 pi x) + 0.01168 cos(6 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Blackman-Harris -92 dB window, continuous function `A (0.35875 + 0.48829 cos(2 pi x) + 0.14128 cos(4 pi x) + 0.01168 cos(6 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(blackman-harris-continuous x)Blackman-Harris (Nuttall three-term) window, continuous function A (0.4243801 + 0.4973406 cos(2 pi x) + 0.0782793 cos(4 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Blackman-Harris (Nuttall three-term) window, continuous function `A (0.4243801 + 0.4973406 cos(2 pi x) + 0.0782793 cos(4 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(blackman-harris-family)(blackman-harris-family N)(blackman-harris-family N opts)Sum of cosines window A (a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + ...) for x in [-0.5, 0.5] with user coefficients; A = 1 / a0, so the integral is 1.
The terms are added with the positive magnitudes a0 a1 ... (the centered form). The classical formula on the sample index, a0 - a1 cos(2 pi n / (N-1)) + a2 cos(4 pi n / (N-1)) - ..., has alternating signs; both are the same window, and this one is scipy.signal.windows.general_cosine. Hann is [0.5 0.5], Hamming [0.54 0.46], Blackman [0.42 0.5 0.08], the 4-term Blackman-Harris [0.35875 0.48829 0.14128 0.01168].
Parameters:
N - number of samples, an integer >= 0options (optional map):
:coeffs - non-empty sequence of finite numbers [a0 a1 ...] with a0 > 0, default [0.5 0.5] (Hann):normalize? - default true: the samples are divided by the value at the middle, sum(a) (the maximum is 1 for odd N when the window is positive in the middle); false returns the raw samples of the function with the integral 1. Other values: :LInf (alias :Linf), :L1 (divides by the sum of the absolute values), :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the function sampled at N evenly spaced points from -0.5 to 0.5, both ends included. N = 0 returns () and N = 1 returns (1.0).
The negative values of the sum are kept: the family is not clipped (the flat-top coefficient sets have negative lobes), unlike the named positive windows such as blackman-harris. Throws ex-info (:type :invalid-input) for empty or non-numeric :coeffs, a0 <= 0 and an invalid N or :normalize?.
See also ->blackman-harris, hann, blackman, flat-top, flat-top-bk, hft248d.
Sum of cosines window `A (a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + ...)` for `x` in `[-0.5, 0.5]` with user coefficients; `A = 1 / a0`, so the integral is `1`.
The terms are added with the positive magnitudes `a0 a1 ...` (the centered form). The classical formula on the sample index, `a0 - a1 cos(2 pi n / (N-1)) + a2 cos(4 pi n / (N-1)) - ...`, has alternating signs; both are the same window, and this one is `scipy.signal.windows.general_cosine`. Hann is `[0.5 0.5]`, Hamming `[0.54 0.46]`, Blackman `[0.42 0.5 0.08]`, the 4-term Blackman-Harris `[0.35875 0.48829 0.14128 0.01168]`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:coeffs` - non-empty sequence of finite numbers `[a0 a1 ...]` with `a0 > 0`, default `[0.5 0.5]` (Hann)
- `:normalize?` - default `true`: the samples are divided by the value at the middle, `sum(a)` (the maximum is `1` for odd `N` when the window is positive in the middle); `false` returns the raw samples of the function with the integral `1`. Other values: `:LInf` (alias `:Linf`), `:L1` (divides by the sum of the absolute values), `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
The negative values of the sum are kept: the family is not clipped (the flat-top coefficient sets have negative lobes), unlike the named positive windows such as `blackman-harris`. Throws `ex-info` (`:type :invalid-input`) for empty or non-numeric `:coeffs`, `a0 <= 0` and an invalid `N` or `:normalize?`.
See also [[->blackman-harris]], [[hann]], [[blackman]], [[flat-top]], [[flat-top-bk]], [[hft248d]].(blackman-nutall)(blackman-nutall N)(blackman-nutall N opts)Blackman-Nuttall four-term window (Nuttall 1981; Heinzel et al. 2002: Nuttall4c).
The window is A (0.3635819 + 0.4891775 cos(2 pi x) + 0.1365995 cos(4 pi x) + 0.0106411 cos(6 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -98.2 dB. Equal to scipy.signal.windows.nuttall. Octave nuttallwin is a different window, nutall-1st. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also nutall-1st, blackman-harris-92db, nutall-3rd, blackman-harris-family.
Blackman-Nuttall four-term window (Nuttall 1981; Heinzel et al. 2002: Nuttall4c).
The window is `A (0.3635819 + 0.4891775 cos(2 pi x) + 0.1365995 cos(4 pi x) + 0.0106411 cos(6 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -98.2 dB. Equal to `scipy.signal.windows.nuttall`. Octave `nuttallwin` is a different window, [[nutall-1st]]. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[nutall-1st]], [[blackman-harris-92db]], [[nutall-3rd]], [[blackman-harris-family]].(blackman-nutall-continuous x)Blackman-Nuttall window, continuous function A (0.3635819 + 0.4891775 cos(2 pi x) + 0.1365995 cos(4 pi x) + 0.0106411 cos(6 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Blackman-Nuttall window, continuous function `A (0.3635819 + 0.4891775 cos(2 pi x) + 0.1365995 cos(4 pi x) + 0.0106411 cos(6 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(bohman)(bohman N)(bohman N opts)Bohman window (1 - u) cos(pi u) + sin(pi u) / pi, u = abs(2x): the convolution of two half cosine lobes.
Equal to scipy.signal.windows.bohman and Octave bohmanwin. The ends and the first two derivatives there are zero, the sidelobes drop as 1/f^4.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
Bohman window `(1 - u) cos(pi u) + sin(pi u) / pi`, `u = abs(2x)`: the convolution of two half cosine lobes.
Equal to `scipy.signal.windows.bohman` and Octave `bohmanwin`. The ends and the first two derivatives there are zero, the sidelobes drop as `1/f^4`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hann]], [[parzen]], [[cosine]].(bohman-continuous x)Bohman window, continuous function A ((1 - u) cos(pi u) + sin(pi u) / pi), u = abs(2x) (integral 1, zero ends).
Bohman window, continuous function `A ((1 - u) cos(pi u) + sin(pi u) / pi)`, `u = abs(2x)` (integral `1`, zero ends).
(cauchy)(cauchy N)(cauchy N opts)Cauchy (Lorentzian) window A / (1 + (2 alpha x)^2), A = alpha / atan(alpha).
Equal to parzen-geometric with :r 2. The ends are non-zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also parzen-geometric, gaussian, exponential.
Cauchy (Lorentzian) window `A / (1 + (2 alpha x)^2)`, `A = alpha / atan(alpha)`.
Equal to `parzen-geometric` with `:r 2`. The ends are non-zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[parzen-geometric]], [[gaussian]], [[exponential]].(connes)(connes N)(connes N opts)Connes window A (1 - (2x/alpha)^2)^2, the square of the Welch parabola.
alpha = 1 is the Connes window with zero ends; for alpha > 1 the ends are non-zero (a pedestal). For alpha < 1 the function is A (alpha^2 - 4 x^2)^2, which is zero at x = +-alpha/2 and rises again toward the ends: it is not a taper.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also welch, parzen-algebraic, power-of-cosine.
Connes window `A (1 - (2x/alpha)^2)^2`, the square of the Welch parabola.
`alpha = 1` is the Connes window with zero ends; for `alpha > 1` the ends are non-zero (a pedestal). For `alpha < 1` the function is `A (alpha^2 - 4 x^2)^2`, which is zero at `x = +-alpha/2` and rises again toward the ends: it is not a taper.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[welch]], [[parzen-algebraic]], [[power-of-cosine]].(continuous->window-fn continuous-window-fn)Converts a continuous function of one variable on [-0.5, 0.5] to a window function with the same options as the windows of this namespace.
Parameters:
continuous-window-fn - a function of one double, defined on [-0.5, 0.5] (it is called at the sample points and, for the default :normalize?, at 0.0)Returns a function (fn [] [N] [N options]) (N defaults to 256). The returned window function takes N, an integer >= 0, and the map options with the key :normalize? (default true). It returns a sequence of N doubles, the function sampled at N evenly spaced points from -0.5 to 0.5, both ends included, as sample-window does: true divides the samples by the function value at 0.0 (a negative value flips the sign of the window), false returns the raw samples, the other accepted values are :LInf (alias :Linf), :L1, :L2, :N and a finite non-zero number, see normalize-coefficients. nil is the default. The window function ignores :symmetric?; fastmath.kernel/window handles it.
N = 0 returns () and N = 1 returns (1.0) (default normalization). Throws ex-info (:type :invalid-input) for an invalid N or :normalize? and when the value at 0.0 is zero or not finite and :normalize? is true.
See also discrete->window-fn, sample-window.
Converts a continuous function of one variable on `[-0.5, 0.5]` to a window function with the same options as the windows of this namespace. Parameters: - `continuous-window-fn` - a function of one double, defined on `[-0.5, 0.5]` (it is called at the sample points and, for the default `:normalize?`, at `0.0`) Returns a function `(fn [] [N] [N options])` (`N` defaults to `256`). The returned window function takes `N`, an integer `>= 0`, and the map `options` with the key `:normalize?` (default `true`). It returns a sequence of `N` doubles, the function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included, as [[sample-window]] does: `true` divides the samples by the function value at `0.0` (a negative value flips the sign of the window), `false` returns the raw samples, the other accepted values are `:LInf` (alias `:Linf`), `:L1`, `:L2`, `:N` and a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default. The window function ignores `:symmetric?`; `fastmath.kernel/window` handles it. `N = 0` returns `()` and `N = 1` returns `(1.0)` (default normalization). Throws `ex-info` (`:type :invalid-input`) for an invalid `N` or `:normalize?` and when the value at `0.0` is zero or not finite and `:normalize?` is `true`. See also [[discrete->window-fn]], [[sample-window]].
(cosh)(cosh N)(cosh N opts)Cosh window A cosh(pi alpha s) / cosh(pi alpha), s = sqrt(1 - 4x^2), an approximation of the DPSS (Slepian) window.
It is the Kaiser-Bessel window with the Bessel function replaced by the hyperbolic cosine (Doerry, catalog).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 2.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser-bessel, knab, avci-nacaroglu, bessel-I1.
Cosh window `A cosh(pi alpha s) / cosh(pi alpha)`, `s = sqrt(1 - 4x^2)`, an approximation of the DPSS (Slepian) window.
It is the Kaiser-Bessel window with the Bessel function replaced by the hyperbolic cosine (Doerry, catalog).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `2.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser-bessel]], [[knab]], [[avci-nacaroglu]], [[bessel-I1]].(cosine)(cosine N)(cosine N opts)Cosine (sine) window sin(pi (n + 1/2) / N), n = 0, ..., N-1: the half-sample shifted cosine lobe, all values are positive and the ends are non-zero (sin(pi / (2 N))).
Parameters:
N - number of samplesoptions:
:normalize? - default false, the values of the formula (the maximum is 1 for odd N, as in scipy.signal.windows.cosine, and cos(pi / (2 N)) for even N); true is :LInf (the maximum becomes 1). The other accepted values are :L1, :L2, :N and a finite non-zero number, see normalize-coefficients.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
This is a discrete window defined on the index (it is not a sample of a continuous function at the points -0.5, ..., 0.5), the raw scale is the formula, not the mean 1 scale. It is equal to scipy.signal.windows.cosine (symmetric and, through fastmath.kernel/window with :symmetric? false, periodic) and it is not power-of-cosine with m = 1 (that one has zero ends, see cosine-continuous).
See also cosine-continuous, power-of-cosine, vorbis, hann.
Cosine (sine) window `sin(pi (n + 1/2) / N)`, `n = 0, ..., N-1`: the half-sample shifted cosine lobe, all values are positive and the ends are non-zero (`sin(pi / (2 N))`).
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `false`, the values of the formula (the maximum is `1` for odd `N`, as in `scipy.signal.windows.cosine`, and `cos(pi / (2 N))` for even `N`); `true` is `:LInf` (the maximum becomes `1`). The other accepted values are `:L1`, `:L2`, `:N` and a finite non-zero number, see [[normalize-coefficients]].
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
This is a discrete window defined on the index (it is not a sample of a continuous function at the points `-0.5, ..., 0.5`), the raw scale is the formula, not the mean `1` scale. It is equal to `scipy.signal.windows.cosine` (symmetric and, through `fastmath.kernel/window` with `:symmetric? false`, periodic) and it is not `power-of-cosine` with `m = 1` (that one has zero ends, see [[cosine-continuous]]).
See also [[cosine-continuous]], [[power-of-cosine]], [[vorbis]], [[hann]].(cosine-continuous x)Cosine window, continuous function pi/2 cos(pi x) on [-0.5, 0.5] (integral 1). Sampled at the points -0.5, ..., 0.5 it is power-of-cosine with m = 1, which is not the discrete cosine window.
Cosine window, continuous function `pi/2 cos(pi x)` on `[-0.5, 0.5]` (integral `1`). Sampled at the points `-0.5, ..., 0.5` it is [[power-of-cosine]] with `m = 1`, which is not the discrete [[cosine]] window.
(de-la-vallee-poussin)(de-la-vallee-poussin N)(de-la-vallee-poussin N opts)De la Vallee-Poussin window A sinc(2x)^4, the fourth power of the sinc lobe.
Equal to lanczos with :L 4.0. The ends are zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
De la Vallee-Poussin window `A sinc(2x)^4`, the fourth power of the sinc lobe.
Equal to `lanczos` with `:L 4.0`. The ends are zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[lanczos]], [[sinc]], [[fejer]].(de-la-vallee-poussin-continuous x)De la Vallee-Poussin window, continuous function A sinc(2x)^4 on [-0.5, 0.5] (integral 1, zero ends).
De la Vallee-Poussin window, continuous function `A sinc(2x)^4` on `[-0.5, 0.5]` (integral `1`, zero ends).
(discrete->window-fn discrete-window-fn)Converts a function of the window length to a window function with the same options as the windows of this namespace.
Parameters:
discrete-window-fn - a function of N (a long >= 2) returning a sequence of N numbers, the window coefficientsReturns a function (fn [] [N] [N options]) (N defaults to 256). The returned window function takes N, an integer >= 0, and the map options with the key :normalize? (default true, which is :LInf: the coefficients are divided by the largest absolute value). false returns the coefficients of discrete-window-fn as they are (the type of the returned sequence is passed through), the other accepted values are :L1, :L2, :N and a finite non-zero number, see normalize-coefficients. nil is the default.
N = 0 returns () and N = 1 returns (1.0) without calling discrete-window-fn. Throws ex-info (:type :invalid-input) for an invalid N or :normalize?. The window function ignores :symmetric?; fastmath.kernel/window handles it.
See also continuous->window-fn, normalize-coefficients.
Converts a function of the window length to a window function with the same options as the windows of this namespace. Parameters: - `discrete-window-fn` - a function of `N` (a long `>= 2`) returning a sequence of `N` numbers, the window coefficients Returns a function `(fn [] [N] [N options])` (`N` defaults to `256`). The returned window function takes `N`, an integer `>= 0`, and the map `options` with the key `:normalize?` (default `true`, which is `:LInf`: the coefficients are divided by the largest absolute value). `false` returns the coefficients of `discrete-window-fn` as they are (the type of the returned sequence is passed through), the other accepted values are `:L1`, `:L2`, `:N` and a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default. `N = 0` returns `()` and `N = 1` returns `(1.0)` without calling `discrete-window-fn`. Throws `ex-info` (`:type :invalid-input`) for an invalid `N` or `:normalize?`. The window function ignores `:symmetric?`; `fastmath.kernel/window` handles it. See also [[continuous->window-fn]], [[normalize-coefficients]].
(dolph-chebyshev)(dolph-chebyshev N)(dolph-chebyshev N opts)Dolph-Chebyshev window: all sidelobes of the spectrum have the same level (equiripple).
The window is the inverse DFT of the Chebyshev polynomial T_(N-1)(x0 cos(pi k / N)) spectrum, x0 = cosh(acosh(10^(abs(level)/20)) / (N - 1)). Equal to scipy.signal.windows.chebwin(N, at) and Octave chebwin(N, at) with level = -at. The peak sidelobe level is the requested level (measured -30.00, -50.00, -80.00 and -100.00 dB for these levels, N = 2049). The cost is quadratic in N (about 10 ms for N = 1000).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:level - sidelobe level in dB, finite number, abs is taken (so 50 and -50 are the same), abs(level) <= 5000, default -50.0:normalize? - default true (:LInf: the coefficients are divided by the largest absolute value, the maximum becomes 1); false returns the raw window (mean 1, sum N); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
The accuracy is limited to about 1e-16 N^2 by the conditioning of the Chebyshev polynomial near its argument 1: 2.5e-14 for N = 64, 4.7e-13 for N = 256 and 5e-11 for N = 2000 against a 60 digit reference. scipy and Octave have the same error, so windows of several hundred samples differ between the libraries by about 1e-13.
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also ultraspherical, saramaki, legendre, taylor, kaiser.
Dolph-Chebyshev window: all sidelobes of the spectrum have the same level (equiripple).
The window is the inverse DFT of the Chebyshev polynomial `T_(N-1)(x0 cos(pi k / N))` spectrum, `x0 = cosh(acosh(10^(abs(level)/20)) / (N - 1))`. Equal to `scipy.signal.windows.chebwin(N, at)` and Octave `chebwin(N, at)` with `level = -at`. The peak sidelobe level is the requested level (measured -30.00, -50.00, -80.00 and -100.00 dB for these levels, `N` = 2049). The cost is quadratic in `N` (about 10 ms for `N` = 1000).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:level` - sidelobe level in dB, finite number, `abs` is taken (so `50` and `-50` are the same), `abs(level) <= 5000`, default `-50.0`
- `:normalize?` - default `true` (`:LInf`: the coefficients are divided by the largest absolute value, the maximum becomes `1`); `false` returns the raw window (mean `1`, sum `N`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
The accuracy is limited to about `1e-16 N^2` by the conditioning of the Chebyshev polynomial near its argument `1`: 2.5e-14 for `N` = 64, 4.7e-13 for `N` = 256 and 5e-11 for `N` = 2000 against a 60 digit reference. scipy and Octave have the same error, so windows of several hundred samples differ between the libraries by about `1e-13`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[ultraspherical]], [[saramaki]], [[legendre]], [[taylor]], [[kaiser]].(exponential)(exponential N)(exponential N opts)Exponential (Poisson) window A exp(-2 alpha abs(x)), A = alpha / (1 - exp(-alpha)).
The value at the ends is exp(-alpha) of the middle value. alpha is the decay over the half length. Equal to scipy.signal.windows.exponential with the center at the middle and tau = (N - 1) / (2 alpha).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - decay, number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hanning-poisson, gaussian, cauchy, parzen-exponential.
Exponential (Poisson) window `A exp(-2 alpha abs(x))`, `A = alpha / (1 - exp(-alpha))`.
The value at the ends is `exp(-alpha)` of the middle value. `alpha` is the decay over the half length. Equal to `scipy.signal.windows.exponential` with the center at the middle and `tau = (N - 1) / (2 alpha)`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - decay, number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hanning-poisson]], [[gaussian]], [[cauchy]], [[parzen-exponential]].(fejer)(fejer N)(fejer N opts)Fejer window A sinc(2x)^2, the square of the sinc lobe.
Equal to lanczos with :L 2.0. The ends are zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also lanczos, sinc, de-la-vallee-poussin.
Fejer window `A sinc(2x)^2`, the square of the sinc lobe.
Equal to `lanczos` with `:L 2.0`. The ends are zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[lanczos]], [[sinc]], [[de-la-vallee-poussin]].(fejer-continuous x)Fejer window, continuous function A sinc(2x)^2 on [-0.5, 0.5] (integral 1, zero ends).
Fejer window, continuous function `A sinc(2x)^2` on `[-0.5, 0.5]` (integral `1`, zero ends).
(flat-top)(flat-top N)(flat-top N opts)Flat-top window of scipy and Matlab, a sum of five cosine terms for amplitude measurements.
The window is A (0.21557895 + 0.41663158 cos(2 pi x) + 0.277263158 cos(4 pi x) + 0.083578947 cos(6 pi x) + 0.006947368 cos(8 pi x)) (the centered form of the alternating sign formula). Equal to scipy.signal.windows.flattop and Matlab flattopwin: the coefficients sum to 1.000000003, so the default :normalize? differs from scipy by 3e-9. The window has negative lobes (not clipped) and a small jump at the ends; the peak sidelobe level is about -93.0 dB, the sidelobes drop as 1/f. Octave flattopwin is another set, flat-top-bk.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also flat-top-3, flat-top-bk, flat-top-hp, hft95, blackman-harris-family.
Flat-top window of scipy and Matlab, a sum of five cosine terms for amplitude measurements.
The window is `A (0.21557895 + 0.41663158 cos(2 pi x) + 0.277263158 cos(4 pi x) + 0.083578947 cos(6 pi x) + 0.006947368 cos(8 pi x))` (the centered form of the alternating sign formula). Equal to `scipy.signal.windows.flattop` and Matlab `flattopwin`: the coefficients sum to `1.000000003`, so the default `:normalize?` differs from scipy by `3e-9`. The window has negative lobes (not clipped) and a small jump at the ends; the peak sidelobe level is about -93.0 dB, the sidelobes drop as `1/f`. Octave `flattopwin` is another set, [[flat-top-bk]].
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[flat-top-3]], [[flat-top-bk]], [[flat-top-hp]], [[hft95]], [[blackman-harris-family]].(flat-top-3)(flat-top-3 N)(flat-top-3 N opts)Flat-top window FTNI of the National Instruments software, a sum of three cosine terms.
The window is A (0.2810639 + 0.5208972 cos(2 pi x) + 0.1980399 cos(4 pi x)) (Heinzel et al. 2002, section D.2.1). The peak sidelobe level is about -44.4 dB, the sidelobes drop as 1/f. The window has negative lobes (not clipped) and a jump at the ends.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also flat-top, flat-top-hp, flat-top-bk, blackman-harris-family.
Flat-top window FTNI of the National Instruments software, a sum of three cosine terms.
The window is `A (0.2810639 + 0.5208972 cos(2 pi x) + 0.1980399 cos(4 pi x))` (Heinzel et al. 2002, section D.2.1). The peak sidelobe level is about -44.4 dB, the sidelobes drop as `1/f`. The window has negative lobes (not clipped) and a jump at the ends.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[flat-top]], [[flat-top-hp]], [[flat-top-bk]], [[blackman-harris-family]].(flat-top-3-continuous x)Flat-top window FTNI, continuous function A (0.2810639 + 0.5208972 cos(2 pi x) + 0.1980399 cos(4 pi x)) (integral 1); it has negative values.
Flat-top window FTNI, continuous function `A (0.2810639 + 0.5208972 cos(2 pi x) + 0.1980399 cos(4 pi x))` (integral `1`); it has negative values.
(flat-top-bk)(flat-top-bk N)(flat-top-bk N opts)Flat-top window of Gade and Herlufsen (1987, Bruel and Kjaer), a sum of five cosine terms with the positive magnitudes 1, 1.93, 1.29, 0.388, 0.0322 (centered form); with the default :normalize? it is equal to Octave flattopwin (the coefficients 1, 1.93, 1.29, 0.388, 0.0322 divided by their sum, the value of the middle).
The peak sidelobe level is -68.3 dB (first zero at 5 bins), the normalized equivalent noise bandwidth is 3.7703 bins. The window has negative lobes and a small jump at the ends (about 0.0009 of the middle value). It is not the window of scipy.signal.windows.flattop (that one is flat-top).
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also flat-top-srs, flat-top, flat-top-hp, blackman-harris-family.
Flat-top window of Gade and Herlufsen (1987, Bruel and Kjaer), a sum of five cosine terms with the positive magnitudes `1, 1.93, 1.29, 0.388, 0.0322` (centered form); with the default `:normalize?` it is equal to Octave `flattopwin` (the coefficients `1, 1.93, 1.29, 0.388, 0.0322` divided by their sum, the value of the middle).
The peak sidelobe level is -68.3 dB (first zero at 5 bins), the normalized equivalent noise bandwidth is 3.7703 bins. The window has negative lobes and a small jump at the ends (about `0.0009` of the middle value). It is not the window of `scipy.signal.windows.flattop` (that one is [[flat-top]]).
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[flat-top-srs]], [[flat-top]], [[flat-top-hp]], [[blackman-harris-family]].(flat-top-bk-continuous x)Flat-top BK window, continuous function A (1 + 1.93 cos(2 pi x) + 1.29 cos(4 pi x) + 0.388 cos(6 pi x) + 0.0322 cos(8 pi x)) with the integral 1; it has negative values.
Flat-top BK window, continuous function `A (1 + 1.93 cos(2 pi x) + 1.29 cos(4 pi x) + 0.388 cos(6 pi x) + 0.0322 cos(8 pi x))` with the integral `1`; it has negative values.
(flat-top-continuous x)Flat-top window of scipy, continuous function A (0.21557895 + 0.41663158 cos(2 pi x) + 0.277263158 cos(4 pi x) + 0.083578947 cos(6 pi x) + 0.006947368 cos(8 pi x)) (integral 1); it has negative values.
Flat-top window of scipy, continuous function `A (0.21557895 + 0.41663158 cos(2 pi x) + 0.277263158 cos(4 pi x) + 0.083578947 cos(6 pi x) + 0.006947368 cos(8 pi x))` (integral `1`); it has negative values.
(flat-top-hp)(flat-top-hp N)(flat-top-hp N opts)Flat-top window of the old Hewlett-Packard spectrum analyzers (FTHP of Heinzel et al. 2002, section D.2.2), a sum of four cosine terms with the positive magnitudes 1, 1.912510941, 1.079173272, 0.1832630879 (centered form).
The peak sidelobe level is -70.4 dB (first zero at 4 bins, sidelobes drop as 1/f), the normalized equivalent noise bandwidth is 3.4279 bins and the amplitude flatness error 0.0096 dB. The window has negative lobes and a jump at the ends (about -0.004 of the middle value for the default :normalize?). The window has the same sidelobe level as hft70, which has a smaller flatness error.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft70, flat-top-srs, flat-top-bk, flat-top, flat-top-3, blackman-harris-family.
Flat-top window of the old Hewlett-Packard spectrum analyzers (FTHP of Heinzel et al. 2002, section D.2.2), a sum of four cosine terms with the positive magnitudes `1, 1.912510941, 1.079173272, 0.1832630879` (centered form).
The peak sidelobe level is -70.4 dB (first zero at 4 bins, sidelobes drop as `1/f`), the normalized equivalent noise bandwidth is 3.4279 bins and the amplitude flatness error 0.0096 dB. The window has negative lobes and a jump at the ends (about `-0.004` of the middle value for the default `:normalize?`). The window has the same sidelobe level as [[hft70]], which has a smaller flatness error.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft70]], [[flat-top-srs]], [[flat-top-bk]], [[flat-top]], [[flat-top-3]], [[blackman-harris-family]].(flat-top-hp-continuous x)Flat-top HP window (FTHP), continuous function A (1 + 1.912510941 cos(2 pi x) + 1.079173272 cos(4 pi x) + 0.1832630879 cos(6 pi x)) with the integral 1; it has negative values.
Flat-top HP window (FTHP), continuous function `A (1 + 1.912510941 cos(2 pi x) + 1.079173272 cos(4 pi x) + 0.1832630879 cos(6 pi x))` with the integral `1`; it has negative values.
(flat-top-srs)(flat-top-srs N)(flat-top-srs N opts)Flat-top window of the Stanford Research SR785 spectrum analyzer (FTSRS of Heinzel et al. 2002, section D.2.4), a sum of five cosine terms with the positive magnitudes 1, 1.93, 1.29, 0.388, 0.028 (centered form).
The peak sidelobe level is -76.6 dB (first zero at 4.72 bins, sidelobes drop as 1/f^3), the normalized equivalent noise bandwidth is 3.7702 bins and the amplitude flatness error -0.0156 dB. The window is zero at the ends and has negative lobes. It differs from flat-top-bk only in the last coefficient.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also flat-top-bk, flat-top-hp, hft90d, flat-top, blackman-harris-family.
Flat-top window of the Stanford Research SR785 spectrum analyzer (FTSRS of Heinzel et al. 2002, section D.2.4), a sum of five cosine terms with the positive magnitudes `1, 1.93, 1.29, 0.388, 0.028` (centered form).
The peak sidelobe level is -76.6 dB (first zero at 4.72 bins, sidelobes drop as `1/f^3`), the normalized equivalent noise bandwidth is 3.7702 bins and the amplitude flatness error -0.0156 dB. The window is zero at the ends and has negative lobes. It differs from [[flat-top-bk]] only in the last coefficient.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[flat-top-bk]], [[flat-top-hp]], [[hft90d]], [[flat-top]], [[blackman-harris-family]].(flat-top-srs-continuous x)Flat-top SRS window (FTSRS), continuous function A (1 + 1.93 cos(2 pi x) + 1.29 cos(4 pi x) + 0.388 cos(6 pi x) + 0.028 cos(8 pi x)) with the integral 1; it has negative values.
Flat-top SRS window (FTSRS), continuous function `A (1 + 1.93 cos(2 pi x) + 1.29 cos(4 pi x) + 0.388 cos(6 pi x) + 0.028 cos(8 pi x))` with the integral `1`; it has negative values.
(gaussian)(gaussian N)(gaussian N opts)Truncated gaussian window A exp(-2 alpha^2 x^2), A = alpha sqrt(2/pi) / erf(alpha / sqrt(2)).
The standard deviation is sigma = 1 / (2 alpha) of the window length, so alpha is the number of standard deviations from the middle to each end. Equal to scipy.signal.windows.gaussian with std = (N - 1) / (2 alpha) and to Octave gausswin(N, alpha). The ends are non-zero (exp(-alpha^2 / 2) of the middle).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - truncation in standard deviations, number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also general-gaussian, exponential, kaiser, parzen-exponential.
Truncated gaussian window `A exp(-2 alpha^2 x^2)`, `A = alpha sqrt(2/pi) / erf(alpha / sqrt(2))`.
The standard deviation is `sigma = 1 / (2 alpha)` of the window length, so `alpha` is the number of standard deviations from the middle to each end. Equal to `scipy.signal.windows.gaussian` with `std = (N - 1) / (2 alpha)` and to Octave `gausswin(N, alpha)`. The ends are non-zero (`exp(-alpha^2 / 2)` of the middle).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - truncation in standard deviations, number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[general-gaussian]], [[exponential]], [[kaiser]], [[parzen-exponential]].(general-gaussian)(general-gaussian N)(general-gaussian N opts)Generalized gaussian window A exp(-0.5 abs(x / sig)^(2 p)) for x in [-0.5, 0.5]; p = 1 is the gaussian window, a larger p gives a flatter top and steeper sides, a smaller p a more peaked shape.
Parameters:
N - number of samplesoptions:
:p - shape, number in (0, 1000], default 1.5:sig - width, number > 0, default 0.25. It is the width in units of the window length, so the window is N independent: scipy.signal.windows.general_gaussian(N, p, sig * (N - 1)) is the same window (the sig of scipy is in samples). p = 1 and sig = 1 / (2 alpha) is gaussian with alpha.:normalize? - default true (division by the value at the middle); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info for a p or sig outside of its domain and for a sig so small that the window has no non-zero sample.
See also gaussian, parzen-exponential (r = 2 p, the same family with a different parametrization).
Generalized gaussian window `A exp(-0.5 abs(x / sig)^(2 p))` for `x` in `[-0.5, 0.5]`; `p = 1` is the gaussian window, a larger `p` gives a flatter top and steeper sides, a smaller `p` a more peaked shape.
Parameters:
- `N` - number of samples
- `options`:
- `:p` - shape, number in `(0, 1000]`, default `1.5`
- `:sig` - width, number `> 0`, default `0.25`. It is the width in units of the window length, so the window is `N` independent: `scipy.signal.windows.general_gaussian(N, p, sig * (N - 1))` is the same window (the `sig` of scipy is in samples). `p = 1` and `sig = 1 / (2 alpha)` is `gaussian` with `alpha`.
- `:normalize?` - default `true` (division by the value at the middle); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` for a `p` or `sig` outside of its domain and for a `sig` so small that the window has no non-zero sample.
See also [[gaussian]], [[parzen-exponential]] (`r = 2 p`, the same family with a different parametrization).(hamming)(hamming N)(hamming N opts)Hamming window 0.54 + 0.46 cos(2 pi x), the raised cosine with alpha = 0.54.
Equal to scipy.signal.windows.hamming and Octave hamming. The ends are non-zero (0.08), the peak sidelobe level is about -42.7 dB. The coefficient 0.54 is a rounded value of 25/46, see hamming-exact.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hamming-exact, hann, raised-cosine, blackman.
Hamming window `0.54 + 0.46 cos(2 pi x)`, the raised cosine with `alpha = 0.54`.
Equal to `scipy.signal.windows.hamming` and Octave `hamming`. The ends are non-zero (`0.08`), the peak sidelobe level is about -42.7 dB. The coefficient `0.54` is a rounded value of `25/46`, see `hamming-exact`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hamming-exact]], [[hann]], [[raised-cosine]], [[blackman]].(hamming-continuous x)Hamming window, continuous function A (1 + (23/27) cos(2 pi x)), that is 0.54 + 0.46 cos(2 pi x) scaled to the integral 1.
Hamming window, continuous function `A (1 + (23/27) cos(2 pi x))`, that is `0.54 + 0.46 cos(2 pi x)` scaled to the integral `1`.
(hamming-exact)(hamming-exact N)(hamming-exact N opts)Hamming window with the exact coefficients 25/46 + 21/46 cos(2 pi x), the raised cosine with alpha = 25/46.
The coefficients cancel the first sidelobe of the Hann window (a zero of the spectrum at 2.5 bins); the peak sidelobe level is about -41.7 dB. Equal to scipy.signal.windows.general_hamming with alpha = 25/46 and to webster-hamming with :v 0.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hamming, hann, raised-cosine, webster-hamming.
Hamming window with the exact coefficients `25/46 + 21/46 cos(2 pi x)`, the raised cosine with `alpha = 25/46`.
The coefficients cancel the first sidelobe of the Hann window (a zero of the spectrum at 2.5 bins); the peak sidelobe level is about -41.7 dB. Equal to `scipy.signal.windows.general_hamming` with `alpha = 25/46` and to `webster-hamming` with `:v 0`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hamming]], [[hann]], [[raised-cosine]], [[webster-hamming]].(hamming-exact-continuous x)Hamming window with the exact coefficients, continuous function A (1 + 0.84 cos(2 pi x)), that is 25/46 + 21/46 cos(2 pi x) scaled to the integral 1.
Hamming window with the exact coefficients, continuous function `A (1 + 0.84 cos(2 pi x))`, that is `25/46 + 21/46 cos(2 pi x)` scaled to the integral `1`.
(hann)(hann N)(hann N opts)Hann (Hanning) window 0.5 + 0.5 cos(2 pi x), the raised cosine with alpha = 0.5.
Equal to scipy.signal.windows.hann and Octave hann (symmetric; the Octave function hanning is a different window without the zero ends). The ends are zero, the peak sidelobe level is -31.5 dB, the sidelobes drop as 1/f^3. Equal to power-of-cosine with :m 2, to tukey with :alpha 1 and to blackman-harris-family with :coeffs [0.5 0.5].
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hamming, raised-cosine, tukey, power-of-cosine, blackman.
Hann (Hanning) window `0.5 + 0.5 cos(2 pi x)`, the raised cosine with `alpha = 0.5`.
Equal to `scipy.signal.windows.hann` and Octave `hann` (symmetric; the Octave function `hanning` is a different window without the zero ends). The ends are zero, the peak sidelobe level is -31.5 dB, the sidelobes drop as `1/f^3`. Equal to `power-of-cosine` with `:m 2`, to `tukey` with `:alpha 1` and to `blackman-harris-family` with `:coeffs [0.5 0.5]`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hamming]], [[raised-cosine]], [[tukey]], [[power-of-cosine]], [[blackman]].(hann-continuous x)Hann window, continuous function 1 + cos(2 pi x) on [-0.5, 0.5] (integral 1, zero ends).
Hann window, continuous function `1 + cos(2 pi x)` on `[-0.5, 0.5]` (integral `1`, zero ends).
(hanning-poisson)(hanning-poisson N)(hanning-poisson N opts)Hanning-Poisson window, the product of the Hann and the exponential window A (1 + cos(2 pi x)) exp(-2 alpha abs(x)).
The ends are zero; alpha is the decay of the exponential factor.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - decay, number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hann, exponential, gaussian.
Hanning-Poisson window, the product of the Hann and the exponential window `A (1 + cos(2 pi x)) exp(-2 alpha abs(x))`.
The ends are zero; `alpha` is the decay of the exponential factor.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - decay, number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hann]], [[exponential]], [[gaussian]].(hft116d)(hft116d N)(hft116d N opts)HFT116D flat-top window (Heinzel et al. 2002, section D.3.4), a sum of six cosine terms with the positive magnitudes 1, 1.9575375, 1.4780705, 0.6367431, 0.1228389, 0.0066288 (centered form). The coefficients satisfy 1 - a1 + a2 - a3 + a4 - a5 = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The peak sidelobe level is -116.8 dB (first zero at 6 bins), the normalized equivalent noise bandwidth is 4.2186 bins and the amplitude flatness error -0.0028 dB. The window has negative lobes.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft90d, hft144d, flat-top, blackman-harris-family.
HFT116D flat-top window (Heinzel et al. 2002, section D.3.4), a sum of six cosine terms with the positive magnitudes `1, 1.9575375, 1.4780705, 0.6367431, 0.1228389, 0.0066288` (centered form). The coefficients satisfy `1 - a1 + a2 - a3 + a4 - a5 = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The peak sidelobe level is -116.8 dB (first zero at 6 bins), the normalized equivalent noise bandwidth is 4.2186 bins and the amplitude flatness error -0.0028 dB. The window has negative lobes.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft90d]], [[hft144d]], [[flat-top]], [[blackman-harris-family]].(hft116d-continuous x)HFT116D flat-top window, continuous function A (1 + 1.9575375 cos(2 pi x) + 1.4780705 cos(4 pi x) + 0.6367431 cos(6 pi x) + 0.1228389 cos(8 pi x) + 0.0066288 cos(10 pi x)) with the integral 1; it has negative values and is zero at both ends.
HFT116D flat-top window, continuous function `A (1 + 1.9575375 cos(2 pi x) + 1.4780705 cos(4 pi x) + 0.6367431 cos(6 pi x) + 0.1228389 cos(8 pi x) + 0.0066288 cos(10 pi x))` with the integral `1`; it has negative values and is zero at both ends.
(hft144d)(hft144d N)(hft144d N opts)HFT144D flat-top window (Heinzel et al. 2002, section D.3.5), a sum of seven cosine terms with the positive magnitudes 1, 1.96760033, 1.57983607, 0.81123644, 0.22583558, 0.02773848, 0.0009036 (centered form). The coefficients satisfy 1 - a1 + a2 - ... = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The peak sidelobe level is -144.1 dB (first zero at 7 bins), the normalized equivalent noise bandwidth is 4.5386 bins and the amplitude flatness error 0.0021 dB. The window has negative lobes.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft116d, hft169d, flat-top, blackman-harris-family.
HFT144D flat-top window (Heinzel et al. 2002, section D.3.5), a sum of seven cosine terms with the positive magnitudes `1, 1.96760033, 1.57983607, 0.81123644, 0.22583558, 0.02773848, 0.0009036` (centered form). The coefficients satisfy `1 - a1 + a2 - ... = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The peak sidelobe level is -144.1 dB (first zero at 7 bins), the normalized equivalent noise bandwidth is 4.5386 bins and the amplitude flatness error 0.0021 dB. The window has negative lobes.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft116d]], [[hft169d]], [[flat-top]], [[blackman-harris-family]].(hft144d-continuous x)HFT144D flat-top window, continuous function A (1 + a1 cos(2 pi x) + ... + a6 cos(12 pi x)) with the integral 1 (coefficients see hft144d); it has negative values and is zero at both ends.
HFT144D flat-top window, continuous function `A (1 + a1 cos(2 pi x) + ... + a6 cos(12 pi x))` with the integral `1` (coefficients see [[hft144d]]); it has negative values and is zero at both ends.
(hft169d)(hft169d N)(hft169d N opts)HFT169D flat-top window (Heinzel et al. 2002, section D.3.6), a sum of eight cosine terms with the positive magnitudes 1, 1.97441842, 1.65409888, 0.95788186, 0.33673418, 0.06364621, 0.00521942, 0.00010599 (centered form). The coefficients satisfy 1 - a1 + a2 - ... = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The fourth coefficient is 0.33673418; the report prints 0.33673420, for which the alternating sum is 2e-8 instead of 0 and the peak sidelobe level is only -167.9 dB. With 0.33673418 the sum is zero and the peak sidelobe level is -169.5 dB at 10.41 bins, as the report states.
The first zero is at 8 bins, the normalized equivalent noise bandwidth is 4.8347 bins and the amplitude flatness error 0.0017 dB. The window has negative lobes.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft144d, hft196d, flat-top, blackman-harris-family.
HFT169D flat-top window (Heinzel et al. 2002, section D.3.6), a sum of eight cosine terms with the positive magnitudes `1, 1.97441842, 1.65409888, 0.95788186, 0.33673418, 0.06364621, 0.00521942, 0.00010599` (centered form). The coefficients satisfy `1 - a1 + a2 - ... = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The fourth coefficient is `0.33673418`; the report prints `0.33673420`, for which the alternating sum is `2e-8` instead of 0 and the peak sidelobe level is only -167.9 dB. With `0.33673418` the sum is zero and the peak sidelobe level is -169.5 dB at 10.41 bins, as the report states.
The first zero is at 8 bins, the normalized equivalent noise bandwidth is 4.8347 bins and the amplitude flatness error 0.0017 dB. The window has negative lobes.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft144d]], [[hft196d]], [[flat-top]], [[blackman-harris-family]].(hft169d-continuous x)HFT169D flat-top window, continuous function A (1 + a1 cos(2 pi x) + ... + a7 cos(14 pi x)) with the integral 1 (coefficients see hft169d); it has negative values and is zero at both ends.
HFT169D flat-top window, continuous function `A (1 + a1 cos(2 pi x) + ... + a7 cos(14 pi x))` with the integral `1` (coefficients see [[hft169d]]); it has negative values and is zero at both ends.
(hft196d)(hft196d N)(hft196d N opts)HFT196D flat-top window (Heinzel et al. 2002, section D.3.7), a sum of nine cosine terms with the positive magnitudes 1, 1.97928042, 1.710288951, 1.081629853, 0.448734314, 0.112376628, 0.015122992, 0.000871252, 0.000011896 (centered form). The coefficients satisfy 1 - a1 + a2 - ... = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The peak sidelobe level is -196.2 dB at 9.06 bins (first zero at 9 bins), the normalized equivalent noise bandwidth is 5.1134 bins and the amplitude flatness error 0.0013 dB. The window has negative lobes. Double precision samples reproduce the sidelobe level (measured -196.2 dB with an FFT of 8192 samples).
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft169d, hft223d, flat-top, blackman-harris-family.
HFT196D flat-top window (Heinzel et al. 2002, section D.3.7), a sum of nine cosine terms with the positive magnitudes `1, 1.97928042, 1.710288951, 1.081629853, 0.448734314, 0.112376628, 0.015122992, 0.000871252, 0.000011896` (centered form). The coefficients satisfy `1 - a1 + a2 - ... = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The peak sidelobe level is -196.2 dB at 9.06 bins (first zero at 9 bins), the normalized equivalent noise bandwidth is 5.1134 bins and the amplitude flatness error 0.0013 dB. The window has negative lobes. Double precision samples reproduce the sidelobe level (measured -196.2 dB with an FFT of 8192 samples).
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft169d]], [[hft223d]], [[flat-top]], [[blackman-harris-family]].(hft196d-continuous x)HFT196D flat-top window, continuous function A (1 + a1 cos(2 pi x) + ... + a8 cos(16 pi x)) with the integral 1 (coefficients see hft196d); it has negative values and is zero at both ends.
HFT196D flat-top window, continuous function `A (1 + a1 cos(2 pi x) + ... + a8 cos(16 pi x))` with the integral `1` (coefficients see [[hft196d]]); it has negative values and is zero at both ends.
(hft223d)(hft223d N)(hft223d N opts)HFT223D flat-top window (Heinzel et al. 2002, section D.3.8), a sum of ten cosine terms with the positive magnitudes 1, 1.98298997309, 1.75556083063, 1.19037717712, 0.56155440797, 0.17296769663, 0.03233247087, 0.00324954578, 0.0001380104, 0.00000132725 (centered form). The coefficients satisfy 1 - a1 + a2 - ... = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The peak sidelobe level is -223.0 dB at 11.38 bins (first zero at 10 bins), the normalized equivalent noise bandwidth is 5.3888 bins and the amplitude flatness error -0.0011 dB. The window has negative lobes. Double precision samples reproduce the sidelobe level (measured -223.0 dB with an FFT of 8192 samples).
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft196d, hft248d, flat-top, blackman-harris-family.
HFT223D flat-top window (Heinzel et al. 2002, section D.3.8), a sum of ten cosine terms with the positive magnitudes `1, 1.98298997309, 1.75556083063, 1.19037717712, 0.56155440797, 0.17296769663, 0.03233247087, 0.00324954578, 0.0001380104, 0.00000132725` (centered form). The coefficients satisfy `1 - a1 + a2 - ... = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The peak sidelobe level is -223.0 dB at 11.38 bins (first zero at 10 bins), the normalized equivalent noise bandwidth is 5.3888 bins and the amplitude flatness error -0.0011 dB. The window has negative lobes. Double precision samples reproduce the sidelobe level (measured -223.0 dB with an FFT of 8192 samples).
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft196d]], [[hft248d]], [[flat-top]], [[blackman-harris-family]].(hft223d-continuous x)HFT223D flat-top window, continuous function A (1 + a1 cos(2 pi x) + ... + a9 cos(18 pi x)) with the integral 1 (coefficients see hft223d); it has negative values and is zero at both ends.
HFT223D flat-top window, continuous function `A (1 + a1 cos(2 pi x) + ... + a9 cos(18 pi x))` with the integral `1` (coefficients see [[hft223d]]); it has negative values and is zero at both ends.
(hft248d)(hft248d N)(hft248d N opts)HFT248D flat-top window (Heinzel et al. 2002, section D.3.9), a sum of eleven cosine terms with the positive magnitudes 1, 1.985844164102, 1.791176438506, 1.282075284005, 0.667777530266, 0.240160796576, 0.056656381764, 0.008134974479, 0.00062454465, 0.000019808998, 0.000000132974 (centered form). The coefficients satisfy 1 - a1 + a2 - ... = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The peak sidelobe level is -248.4 dB at 13.37 bins (first zero at 11 bins), the normalized equivalent noise bandwidth is 5.6512 bins and the amplitude flatness error 0.0009 dB. The window has negative lobes. Double precision samples reproduce the sidelobe level (measured -248.4 dB with an FFT of 8192 samples), the sidelobes are below the precision of most signals.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft223d, hft196d, flat-top, blackman-harris-family.
HFT248D flat-top window (Heinzel et al. 2002, section D.3.9), a sum of eleven cosine terms with the positive magnitudes `1, 1.985844164102, 1.791176438506, 1.282075284005, 0.667777530266, 0.240160796576, 0.056656381764, 0.008134974479, 0.00062454465, 0.000019808998, 0.000000132974` (centered form). The coefficients satisfy `1 - a1 + a2 - ... = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The peak sidelobe level is -248.4 dB at 13.37 bins (first zero at 11 bins), the normalized equivalent noise bandwidth is 5.6512 bins and the amplitude flatness error 0.0009 dB. The window has negative lobes. Double precision samples reproduce the sidelobe level (measured -248.4 dB with an FFT of 8192 samples), the sidelobes are below the precision of most signals.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft223d]], [[hft196d]], [[flat-top]], [[blackman-harris-family]].(hft248d-continuous x)HFT248D flat-top window, continuous function A (1 + a1 cos(2 pi x) + ... + a10 cos(20 pi x)) with the integral 1 (coefficients see hft248d); it has negative values and is zero at both ends.
HFT248D flat-top window, continuous function `A (1 + a1 cos(2 pi x) + ... + a10 cos(20 pi x))` with the integral `1` (coefficients see [[hft248d]]); it has negative values and is zero at both ends.
(hft70)(hft70 N)(hft70 N opts)HFT70 flat-top window (Heinzel et al. 2002, section D.3.1), a sum of four cosine terms with the positive magnitudes 1, 1.90796, 1.07349, 0.18199 (centered form), optimized for the lowest sidelobe level of three cosines.
The peak sidelobe level is -70.4 dB (first zero at 4 bins, sidelobes drop as 1/f), the normalized equivalent noise bandwidth is 3.4129 bins and the amplitude flatness error -0.0065 dB. The window has negative lobes and a jump at the ends (about -0.004 of the middle value for the default :normalize?).
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also flat-top-hp, hft95, hft90d, flat-top, blackman-harris-family.
HFT70 flat-top window (Heinzel et al. 2002, section D.3.1), a sum of four cosine terms with the positive magnitudes `1, 1.90796, 1.07349, 0.18199` (centered form), optimized for the lowest sidelobe level of three cosines.
The peak sidelobe level is -70.4 dB (first zero at 4 bins, sidelobes drop as `1/f`), the normalized equivalent noise bandwidth is 3.4129 bins and the amplitude flatness error -0.0065 dB. The window has negative lobes and a jump at the ends (about `-0.004` of the middle value for the default `:normalize?`).
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[flat-top-hp]], [[hft95]], [[hft90d]], [[flat-top]], [[blackman-harris-family]].(hft70-continuous x)HFT70 flat-top window, continuous function A (1 + 1.90796 cos(2 pi x) + 1.07349 cos(4 pi x) + 0.18199 cos(6 pi x)) with the integral 1; it has negative values.
HFT70 flat-top window, continuous function `A (1 + 1.90796 cos(2 pi x) + 1.07349 cos(4 pi x) + 0.18199 cos(6 pi x))` with the integral `1`; it has negative values.
(hft90d)(hft90d N)(hft90d N opts)HFT90D flat-top window (Heinzel et al. 2002, section D.3.3), a sum of five cosine terms with the positive magnitudes 1, 1.942604, 1.340318, 0.440811, 0.043097 (centered form). The coefficients satisfy 1 - a1 + a2 - a3 + a4 = 0, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as 1/f^3.
The peak sidelobe level is -90.2 dB (first zero at 5 bins), the normalized equivalent noise bandwidth is 3.8832 bins and the amplitude flatness error -0.0039 dB. The window has negative lobes.
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft95, hft116d, flat-top-srs, flat-top, blackman-harris-family.
HFT90D flat-top window (Heinzel et al. 2002, section D.3.3), a sum of five cosine terms with the positive magnitudes `1, 1.942604, 1.340318, 0.440811, 0.043097` (centered form). The coefficients satisfy `1 - a1 + a2 - a3 + a4 = 0`, so the window is zero at both ends and differentiable (the D in the name), the sidelobes drop as `1/f^3`.
The peak sidelobe level is -90.2 dB (first zero at 5 bins), the normalized equivalent noise bandwidth is 3.8832 bins and the amplitude flatness error -0.0039 dB. The window has negative lobes.
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft95]], [[hft116d]], [[flat-top-srs]], [[flat-top]], [[blackman-harris-family]].(hft90d-continuous x)HFT90D flat-top window, continuous function A (1 + 1.942604 cos(2 pi x) + 1.340318 cos(4 pi x) + 0.440811 cos(6 pi x) + 0.043097 cos(8 pi x)) with the integral 1; it has negative values and is zero at both ends.
HFT90D flat-top window, continuous function `A (1 + 1.942604 cos(2 pi x) + 1.340318 cos(4 pi x) + 0.440811 cos(6 pi x) + 0.043097 cos(8 pi x))` with the integral `1`; it has negative values and is zero at both ends.
(hft95)(hft95 N)(hft95 N opts)HFT95 flat-top window (Heinzel et al. 2002, section D.3.2), a sum of five cosine terms with the positive magnitudes 1, 1.9383379, 1.3045202, 0.402827, 0.0350665 (centered form), optimized for the lowest sidelobe level of four cosines. It is very close to the flat-top window of the HP/Agilent 35670A analyzers.
The peak sidelobe level is -95.0 dB (first zero at 5 bins, sidelobes drop as 1/f), the normalized equivalent noise bandwidth is 3.8112 bins and the amplitude flatness error 0.0044 dB. The window has negative lobes and a jump at the ends (about -0.0003 of the middle value for the default :normalize?).
Parameters:
N - number of samplesoptions:
:normalize? - default true (division by the value at the middle, the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
See also hft90d, hft70, hft116d, flat-top, blackman-harris-family.
HFT95 flat-top window (Heinzel et al. 2002, section D.3.2), a sum of five cosine terms with the positive magnitudes `1, 1.9383379, 1.3045202, 0.402827, 0.0350665` (centered form), optimized for the lowest sidelobe level of four cosines. It is very close to the flat-top window of the HP/Agilent 35670A analyzers.
The peak sidelobe level is -95.0 dB (first zero at 5 bins, sidelobes drop as `1/f`), the normalized equivalent noise bandwidth is 3.8112 bins and the amplitude flatness error 0.0044 dB. The window has negative lobes and a jump at the ends (about `-0.0003` of the middle value for the default `:normalize?`).
Parameters:
- `N` - number of samples
- `options`:
- `:normalize?` - default `true` (division by the value at the middle, the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
See also [[hft90d]], [[hft70]], [[hft116d]], [[flat-top]], [[blackman-harris-family]].(hft95-continuous x)HFT95 flat-top window, continuous function A (1 + 1.9383379 cos(2 pi x) + 1.3045202 cos(4 pi x) + 0.402827 cos(6 pi x) + 0.0350665 cos(8 pi x)) with the integral 1; it has negative values.
HFT95 flat-top window, continuous function `A (1 + 1.9383379 cos(2 pi x) + 1.3045202 cos(4 pi x) + 0.402827 cos(6 pi x) + 0.0350665 cos(8 pi x))` with the integral `1`; it has negative values.
(idft Wn)Calculates the real part of the inverse discrete Fourier transform of window spectrum samples (direct O(N^2) sum).
Used to build the windows defined by their spectrum (dolph-chebyshev, ultraspherical, saramaki, legendre). The sample n of the result is (1/N) sum_k Wn[k] cos(2 pi k (n - (N-1)/2) / N), so a symmetric spectrum gives a symmetric window centered at (N-1)/2.
Parameters:
Wn - sequence of N numbers, the spectrum samples k = 0, ..., N-1Returns a vector of N doubles. For N > 200 the samples are computed in parallel (pmap). The cost is quadratic: about 10 ms for N = 1000, 0.5 s for N = 10000. An empty Wn gives an empty vector.
See also dolph-chebyshev, ultraspherical, legendre.
Calculates the real part of the inverse discrete Fourier transform of window spectrum samples (direct O(N^2) sum). Used to build the windows defined by their spectrum (`dolph-chebyshev`, `ultraspherical`, `saramaki`, `legendre`). The sample `n` of the result is `(1/N) sum_k Wn[k] cos(2 pi k (n - (N-1)/2) / N)`, so a symmetric spectrum gives a symmetric window centered at `(N-1)/2`. Parameters: - `Wn` - sequence of `N` numbers, the spectrum samples `k = 0, ..., N-1` Returns a vector of `N` doubles. For `N > 200` the samples are computed in parallel (`pmap`). The cost is quadratic: about 10 ms for `N = 1000`, 0.5 s for `N = 10000`. An empty `Wn` gives an empty vector. See also [[dolph-chebyshev]], [[ultraspherical]], [[legendre]].
(kaiser)(kaiser N)(kaiser N opts)Kaiser window A I0(beta sqrt(1 - 4x^2)) for x in [-0.5, 0.5], I0 the modified Bessel function of the first kind and order 0; the window is a computable approximation of the DPSS (Slepian) window.
Parameters:
N - number of samplesoptions:
:beta - shape, number in [0, 1e300], default pi. A larger beta gives lower sidelobes and a wider main lobe. beta = 0 is the rectangular window. It is the beta of scipy.signal.windows.kaiser and of Octave kaiser.:normalize? - default true (division by the value at the middle, as scipy: the maximum is 1 for odd N); false returns the continuous function sampled at -0.5, ..., 0.5, which has the integral 1Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0). The ends have the non-zero value 1 / I0(beta) (relative to the middle).
Throws ex-info for a beta which is negative, larger than 1e300, NaN or infinite.
The window is the same as kaiser-bessel with :alpha equal to beta / pi.
See also kaiser-bessel, kaiser-bessel-derived, cosh, knab.
Kaiser window `A I0(beta sqrt(1 - 4x^2))` for `x` in `[-0.5, 0.5]`, `I0` the modified Bessel function of the first kind and order 0; the window is a computable approximation of the DPSS (Slepian) window.
Parameters:
- `N` - number of samples
- `options`:
- `:beta` - shape, number in `[0, 1e300]`, default `pi`. A larger `beta` gives lower sidelobes and a wider main lobe. `beta = 0` is the rectangular window. It is the `beta` of `scipy.signal.windows.kaiser` and of Octave `kaiser`.
- `:normalize?` - default `true` (division by the value at the middle, as scipy: the maximum is `1` for odd `N`); `false` returns the continuous function sampled at `-0.5, ..., 0.5`, which has the integral `1`
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`. The ends have the non-zero value `1 / I0(beta)` (relative to the middle).
Throws `ex-info` for a `beta` which is negative, larger than `1e300`, `NaN` or infinite.
The window is the same as [[kaiser-bessel]] with `:alpha` equal to `beta / pi`.
See also [[kaiser-bessel]], [[kaiser-bessel-derived]], [[cosh]], [[knab]].(kaiser-bessel)(kaiser-bessel N)(kaiser-bessel N opts)Kaiser-Bessel window A I0(pi alpha sqrt(1 - 4x^2)), an approximation of the DPSS (Slepian) window, with I0 the modified Bessel function of the first kind and order 0.
The window is kaiser with beta = pi alpha, so alpha = beta / pi (equal to scipy.signal.windows.kaiser and Octave kaiser(N, pi alpha)). The ends have the value 1 / I0(pi alpha) of the middle. The peak sidelobe level is about -24.6 dB for the default alpha = 1 and -45.9 dB for alpha = 2; a larger alpha gives lower sidelobes and a wider main lobe.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser, kaiser-bessel-derived, cosh, knab, avci-nacaroglu, bessel-I1.
Kaiser-Bessel window `A I0(pi alpha sqrt(1 - 4x^2))`, an approximation of the DPSS (Slepian) window, with `I0` the modified Bessel function of the first kind and order 0.
The window is [[kaiser]] with `beta = pi alpha`, so `alpha = beta / pi` (equal to `scipy.signal.windows.kaiser` and Octave `kaiser(N, pi alpha)`). The ends have the value `1 / I0(pi alpha)` of the middle. The peak sidelobe level is about -24.6 dB for the default `alpha = 1` and -45.9 dB for `alpha = 2`; a larger `alpha` gives lower sidelobes and a wider main lobe.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser]], [[kaiser-bessel-derived]], [[cosh]], [[knab]], [[avci-nacaroglu]], [[bessel-I1]].(kaiser-bessel-derived)(kaiser-bessel-derived N)(kaiser-bessel-derived N opts)Kaiser-Bessel-derived (KBD) window: the square root of the normalized cumulative sum of a Kaiser-Bessel window, power complementary.
For even N the window satisfies w[n]^2 + w[n + N/2]^2 = 1 (Princen-Bradley condition for the MDCT), equal to scipy.signal.windows.kaiser_bessel_derived(N, pi alpha). For odd N the window is a symmetric extension, which is not power complementary (scipy rejects odd N).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 1.0; alpha = beta / pi of scipy. A value so large that the kernel window has no non-zero sample throws.:normalize? - default false: the raw power complementary window; true is :LInf (the maximum becomes 1); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser-bessel, kaiser, vorbis.
Kaiser-Bessel-derived (KBD) window: the square root of the normalized cumulative sum of a Kaiser-Bessel window, power complementary.
For even `N` the window satisfies `w[n]^2 + w[n + N/2]^2 = 1` (Princen-Bradley condition for the MDCT), equal to `scipy.signal.windows.kaiser_bessel_derived(N, pi alpha)`. For odd `N` the window is a symmetric extension, which is not power complementary (scipy rejects odd `N`).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `1.0`; `alpha = beta / pi` of scipy. A value so large that the kernel window has no non-zero sample throws.
- `:normalize?` - default `false`: the raw power complementary window; `true` is `:LInf` (the maximum becomes `1`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser-bessel]], [[kaiser]], [[vorbis]].(knab)(knab N)(knab N opts)Knab window A sinh(pi alpha s) / (sinh(pi alpha) s), s = sqrt(1 - 4x^2), an approximation of the DPSS (Slepian) window.
At the ends (s = 0) the function has the limit value pi alpha / sinh(pi alpha) of the middle value, not zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 2.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser-bessel, cosh, avci-nacaroglu, bessel-I1.
Knab window `A sinh(pi alpha s) / (sinh(pi alpha) s)`, `s = sqrt(1 - 4x^2)`, an approximation of the DPSS (Slepian) window.
At the ends (`s = 0`) the function has the limit value `pi alpha / sinh(pi alpha)` of the middle value, not zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `2.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser-bessel]], [[cosh]], [[avci-nacaroglu]], [[bessel-I1]].(lanczos)(lanczos N)(lanczos N opts)Lanczos family window A sinc(2x)^L, the power L of the sinc lobe, sinc(z) = sin(pi z) / (pi z).
L = 1 is the usual Lanczos window (equal to scipy.signal.windows.lanczos and to sinc), L = 2 is fejer and L = 4 is de-la-vallee-poussin; L = 0 is the rectangular window. The default is L = 3 (the cube of the sinc lobe), not the L = 1 of scipy.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:L - power, number >= 0, default 3.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also sinc, fejer, de-la-vallee-poussin.
Lanczos family window `A sinc(2x)^L`, the power `L` of the sinc lobe, `sinc(z) = sin(pi z) / (pi z)`.
`L = 1` is the usual Lanczos window (equal to `scipy.signal.windows.lanczos` and to `sinc`), `L = 2` is `fejer` and `L = 4` is `de-la-vallee-poussin`; `L = 0` is the rectangular window. The default is `L = 3` (the cube of the sinc lobe), not the `L = 1` of scipy.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:L` - power, number `>= 0`, default `3.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[sinc]], [[fejer]], [[de-la-vallee-poussin]].(legendre)(legendre N)(legendre N opts)Legendre window, the ultraspherical window with alpha = 0.5 and Doerry's level mapping.
The spectrum is the Legendre polynomial P_(N-1)(x0 cos(pi k / N)) with the sidelobe parameter 1.0754 abs(level) + 1.7388 dB (Doerry, eq. 266), so legendre with level L is ultraspherical with :alpha 0.5 and :level that value.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:level - design sidelobe level in dB (finite number, abs is taken, abs(level) <= 5000, default -50.0). The achieved peak sidelobe level is about 3.4 dB lower than requested; measured (dB, N = 2049) for the levels -30, -50, -80, -100: -33.6, -53.1, -83.5, -104.1:normalize? - default true (:LInf: the coefficients are divided by the largest absolute value, the maximum becomes 1); false returns the raw window (mean 1, sum N); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also ultraspherical, dolph-chebyshev, saramaki.
Legendre window, the ultraspherical window with `alpha = 0.5` and Doerry's level mapping.
The spectrum is the Legendre polynomial `P_(N-1)(x0 cos(pi k / N))` with the sidelobe parameter `1.0754 abs(level) + 1.7388` dB (Doerry, eq. 266), so `legendre` with `level` L is `ultraspherical` with `:alpha 0.5` and `:level` that value.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:level` - design sidelobe level in dB (finite number, `abs` is taken, `abs(level) <= 5000`, default `-50.0`). The achieved peak sidelobe level is about 3.4 dB lower than requested; measured (dB, `N` = 2049) for the levels -30, -50, -80, -100: -33.6, -53.1, -83.5, -104.1
- `:normalize?` - default `true` (`:LInf`: the coefficients are divided by the largest absolute value, the maximum becomes `1`); `false` returns the raw window (mean `1`, sum `N`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[ultraspherical]], [[dolph-chebyshev]], [[saramaki]].(make-blackman-harris clamp-fn v & coeffs)Macro which expands to the clipped or unclipped sum of cosines A (a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + ...) with literal coefficients, A = 1 / a0.
Parameters:
clamp-fn - one of the private clamping macros of this namespace: clamp replaces negative values by 0.0, clamp- keeps them (both give 0.0 outside of [-0.5, 0.5])v - the argument symbolcoeffs - the positive magnitudes a0 a1 ... as number literalsReturns the code of the continuous window function body, used by the -continuous functions of the cosine sum windows. See also ->blackman-harris.
Macro which expands to the clipped or unclipped sum of cosines `A (a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + ...)` with literal coefficients, `A = 1 / a0`. Parameters: - `clamp-fn` - one of the private clamping macros of this namespace: `clamp` replaces negative values by `0.0`, `clamp-` keeps them (both give `0.0` outside of `[-0.5, 0.5]`) - `v` - the argument symbol - `coeffs` - the positive magnitudes `a0 a1 ...` as number literals Returns the code of the continuous window function body, used by the `-continuous` functions of the cosine sum windows. See also [[->blackman-harris]].
(mottaghi-kashtiban-shayesteh)(mottaghi-kashtiban-shayesteh N)(mottaghi-kashtiban-shayesteh N opts)Mottaghi-Kashtiban-Shayesteh window: a four-term cosine sum whose coefficients depend on the window length.
The window is a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + a3 cos(6 pi x) (centered form, scaled by 1 / a0) with a0 = 0.5363 - 0.14 / (N - 1), a1 = 0.996 - a0, a2 = 0, a3 = 0.004 (Doerry, catalog, table 1). It improves on the Hamming window (peak sidelobe level about -44.6 dB for N = 256 against -42.7 dB).
Parameters:
N - number of samples, an integer >= 0; the coefficients are computed for the given Noptions (optional map):
:normalize? - default true: division by the value at the middle; false returns the raw samples, which have the integral 1 of the function; other values: :LInf, :L1, :L2, :N or a finite non-zero number, see normalize-coefficientsReturns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0). The formula is not clipped: the window is non-negative for N >= 5, for N from 2 to 4 the end values are negative. Because the coefficients depend on N, a periodic window of fastmath.kernel/window (:symmetric? false) is the first N samples of the window designed for N + 1, not a periodic design for N. Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hamming, blackman-harris-family, shayesteh-kashtiban.
Mottaghi-Kashtiban-Shayesteh window: a four-term cosine sum whose coefficients depend on the window length.
The window is `a0 + a1 cos(2 pi x) + a2 cos(4 pi x) + a3 cos(6 pi x)` (centered form, scaled by `1 / a0`) with `a0 = 0.5363 - 0.14 / (N - 1)`, `a1 = 0.996 - a0`, `a2 = 0`, `a3 = 0.004` (Doerry, catalog, table 1). It improves on the Hamming window (peak sidelobe level about -44.6 dB for `N` = 256 against -42.7 dB).
Parameters:
- `N` - number of samples, an integer `>= 0`; the coefficients are computed for the given `N`
- `options` (optional map):
- `:normalize?` - default `true`: division by the value at the middle; `false` returns the raw samples, which have the integral `1` of the function; other values: `:LInf`, `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`. The formula is not clipped: the window is non-negative for `N >= 5`, for `N` from `2` to `4` the end values are negative. Because the coefficients depend on `N`, a periodic window of `fastmath.kernel/window` (`:symmetric? false`) is the first `N` samples of the window designed for `N + 1`, not a periodic design for `N`. Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hamming]], [[blackman-harris-family]], [[shayesteh-kashtiban]].(normalize-coefficients coeffs normalize?)Normalizes window coefficients.
Parameters:
coeffs - a sequence (or vector) of numbersnormalize? - one of:
true or :LInf (alias :Linf) - divides by the maximum absolute value, the maximum becomes 1.0:L1 - divides by the sum of the absolute values:L2 - divides by the euclidean length:N - the :L1 result multiplied by the number of coefficientsfalse - returns coeffs unchangedReturns the normalized coefficients (the same container type as coeffs). Empty input is returned unchanged. All-zero input stays all-zero for the norm based modes.
Throws ex-info for nil, a zero, NaN or infinite number and for any other value of normalize?.
The windows of this namespace resolve true before they call this function: for continuous model windows true means division by the window function value at 0 (see sample-window), the default nil is replaced by the default of the window.
See also sample-window.
Normalizes window coefficients.
Parameters:
- `coeffs` - a sequence (or vector) of numbers
- `normalize?` - one of:
- `true` or `:LInf` (alias `:Linf`) - divides by the maximum absolute value, the maximum becomes `1.0`
- `:L1` - divides by the sum of the absolute values
- `:L2` - divides by the euclidean length
- `:N` - the `:L1` result multiplied by the number of coefficients
- a finite non-zero number - divides all coefficients by this number
- `false` - returns `coeffs` unchanged
Returns the normalized coefficients (the same container type as `coeffs`). Empty input is returned unchanged. All-zero input stays all-zero for the norm based modes.
Throws `ex-info` for `nil`, a zero, `NaN` or infinite number and for any other value of `normalize?`.
The windows of this namespace resolve `true` before they call this function: for continuous model windows `true` means division by the window function value at `0` (see [[sample-window]]), the default `nil` is replaced by the default of the window.
See also [[sample-window]].(nutall-1st)(nutall-1st N)(nutall-1st N opts)Nuttall four-term window with continuous first derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall4b).
The window is A (0.355768 + 0.487396 cos(2 pi x) + 0.144232 cos(4 pi x) + 0.012604 cos(6 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -93.3 dB. Equal to Octave nuttallwin. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also blackman-nutall, nutall-3rd, nutall-5th, blackman-harris-92db.
Nuttall four-term window with continuous first derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall4b).
The window is `A (0.355768 + 0.487396 cos(2 pi x) + 0.144232 cos(4 pi x) + 0.012604 cos(6 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -93.3 dB. Equal to Octave `nuttallwin`. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[blackman-nutall]], [[nutall-3rd]], [[nutall-5th]], [[blackman-harris-92db]].(nutall-1st-continuous x)Nuttall four-term (first derivative continuous) window, continuous function A (0.355768 + 0.487396 cos(2 pi x) + 0.144232 cos(4 pi x) + 0.012604 cos(6 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Nuttall four-term (first derivative continuous) window, continuous function `A (0.355768 + 0.487396 cos(2 pi x) + 0.144232 cos(4 pi x) + 0.012604 cos(6 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(nutall-3-1st)(nutall-3-1st N)(nutall-3-1st N opts)Nuttall three-term window with continuous first derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall3a).
The window is A (0.40897 + 0.5 cos(2 pi x) + 0.09103 cos(4 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -64.2 dB. The name keeps the spelling nutall of the library. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also nutall-3-3rd, blackman-harris, nutall-1st.
Nuttall three-term window with continuous first derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall3a).
The window is `A (0.40897 + 0.5 cos(2 pi x) + 0.09103 cos(4 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -64.2 dB. The name keeps the spelling `nutall` of the library. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[nutall-3-3rd]], [[blackman-harris]], [[nutall-1st]].(nutall-3-1st-continuous x)Nuttall three-term (first derivative continuous) window, continuous function A (0.40897 + 0.5 cos(2 pi x) + 0.09103 cos(4 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Nuttall three-term (first derivative continuous) window, continuous function `A (0.40897 + 0.5 cos(2 pi x) + 0.09103 cos(4 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(nutall-3-3rd)(nutall-3-3rd N)(nutall-3-3rd N opts)Nuttall three-term window with continuous third derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall3).
The window is A (0.375 + 0.5 cos(2 pi x) + 0.125 cos(4 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -46.7 dB. It is cos(pi x)^4 up to scale, equal to power-of-cosine with :m 4; the sidelobes drop as 1/f^5. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also nutall-3-1st, power-of-cosine, hann.
Nuttall three-term window with continuous third derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall3).
The window is `A (0.375 + 0.5 cos(2 pi x) + 0.125 cos(4 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -46.7 dB. It is `cos(pi x)^4` up to scale, equal to `power-of-cosine` with `:m 4`; the sidelobes drop as `1/f^5`. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[nutall-3-1st]], [[power-of-cosine]], [[hann]].(nutall-3-3rd-continuous x)Nuttall three-term (third derivative continuous) window, continuous function A (0.375 + 0.5 cos(2 pi x) + 0.125 cos(4 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Nuttall three-term (third derivative continuous) window, continuous function `A (0.375 + 0.5 cos(2 pi x) + 0.125 cos(4 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(nutall-3rd)(nutall-3rd N)(nutall-3rd N opts)Nuttall four-term window with continuous third derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall4a).
The window is A (0.338946 + 0.481973 cos(2 pi x) + 0.161054 cos(4 pi x) + 0.018027 cos(6 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -82.6 dB. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also nutall-1st, nutall-5th, blackman-nutall.
Nuttall four-term window with continuous third derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall4a).
The window is `A (0.338946 + 0.481973 cos(2 pi x) + 0.161054 cos(4 pi x) + 0.018027 cos(6 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -82.6 dB. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[nutall-1st]], [[nutall-5th]], [[blackman-nutall]].(nutall-3rd-continuous x)Nuttall four-term (third derivative continuous) window, continuous function A (0.338946 + 0.481973 cos(2 pi x) + 0.161054 cos(4 pi x) + 0.018027 cos(6 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Nuttall four-term (third derivative continuous) window, continuous function `A (0.338946 + 0.481973 cos(2 pi x) + 0.161054 cos(4 pi x) + 0.018027 cos(6 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(nutall-5th)(nutall-5th N)(nutall-5th N opts)Nuttall four-term window with continuous fifth derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall4).
The window is A (0.3125 + 0.46875 cos(2 pi x) + 0.1875 cos(4 pi x) + 0.03125 cos(6 pi x)) (the centered form with the positive magnitudes, A = 1 / a0). The peak sidelobe level is about -61.0 dB. It is cos(pi x)^6 up to scale, equal to power-of-cosine with :m 6; the sidelobes drop as 1/f^7. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also nutall-3rd, power-of-cosine, nutall-3-3rd.
Nuttall four-term window with continuous fifth derivative (Nuttall 1981; Heinzel et al. 2002: Nuttall4).
The window is `A (0.3125 + 0.46875 cos(2 pi x) + 0.1875 cos(4 pi x) + 0.03125 cos(6 pi x))` (the centered form with the positive magnitudes, `A = 1 / a0`). The peak sidelobe level is about -61.0 dB. It is `cos(pi x)^6` up to scale, equal to `power-of-cosine` with `:m 6`; the sidelobes drop as `1/f^7`. Negative values would be replaced by zero (there are none for these coefficients). The raw window has the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[nutall-3rd]], [[power-of-cosine]], [[nutall-3-3rd]].(nutall-5th-continuous x)Nuttall four-term (fifth derivative continuous) window, continuous function A (0.3125 + 0.46875 cos(2 pi x) + 0.1875 cos(4 pi x) + 0.03125 cos(6 pi x)) on [-0.5, 0.5] (integral 1), 0 outside; negative values are clipped to 0.
Nuttall four-term (fifth derivative continuous) window, continuous function `A (0.3125 + 0.46875 cos(2 pi x) + 0.1875 cos(4 pi x) + 0.03125 cos(6 pi x))` on `[-0.5, 0.5]` (integral `1`), `0` outside; negative values are clipped to `0`.
(parzen)(parzen N)(parzen N opts)Parzen window (de la Vallee-Poussin), a piecewise cubic bell.
The default is the discrete definition, 1 - 6 u^2 (1 - u) for abs(n - (N-1)/2) <= N/4 and 2 (1 - u)^3 otherwise, u = abs(n - (N-1)/2) / (N/2). With :discrete? false the continuous function (the cubic B-spline of order 4, equal to b-spline with :order 4) is sampled instead.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:discrete? - boolean, default true: the discrete definition (equal to scipy.signal.windows.parzen and Octave parzenwin, peak 1, non-zero small ends); false: the continuous function sampled at -0.5, ..., 0.5 (zero ends):normalize? - default true. The discrete path has the peak 1 already, so true and false return the formula as it is; :LInf, :L1, :L2, :N and a finite non-zero number are honoured (see normalize-coefficients). For :discrete? false, true divides by the middle value and false returns the raw function with the integral 1.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0). Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also b-spline, triangular, welch, parzen-algebraic, parzen-cosine.
Parzen window (de la Vallee-Poussin), a piecewise cubic bell.
The default is the discrete definition, `1 - 6 u^2 (1 - u)` for `abs(n - (N-1)/2) <= N/4` and `2 (1 - u)^3` otherwise, `u = abs(n - (N-1)/2) / (N/2)`. With `:discrete? false` the continuous function (the cubic B-spline of order 4, equal to `b-spline` with `:order 4`) is sampled instead.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:discrete?` - boolean, default `true`: the discrete definition (equal to `scipy.signal.windows.parzen` and Octave `parzenwin`, peak `1`, non-zero small ends); `false`: the continuous function sampled at `-0.5, ..., 0.5` (zero ends)
- `:normalize?` - default `true`. The discrete path has the peak `1` already, so `true` and `false` return the formula as it is; `:LInf`, `:L1`, `:L2`, `:N` and a finite non-zero number are honoured (see [[normalize-coefficients]]). For `:discrete? false`, `true` divides by the middle value and `false` returns the raw function with the integral `1`.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`. Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[b-spline]], [[triangular]], [[welch]], [[parzen-algebraic]], [[parzen-cosine]].(parzen-algebraic)(parzen-algebraic N)(parzen-algebraic N opts)Parzen algebraic family window A (1 - gamma abs(2x)^u), A = (u + 1) / (u + 1 - gamma).
gamma = 1 makes the ends zero; u = 1 is the triangular window and u = 2 the Welch window (for gamma = 1); gamma < 1 gives a pedestal (non-zero ends).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:gamma - number in (0, 1], default 1.0:u - power, number > 0, default 3.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also welch, triangular, power-of-cosine, trapezoid.
Parzen algebraic family window `A (1 - gamma abs(2x)^u)`, `A = (u + 1) / (u + 1 - gamma)`.
`gamma = 1` makes the ends zero; `u = 1` is the triangular window and `u = 2` the Welch window (for `gamma = 1`); `gamma < 1` gives a pedestal (non-zero ends).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:gamma` - number in `(0, 1]`, default `1.0`
- `:u` - power, number `> 0`, default `3.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[welch]], [[triangular]], [[power-of-cosine]], [[trapezoid]].(parzen-continuous x)Parzen window, continuous function (the cubic B-spline of order 4 scaled to [-0.5, 0.5], integral 1, zero ends).
Parzen window, continuous function (the cubic B-spline of order 4 scaled to `[-0.5, 0.5]`, integral `1`, zero ends).
(parzen-cosine)(parzen-cosine N)(parzen-cosine N opts)Parzen cosine family window A (1 + cos(pi gamma abs(2x)^m)).
gamma = 1 makes the ends zero, m = 2 gives a flatter top than the Hann window. gamma < 1 leaves a pedestal at the ends.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:gamma - number in [0, 1], default 1.0:m - power, number > 0, default 2.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hann, raised-cosine, parzen-algebraic.
Parzen cosine family window `A (1 + cos(pi gamma abs(2x)^m))`.
`gamma = 1` makes the ends zero, `m = 2` gives a flatter top than the Hann window. `gamma < 1` leaves a pedestal at the ends.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:gamma` - number in `[0, 1]`, default `1.0`
- `:m` - power, number `> 0`, default `2.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hann]], [[raised-cosine]], [[parzen-algebraic]].(parzen-discrete N)Returns the coefficients of the discrete Parzen window of N samples (a sequence of doubles, peak 1, equal to scipy.signal.windows.parzen); N is a long >= 2.
Returns the coefficients of the discrete Parzen window of `N` samples (a sequence of doubles, peak `1`, equal to `scipy.signal.windows.parzen`); `N` is a long `>= 2`.
(parzen-exponential)(parzen-exponential N)(parzen-exponential N opts)Parzen exponential family window A exp(-abs(2 alpha x)^r).
r = 1 is exponential (same alpha), r = 2 is gaussian with alpha * sqrt(2). It is general-gaussian with p = r / 2.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 1.0:r - power, number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also exponential, gaussian, general-gaussian, parzen-geometric.
Parzen exponential family window `A exp(-abs(2 alpha x)^r)`.
`r = 1` is `exponential` (same `alpha`), `r = 2` is `gaussian` with `alpha * sqrt(2)`. It is `general-gaussian` with `p = r / 2`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `1.0`
- `:r` - power, number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[exponential]], [[gaussian]], [[general-gaussian]], [[parzen-geometric]].(parzen-geometric)(parzen-geometric N)(parzen-geometric N opts)Parzen geometric family window A / (1 + abs(2 alpha x)^r).
r = 2 is cauchy (same alpha).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number > 0, default 1.0:r - power, number > 0, default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also cauchy, parzen-exponential, exponential.
Parzen geometric family window `A / (1 + abs(2 alpha x)^r)`.
`r = 2` is `cauchy` (same `alpha`).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `> 0`, default `1.0`
- `:r` - power, number `> 0`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[cauchy]], [[parzen-exponential]], [[exponential]].(power-of-cosine)(power-of-cosine N)(power-of-cosine N opts)Power of cosine window A cos(pi x)^m, A = sqrt(pi) Gamma((m + 2) / 2) / Gamma((m + 1) / 2).
m = 0 is rectangular, m = 1 is the cosine lobe (sampled at -0.5, ..., 0.5 with zero ends; this is not scipy.signal.windows.cosine, which samples the half-sample grid, see cosine), m = 2 is hann.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:m - power, number in [0, 1000], default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also cosine, hann, raised-power-of-cosine, welch.
Power of cosine window `A cos(pi x)^m`, `A = sqrt(pi) Gamma((m + 2) / 2) / Gamma((m + 1) / 2)`.
`m = 0` is rectangular, `m = 1` is the cosine lobe (sampled at `-0.5, ..., 0.5` with zero ends; this is not `scipy.signal.windows.cosine`, which samples the half-sample grid, see [[cosine]]), `m = 2` is `hann`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:m` - power, number in `[0, 1000]`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[cosine]], [[hann]], [[raised-power-of-cosine]], [[welch]].(raised-cosine)(raised-cosine N)(raised-cosine N opts)Raised cosine family alpha + (1 - alpha) cos(2 pi x) (up to scale).
alpha = 0.5 is hann, alpha = 0.54 is hamming and alpha = 25/46 is hamming-exact. Equal to scipy.signal.windows.general_hamming with the same alpha. For alpha < 0.5 the window has negative lobes and for alpha > 1 the maximum is not at the middle, so the range is limited.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number in [0.5, 1], default 0.5:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hann, hamming, hamming-exact, blackman-harris-family.
Raised cosine family `alpha + (1 - alpha) cos(2 pi x)` (up to scale).
`alpha = 0.5` is `hann`, `alpha = 0.54` is `hamming` and `alpha = 25/46` is `hamming-exact`. Equal to `scipy.signal.windows.general_hamming` with the same `alpha`. For `alpha < 0.5` the window has negative lobes and for `alpha > 1` the maximum is not at the middle, so the range is limited.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number in `[0.5, 1]`, default `0.5`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hann]], [[hamming]], [[hamming-exact]], [[blackman-harris-family]].(raised-power-of-cosine)(raised-power-of-cosine N)(raised-power-of-cosine N opts)Raised power of cosine window A (alpha + (1 - alpha) cos(pi x)^m), a pedestal alpha plus a power of cosine.
alpha = 0 is power-of-cosine, alpha = 1 is rectangular; m = 2 gives the raised cosine (hann for alpha = 0.5).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - pedestal, number in [0, 1], default 0.05:m - power, number in [0, 1000], default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also power-of-cosine, raised-cosine, hamming.
Raised power of cosine window `A (alpha + (1 - alpha) cos(pi x)^m)`, a pedestal `alpha` plus a power of cosine.
`alpha = 0` is `power-of-cosine`, `alpha = 1` is rectangular; `m = 2` gives the raised cosine (`hann` for `alpha = 0.5`).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - pedestal, number in `[0, 1]`, default `0.05`
- `:m` - power, number in `[0, 1000]`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[power-of-cosine]], [[raised-cosine]], [[hamming]].(rectangular)(rectangular N)(rectangular N opts)Rectangular (boxcar) window, all samples are equal to 1.
Equal to scipy.signal.windows.boxcar and Octave rectwin. It has the narrowest main lobe and the highest sidelobes (-13.3 dB) of all windows.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Equal to tukey with :alpha 0, kaiser with :beta 0 and power-of-cosine with :m 0.
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also rectangular05, tukey, triangular, hann.
Rectangular (boxcar) window, all samples are equal to `1`.
Equal to `scipy.signal.windows.boxcar` and Octave `rectwin`. It has the narrowest main lobe and the highest sidelobes (-13.3 dB) of all windows.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Equal to `tukey` with `:alpha 0`, `kaiser` with `:beta 0` and `power-of-cosine` with `:m 0`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[rectangular05]], [[tukey]], [[triangular]], [[hann]].(rectangular-continuous x)Rectangular window, continuous function: 1 on [-0.5, 0.5], 0 outside (integral 1).
Rectangular window, continuous function: `1` on `[-0.5, 0.5]`, `0` outside (integral `1`).
(rectangular05)(rectangular05 N)(rectangular05 N opts)Rectangular window with both end samples set to 0.5.
The window is 1 inside and 0.5 at the two ends (the function value at abs(x) = 0.5). It is the rectangular window seen as the limit of a symmetric smooth window, useful when the ends should carry half weight. Unlike the other continuous model windows the default :normalize? is false.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default false: the raw samples (0.5 1 ... 1 0.5, the continuous function has the integral 1); true divides by the value at the middle (the maximum becomes 1); other values: :LInf (alias :Linf), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also rectangular, triangular, tukey.
Rectangular window with both end samples set to `0.5`.
The window is `1` inside and `0.5` at the two ends (the function value at `abs(x) = 0.5`). It is the rectangular window seen as the limit of a symmetric smooth window, useful when the ends should carry half weight. Unlike the other continuous model windows the default `:normalize?` is `false`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `false`: the raw samples (`0.5 1 ... 1 0.5`, the continuous function has the integral `1`); `true` divides by the value at the middle (the maximum becomes `1`); other values: `:LInf` (alias `:Linf`), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[rectangular]], [[triangular]], [[tukey]].(rectangular05-continuous x)Rectangular window with the ends set to 0.5, continuous function: 1 for abs(x) < 0.5, 0.5 for abs(x) = 0.5, 0 outside (integral 1).
Rectangular window with the ends set to `0.5`, continuous function: `1` for `abs(x) < 0.5`, `0.5` for `abs(x) = 0.5`, `0` outside (integral `1`).
(sample-window f N)(sample-window f N normalize?)Samples a continuous window function and normalizes the samples.
Parameters:
f - a function of one double, defined on [-0.5, 0.5]N - number of samples, an integer >= 0normalize? (optional, default true) - true divides the samples by (f 0.0) (the value at the middle, for even N the maximum of the samples can be lower than 1.0), false returns the samples as they are; the other accepted values are :LInf (alias :Linf), :L1, :L2, :N and a finite non-zero number, see normalize-coefficients. nil means true.Returns a sequence of N doubles at the points -0.5, ..., 0.5 (both ends included; for N = 1 the point 0.0), () for N = 0.
Throws ex-info for an invalid N, an invalid normalize? or when normalize? is true and (f 0.0) is zero or not finite.
See also normalize-coefficients, continuous->window-fn.
Samples a continuous window function and normalizes the samples. Parameters: - `f` - a function of one double, defined on `[-0.5, 0.5]` - `N` - number of samples, an integer `>= 0` - `normalize?` (optional, default `true`) - `true` divides the samples by `(f 0.0)` (the value at the middle, for even `N` the maximum of the samples can be lower than `1.0`), `false` returns the samples as they are; the other accepted values are `:LInf` (alias `:Linf`), `:L1`, `:L2`, `:N` and a finite non-zero number, see [[normalize-coefficients]]. `nil` means `true`. Returns a sequence of `N` doubles at the points `-0.5, ..., 0.5` (both ends included; for `N = 1` the point `0.0`), `()` for `N = 0`. Throws `ex-info` for an invalid `N`, an invalid `normalize?` or when `normalize?` is `true` and `(f 0.0)` is zero or not finite. See also [[normalize-coefficients]], [[continuous->window-fn]].
(saramaki)(saramaki N)(saramaki N opts)Saramaki window, the ultraspherical window with alpha = 1.
Equal to ultraspherical with :alpha 1.0. As for all the ultraspherical windows the level is a design parameter and the achieved peak sidelobe level is higher than requested.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:level - Doerry's sidelobe parameter in dB (finite number, abs is taken, abs(level) <= 5000, default -50.0). Measured achieved peak sidelobe levels (dB, N = 2049) for the levels -30, -50, -80, -100: -30.9, -47.1, -73.4, -91.6:normalize? - default true (:LInf: the coefficients are divided by the largest absolute value, the maximum becomes 1); false returns the raw window (mean 1, sum N); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also ultraspherical, dolph-chebyshev, legendre.
Saramaki window, the ultraspherical window with `alpha = 1`.
Equal to `ultraspherical` with `:alpha 1.0`. As for all the ultraspherical windows the level is a design parameter and the achieved peak sidelobe level is higher than requested.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:level` - Doerry's sidelobe parameter in dB (finite number, `abs` is taken, `abs(level) <= 5000`, default `-50.0`). Measured achieved peak sidelobe levels (dB, `N` = 2049) for the levels -30, -50, -80, -100: -30.9, -47.1, -73.4, -91.6
- `:normalize?` - default `true` (`:LInf`: the coefficients are divided by the largest absolute value, the maximum becomes `1`); `false` returns the raw window (mean `1`, sum `N`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[ultraspherical]], [[dolph-chebyshev]], [[legendre]].(shayesteh-kashtiban)(shayesteh-kashtiban N)(shayesteh-kashtiban N opts)Shayesteh-Kashtiban window: a sinc power window with enlarged end samples (Doerry, eq. 276, 277).
The interior samples are sinc((n - (N-1)/2) / (0.654 (N-1)))^2.5; the two end samples are 0.02 + 0.001 (N-1) + 1 / (50 + 2 (N-1)), before the common scale. The ends grow relative to the interior with N. The peak sidelobe level is about -47.9 dB (no sidelobe control).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true (:LInf: the coefficients are divided by the largest absolute value, the maximum becomes 1); false returns the raw window (mean 1, sum N); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also mottaghi-kashtiban-shayesteh, dolph-chebyshev, sinc.
Shayesteh-Kashtiban window: a sinc power window with enlarged end samples (Doerry, eq. 276, 277).
The interior samples are `sinc((n - (N-1)/2) / (0.654 (N-1)))^2.5`; the two end samples are `0.02 + 0.001 (N-1) + 1 / (50 + 2 (N-1))`, before the common scale. The ends grow relative to the interior with `N`. The peak sidelobe level is about -47.9 dB (no sidelobe control).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true` (`:LInf`: the coefficients are divided by the largest absolute value, the maximum becomes `1`); `false` returns the raw window (mean `1`, sum `N`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[mottaghi-kashtiban-shayesteh]], [[dolph-chebyshev]], [[sinc]].(shayesteh-kashtiban-discrete N)Returns the coefficients of the Shayesteh-Kashtiban window of N >= 2 samples as a vector, scaled to the mean 1 (Doerry, eq. 276, 277).
Returns the coefficients of the Shayesteh-Kashtiban window of `N >= 2` samples as a vector, scaled to the mean `1` (Doerry, eq. 276, 277).
(sinc)(sinc N)(sinc N opts)Sinc lobe window A sinc(2x), sinc(z) = sin(pi z) / (pi z): the main lobe of the sinc function.
Equal to lanczos with :L 1.0 and to scipy.signal.windows.lanczos. The ends are zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also lanczos, fejer, de-la-vallee-poussin.
Sinc lobe window `A sinc(2x)`, `sinc(z) = sin(pi z) / (pi z)`: the main lobe of the sinc function.
Equal to `lanczos` with `:L 1.0` and to `scipy.signal.windows.lanczos`. The ends are zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[lanczos]], [[fejer]], [[de-la-vallee-poussin]].(sinc-continuous x)Sinc lobe window, continuous function A sinc(2x) on [-0.5, 0.5] (integral 1, zero ends), sinc(z) = sin(pi z) / (pi z).
Sinc lobe window, continuous function `A sinc(2x)` on `[-0.5, 0.5]` (integral `1`, zero ends), `sinc(z) = sin(pi z) / (pi z)`.
(singla-singh)(singla-singh N)(singla-singh N opts)Singla-Singh family of windows, the survival function of the symmetric beta distribution.
The window is 2 (1 - I_t(m + 1, m + 1)), t = abs(2x), m the order, I the regularized incomplete beta function (Singla and Singh, Doerry catalog). Order 0 is the triangular window; the window becomes narrower and smoother for higher orders (the main lobe gets wider, the sidelobes lower).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:order - integer in [0, 1000] (a double with an integral value is accepted), default 1:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also triangular, b-spline, gaussian.
Singla-Singh family of windows, the survival function of the symmetric beta distribution.
The window is `2 (1 - I_t(m + 1, m + 1))`, `t = abs(2x)`, `m` the order, `I` the regularized incomplete beta function (Singla and Singh, Doerry catalog). Order `0` is the triangular window; the window becomes narrower and smoother for higher orders (the main lobe gets wider, the sidelobes lower).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:order` - integer in `[0, 1000]` (a double with an integral value is accepted), default `1`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[triangular]], [[b-spline]], [[gaussian]].(taylor)(taylor N)(taylor N opts)Taylor window: a cosine sum with n - 1 terms which approximates the Dolph-Chebyshev window, with the first n - 1 sidelobes at nearly the design level and a decay beyond them (Doerry, eq. 208-212).
Parameters:
N - number of samples, an integer >= 0. The window is the continuous function sampled at -0.5, ..., 0.5 including both ends, which differs from the grid of scipy.signal.windows.taylor and Octave taylorwin (they sample (n - N/2 + 1/2) / N): the values differ from scipy by O(1/N) (0.45 for N = 2, 0.013 for N = 64, 0.003 for N = 256 for n = 4 and level -50).options (optional map):
:level - design sidelobe level in dB (finite number, abs is taken, abs(level) <= 5000, default -50.0); it is -sll of scipy. It is the design parameter, the achieved peak sidelobe level depends on n and is higher for a small n. Measured (dB, N = 2049) for the levels -30, -50, -80, -100: n 2: -25.7, -30.3, -33.3, -34.0; n 4 (default): -30.4, -44.7, -56.0, -60.6; n 6: -30.3, -49.3, -66.9, -75.3; n 8: -30.2, -50.2, -72.7, -83.9. A level so small that the middle of the window is not positive (for example 0, below about 20 dB the ends are higher than the middle) throws.:n - integer in [2, 400], the number of nearly constant level sidelobes (nbar of scipy), default 4:normalize? - default true (division by the value at the middle); false returns the raw samples of the function with the integral 1; other values: :LInf, :L1, :L2, :N or a finite non-zero number, see normalize-coefficientsReturns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0). The cost of the coefficients is O(n^2). Throws ex-info (:type :invalid-input) for an invalid N, :normalize?, :level or :n.
See also dolph-chebyshev, ultraspherical, blackman-harris-family.
Taylor window: a cosine sum with `n - 1` terms which approximates the Dolph-Chebyshev window, with the first `n - 1` sidelobes at nearly the design level and a decay beyond them (Doerry, eq. 208-212).
Parameters:
- `N` - number of samples, an integer `>= 0`. The window is the continuous function sampled at `-0.5, ..., 0.5` including both ends, which differs from the grid of `scipy.signal.windows.taylor` and Octave `taylorwin` (they sample `(n - N/2 + 1/2) / N`): the values differ from scipy by `O(1/N)` (0.45 for `N` = 2, 0.013 for `N` = 64, 0.003 for `N` = 256 for `n` = 4 and level -50).
- `options` (optional map):
- `:level` - design sidelobe level in dB (finite number, `abs` is taken, `abs(level) <= 5000`, default `-50.0`); it is `-sll` of scipy. It is the design parameter, the achieved peak sidelobe level depends on `n` and is higher for a small `n`. Measured (dB, `N` = 2049) for the levels -30, -50, -80, -100: `n` 2: -25.7, -30.3, -33.3, -34.0; `n` 4 (default): -30.4, -44.7, -56.0, -60.6; `n` 6: -30.3, -49.3, -66.9, -75.3; `n` 8: -30.2, -50.2, -72.7, -83.9. A level so small that the middle of the window is not positive (for example `0`, below about 20 dB the ends are higher than the middle) throws.
- `:n` - integer in `[2, 400]`, the number of nearly constant level sidelobes (`nbar` of scipy), default `4`
- `:normalize?` - default `true` (division by the value at the middle); `false` returns the raw samples of the function with the integral `1`; other values: `:LInf`, `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`. The cost of the coefficients is `O(n^2)`. Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?`, `:level` or `:n`.
See also [[dolph-chebyshev]], [[ultraspherical]], [[blackman-harris-family]].(trapezoid)(trapezoid N)(trapezoid N opts)Trapezoid window, flat for abs(x) <= alpha and linear to zero at abs(x) = 0.5.
alpha = 0 is the triangular (Bartlett) window and alpha = 0.5 the rectangular window. It is the convolution of a rectangle and a triangle.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - half width of the flat part, number in [0, 0.5], default 0.25:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also triangular, rectangular, tukey.
Trapezoid window, flat for `abs(x) <= alpha` and linear to zero at `abs(x) = 0.5`.
`alpha = 0` is the triangular (Bartlett) window and `alpha = 0.5` the rectangular window. It is the convolution of a rectangle and a triangle.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - half width of the flat part, number in `[0, 0.5]`, default `0.25`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[triangular]], [[rectangular]], [[tukey]].(triangular)(triangular N)(triangular N opts)Triangular window with a selectable end behaviour.
The continuous triangle 1 - abs(2x) (zero ends, Bartlett) is used for :shift 0; for a positive :shift the window is the discrete formula 1 - abs(n - (N-1)/2) / floor((N - 1 + shift) / 2), n = 0, ..., N-1, whose ends are non-zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:shift - integer >= 0, default 2
0 - the Bartlett window, zero at both ends; it is the continuous triangle sampled at -0.5, ..., 0.5 (equal to scipy.signal.windows.bartlett and to b-spline of order 2)1 - discrete formula with the divisor floor(N / 2)2 (default) - the discrete formula equal to scipy.signal.windows.triang and Octave triang (non-zero ends, 1/N for even N and 2/(N+1) for odd N):normalize? - default true. The discrete paths (:shift > 0) have the peak 1 already, so true and false return the formula as it is (the maximum is 1 for odd N and below 1 for even N); the modes :LInf, :L1, :L2, :N and a finite non-zero number are honoured (see normalize-coefficients). For :shift 0 true divides by the middle value, false returns the raw function with the integral 1 (the peak is 2).Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0). Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
Triangular window with a selectable end behaviour.
The continuous triangle `1 - abs(2x)` (zero ends, Bartlett) is used for `:shift 0`; for a positive `:shift` the window is the discrete formula `1 - abs(n - (N-1)/2) / floor((N - 1 + shift) / 2)`, `n = 0, ..., N-1`, whose ends are non-zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:shift` - integer `>= 0`, default `2`
- `0` - the Bartlett window, zero at both ends; it is the continuous triangle sampled at `-0.5, ..., 0.5` (equal to `scipy.signal.windows.bartlett` and to `b-spline` of order `2`)
- `1` - discrete formula with the divisor `floor(N / 2)`
- `2` (default) - the discrete formula equal to `scipy.signal.windows.triang` and Octave `triang` (non-zero ends, `1/N` for even `N` and `2/(N+1)` for odd `N`)
- larger values widen the base of the triangle (the ends are larger)
- `:normalize?` - default `true`. The discrete paths (`:shift > 0`) have the peak `1` already, so `true` and `false` return the formula as it is (the maximum is `1` for odd `N` and below `1` for even `N`); the modes `:LInf`, `:L1`, `:L2`, `:N` and a finite non-zero number are honoured (see [[normalize-coefficients]]). For `:shift 0` `true` divides by the middle value, `false` returns the raw function with the integral `1` (the peak is `2`).
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`. Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[b-spline]], [[parzen]], [[welch]], [[trapezoid]].(triangular-continuous x)Triangular window, continuous function 2 (1 - 2 abs(x)) on [-0.5, 0.5] (integral 1, zero at the ends).
Triangular window, continuous function `2 (1 - 2 abs(x))` on `[-0.5, 0.5]` (integral `1`, zero at the ends).
(tukey)(tukey N)(tukey N opts)Tukey (tapered cosine) window: a flat middle part with raised cosine tapers at both ends.
alpha is the fraction of the window length which is tapered (alpha / 2 at each end). alpha = 0 is rectangular and alpha = 1 is hann; like scipy.signal.windows.tukey every alpha > 1 gives the Hann window. Equal to scipy tukey and Octave tukeywin for 0 <= alpha <= 1. The raw window has a plateau 2 / (2 - alpha) and the integral 1.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:alpha - number >= 0, default 0.5:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hann, rectangular, trapezoid, raised-cosine.
Tukey (tapered cosine) window: a flat middle part with raised cosine tapers at both ends.
`alpha` is the fraction of the window length which is tapered (`alpha / 2` at each end). `alpha = 0` is rectangular and `alpha = 1` is `hann`; like `scipy.signal.windows.tukey` every `alpha > 1` gives the Hann window. Equal to scipy `tukey` and Octave `tukeywin` for `0 <= alpha <= 1`. The raw window has a plateau `2 / (2 - alpha)` and the integral `1`.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:alpha` - number `>= 0`, default `0.5`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hann]], [[rectangular]], [[trapezoid]], [[raised-cosine]].(ultraspherical)(ultraspherical N)(ultraspherical N opts)Ultraspherical (Gegenbauer) window, a family between the Dolph-Chebyshev (alpha = 0) and the Saramaki (alpha = 1) windows.
The window is the inverse DFT of the Gegenbauer polynomial spectrum C_(N-1)^(alpha)(x0 cos(pi k / N)) (Doerry, catalog). alpha = 0 is dolph-chebyshev, alpha = 1 is saramaki, alpha = 0.5 is the Legendre window (with a different level mapping, see legendre); for alpha > 0 the sidelobes decay away from the main lobe (the Dolph-Chebyshev sidelobes stay at one level), faster for a larger alpha: for the level -50 and N = 513 the sidelobes between 40 and 60 bins are below -100 dB for alpha 2 and below -145 dB for alpha 4.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:level - Doerry's sidelobe parameter mu in dB (finite number, abs is taken, abs(level) <= 5000, default -50.0). It is a design parameter, not the achieved peak sidelobe level. Measured achieved levels (dB, N = 2049, odd and even N agree within 0.1 dB) for the levels -30, -50, -80, -100: alpha 0.5: -30.1, -48.0, -76.1, -95.2; alpha 2 (default): -33.8, -47.0, -70.2, -86.7; alpha 4: -41.1, -50.5, -68.7, -82.6:alpha - number in (-1, 150], default 2.0. Values above 150 overflow for N about 1000 (the limit gets lower for larger N); values close to -1 are slow.:normalize? - default true (:LInf: the coefficients are divided by the largest absolute value, the maximum becomes 1); false returns the raw window (mean 1, sum N); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also dolph-chebyshev, saramaki, legendre, taylor.
Ultraspherical (Gegenbauer) window, a family between the Dolph-Chebyshev (`alpha = 0`) and the Saramaki (`alpha = 1`) windows.
The window is the inverse DFT of the Gegenbauer polynomial spectrum `C_(N-1)^(alpha)(x0 cos(pi k / N))` (Doerry, catalog). `alpha = 0` is `dolph-chebyshev`, `alpha = 1` is `saramaki`, `alpha = 0.5` is the Legendre window (with a different level mapping, see [[legendre]]); for `alpha > 0` the sidelobes decay away from the main lobe (the Dolph-Chebyshev sidelobes stay at one level), faster for a larger `alpha`: for the level -50 and `N` = 513 the sidelobes between 40 and 60 bins are below -100 dB for `alpha` 2 and below -145 dB for `alpha` 4.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:level` - Doerry's sidelobe parameter `mu` in dB (finite number, `abs` is taken, `abs(level) <= 5000`, default `-50.0`). It is a design parameter, not the achieved peak sidelobe level. Measured achieved levels (dB, `N` = 2049, odd and even `N` agree within 0.1 dB) for the levels -30, -50, -80, -100: `alpha` 0.5: -30.1, -48.0, -76.1, -95.2; `alpha` 2 (default): -33.8, -47.0, -70.2, -86.7; `alpha` 4: -41.1, -50.5, -68.7, -82.6
- `:alpha` - number in `(-1, 150]`, default `2.0`. Values above `150` overflow for `N` about `1000` (the limit gets lower for larger `N`); values close to `-1` are slow.
- `:normalize?` - default `true` (`:LInf`: the coefficients are divided by the largest absolute value, the maximum becomes `1`); `false` returns the raw window (mean `1`, sum `N`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[dolph-chebyshev]], [[saramaki]], [[legendre]], [[taylor]].(vorbis)(vorbis N)(vorbis N opts)Vorbis window (Xiph.org) sin(pi/2 sin^2(pi (n + 1/2) / N)), n = 0, ..., N-1: the power complementary window of the Vorbis audio codec.
For even N the window satisfies w[n]^2 + w[n + N/2]^2 = 1 (Princen-Bradley). It is defined on the half-sample grid (it is not a sample of the continuous function vorbis-continuous at -0.5, ..., 0.5); the ends are non-zero.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default false (the values of the formula); true is :LInf (the maximum becomes 1); other values: :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles. N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also kaiser-bessel-derived, cosine, hann.
Vorbis window (Xiph.org) `sin(pi/2 sin^2(pi (n + 1/2) / N))`, `n = 0, ..., N-1`: the power complementary window of the Vorbis audio codec.
For even `N` the window satisfies `w[n]^2 + w[n + N/2]^2 = 1` (Princen-Bradley). It is defined on the half-sample grid (it is not a sample of the continuous function [[vorbis-continuous]] at `-0.5, ..., 0.5`); the ends are non-zero.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `false` (the values of the formula); `true` is `:LInf` (the maximum becomes `1`); other values: `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles. `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[kaiser-bessel-derived]], [[cosine]], [[hann]].(vorbis-continuous x)Vorbis window, continuous function A sin(pi/2 cos^2(pi x)) on [-0.5, 0.5] (integral 1), the sampled continuous model, not the discrete Vorbis window.
Vorbis window, continuous function `A sin(pi/2 cos^2(pi x))` on `[-0.5, 0.5]` (integral `1`), the sampled continuous model, not the discrete Vorbis window.
(vorbis-discrete N)Returns the coefficients of the Vorbis window of N >= 2 samples as a sequence: sin(pi/2 sin^2(pi (n + 1/2) / N)), n = 0, ..., N-1.
Returns the coefficients of the Vorbis window of `N >= 2` samples as a sequence: `sin(pi/2 sin^2(pi (n + 1/2) / N))`, `n = 0, ..., N-1`.
(webster-hamming)(webster-hamming N)(webster-hamming N opts)Webster generalized Hamming window A (alpha(v) cos(pi x)^v + (1 - alpha(v)) cos(pi x)^(v + 2)).
alpha(v) = (v^2 + 3 v + 2) / (v^2 + 9 v + 23) (Doerry, eq. 147). v = 0 is hamming-exact; a larger v gives lower sidelobes (peak sidelobe level -41.7, -53.9, -71.6 and -123.2 dB for v 0, 1, 3 and 10, N = 2049) and a wider main lobe. For v < 0 the window is unbounded at the ends (the end samples are large finite values of the sampled cos(pi/2)).
Parameters:
N - number of samples, an integer >= 0options (optional map):
:v - number in (-0.5, 1000], default 1.0:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also hamming-exact, power-of-cosine, raised-cosine.
Webster generalized Hamming window `A (alpha(v) cos(pi x)^v + (1 - alpha(v)) cos(pi x)^(v + 2))`.
`alpha(v) = (v^2 + 3 v + 2) / (v^2 + 9 v + 23)` (Doerry, eq. 147). `v = 0` is `hamming-exact`; a larger `v` gives lower sidelobes (peak sidelobe level -41.7, -53.9, -71.6 and -123.2 dB for `v` 0, 1, 3 and 10, `N` = 2049) and a wider main lobe. For `v < 0` the window is unbounded at the ends (the end samples are large finite values of the sampled `cos(pi/2)`).
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:v` - number in `(-0.5, 1000]`, default `1.0`
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[hamming-exact]], [[power-of-cosine]], [[raised-cosine]].(welch)(welch N)(welch N opts)Welch (parabolic) window 1.5 (1 - 4 x^2).
The parabola with zero ends, the window shape of the Epanechnikov kernel (fastmath kernels are the standard forms with support [-1, 1], the windows have support [-0.5, 0.5]: welch(x) is the Epanechnikov kernel at 2x, up to scale). It is equal to parzen-algebraic with :gamma 1.0 :u 2.0. The window is also called Riesz or Parzen window of the second order.
Parameters:
N - number of samples, an integer >= 0options (optional map):
:normalize? - default true: the samples are divided by the value of the window function at the middle (the maximum is 1 for odd N, slightly lower for even N); false returns the raw samples of the continuous function, which has the integral 1. Other accepted values: :LInf (alias :Linf, divides by the maximum), :L1, :L2, :N or a finite non-zero number, see normalize-coefficients. nil is the default.Returns a sequence of N doubles: the continuous function sampled at N evenly spaced points from -0.5 to 0.5, both ends included (N = 1 gives the middle point). N = 0 returns () and N = 1 returns (1.0).
Throws ex-info (:type :invalid-input) for an invalid N, :normalize? or parameter.
See also parzen-algebraic, power-of-cosine, hann, triangular.
Welch (parabolic) window `1.5 (1 - 4 x^2)`.
The parabola with zero ends, the window shape of the Epanechnikov kernel (fastmath kernels are the standard forms with support `[-1, 1]`, the windows have support `[-0.5, 0.5]`: `welch(x)` is the Epanechnikov kernel at `2x`, up to scale). It is equal to `parzen-algebraic` with `:gamma 1.0 :u 2.0`. The window is also called Riesz or Parzen window of the second order.
Parameters:
- `N` - number of samples, an integer `>= 0`
- `options` (optional map):
- `:normalize?` - default `true`: the samples are divided by the value of the window function at the middle (the maximum is `1` for odd `N`, slightly lower for even `N`); `false` returns the raw samples of the continuous function, which has the integral `1`. Other accepted values: `:LInf` (alias `:Linf`, divides by the maximum), `:L1`, `:L2`, `:N` or a finite non-zero number, see [[normalize-coefficients]]. `nil` is the default.
Returns a sequence of `N` doubles: the continuous function sampled at `N` evenly spaced points from `-0.5` to `0.5`, both ends included (`N = 1` gives the middle point). `N = 0` returns `()` and `N = 1` returns `(1.0)`.
Throws `ex-info` (`:type :invalid-input`) for an invalid `N`, `:normalize?` or parameter.
See also [[parzen-algebraic]], [[power-of-cosine]], [[hann]], [[triangular]].(welch-continuous x)Welch window, continuous function 1.5 (1 - 4 x^2) on [-0.5, 0.5] (integral 1, zero ends).
Welch window, continuous function `1.5 (1 - 4 x^2)` on `[-0.5, 0.5]` (integral `1`, zero ends).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |