Signal Processing (103)

parallelFFT, parallelIFFT, parallelConv, and related parallel* helpers may return a Promise, but FFT/conv op thresholds in ComputePool are 'never' today — they run the sequential radix-2 / FFT convolution core inline unless a future threshold retune enables workers. Optional WebGPU FFT (enableGpu(), power-of-two n ≥ 262 144) is separate from the worker pool.

autoCorrelation
Sync sliding dot products (not the async parallel* conv path)
Syntax
autoCorrelation(a)
bandpassFilter
Band-pass filter (JS)
Syntax
bandpassFilter(x, f1, f2)
bartlettPSD
Bartlett non-overlapped segment-averaging PSD (Welch with overlap 0, rectangular window) → { psd, frequencies, frameLength } (JS)
Syntax
bartlettPSD(x[, opts])
bilinear
Analog → digital bilinear (Tustin) transform of a transfer function (s = 2·fs·(z−1)/(z+1), no pre-warping) — scipy.signal.bilinear(b, a, fs)
Syntax
bilinear(b, a, fs)
blackmanHarrisWindow
Cosine-sum windows with the scipy coefficients (4-term Blackman–Harris, 4-term Nuttall, 5-term flat-top)
Syntax
blackmanHarrisWindow(n[, { sym }])
Typesnumber
bohmanWindow
Bohman, Parzen (4th-order B-spline) and half-sine windows
Syntax
bohmanWindow(n[, { sym }])
Typesnumber
butter
Butterworth IIR design; returns { b, a } transfer-function coefficients. N = order, Wn = cutoff (scalar) or [low, high] band edges normalized to Nyquist (0 < Wn < 1), btype = 'low' (default, unchanged 2-arg call) | 'high' | 'bandpass' | 'bandstop' — scipy.signal.butter(N, Wn, btype)
Syntax
butter(N, Wn[, btype])
buttord
Minimum Butterworth order + natural frequency meeting a passband/stopband spec → { N, Wn } — scalar wp/ws for lowpass/highpass (scalar Wn), or [lo, hi] pairs for bandpass/bandstop ([lo, hi] Wn; bandstop uses scipy's fminbound passband-edge optimizer). Order exact, Wn ~1e-8 vs scipy.signal.buttord
Syntax
buttord(wp, ws, gpass, gstop)
cheby1
Chebyshev Type I IIR design — equiripple passband (rp dB ripple); same Wn/btype convention as butter — scipy.signal.cheby1(N, rp, Wn, btype)
Syntax
cheby1(N, rp, Wn[, btype])
cheby2
Chebyshev Type II IIR design — equiripple stopband (rs dB attenuation), monotone passband — scipy.signal.cheby2(N, rs, Wn, btype)
Syntax
cheby2(N, rs, Wn[, btype])
chirp
Swept cosine from f0 Hz at t = 0 to f1 Hz at t = t1; method 'linear' (default), 'quadratic', 'logarithmic', 'hyperbolic'; phi phase offset in radians
Syntax
chirp(t, f0, t1, f1[, { method, phi }])
Typesnumber[]
chirpZTransform
Chirp-Z (Bluestein) transform: m z-transform points along a chirp contour (phiStart/phiStep in turns; default phiStep = -1/n) → { re, im } (JS)
Syntax
chirpZTransform(x, m[, phiStart[, phiStep]])
coherence
Magnitude-squared coherence |Pxy|² / (Pxx·Pyy) per Welch frequency bin (values in [0, 1]) → { frequencies, coherence } — scipy.signal.coherence
Syntax
coherence(x, y[, opts])
cont2discrete
Discretize { A, B, C, D }; method 'zoh' (default), 'bilinear' or 'euler'
Syntax
cont2discrete(sys, dt[, method])
Typesnumber[][]
conv2
2-D convolution, mode 'full' (default), 'same' or 'valid'
Syntax
conv2(image, kernel[, mode])
Typesnumber[][]
convolve
Convolution / correlation
Syntax
convolve(a, b)
correlate
Convolution / correlation
Syntax
correlate(a, b)
cosineWindow
Bohman, Parzen (4th-order B-spline) and half-sine windows
Syntax
cosineWindow(n[, { sym }])
Typesnumber
crossCorrelation
Sync sliding dot products (not the async parallel* conv path)
Syntax
crossCorrelation(a, b)
csd
Cross-spectral density of x/y via Welch averaging (segment, window, FFT, average X·conj(Y)); opts = { nperseg, noverlap, window, fs } → { frequencies, power } — scipy.signal.csd
Syntax
csd(x, y[, opts])
cwt
Continuous wavelet transform (Ricker/Morlet)
Syntax
cwt(x, scales[, wavelet])
dct
Discrete cosine transform / inverse (JS loops)
Syntax
dct(x)
decimate
Anti-aliased downsampling by integer factor q (Butterworth lowpass + filtfilt, then every q-th sample) — scipy.signal.decimate
Syntax
decimate(x, q)
deconvolve
FIR/polynomial deconvolution via synthetic long division: signal = conv(divisor, quotient) + remainder, quotient length signal.length − divisor.length + 1 — scipy.signal.deconvolve; pinned bit-for-bit including the non-exact-division remainder case
Syntax
deconvolve(signal, divisor)
dst
Discrete sine transform / inverse (JS loops)
Syntax
dst(x)
dtw
Dynamic time warping: { distance, path } with the path of [i, j] pairs from [0, 0] to the last pair; window is a Sakoe–Chiba half-width, dist the local cost (default |x − y|)
Syntax
dtw(a, b[, { window, dist }])
Typesnumber[]
dwt
Discrete wavelet transform (haar/db1-4/sym2-4/coif1-2)
Syntax
dwt(x[, wavelet])
ellip
Elliptic (Cauer) IIR design — equiripple in both bands, steepest roll-off for a given order; full nome-based closed-form port (not an approximation) — scipy.signal.ellip(N, rp, rs, Wn, btype)
Syntax
ellip(N, rp, rs, Wn[, btype])
exponentialWindow
Two-sided exponential exp(−|i − center|/tau) centred on (n−1)/2
Syntax
exponentialWindow(n, tau[, { sym }])
Typesnumber
fft
Discrete Fourier transform / inverse (factory layer)
Syntax
fft(x)
fft2d
2D FFT (synchronous; for worker threads use computePool.fftBatch)
Syntax
fft2d(matrix)
fftfreq
DFT sample frequencies for a length-n fft, sample spacing d (default 1) — numpy.fft.fftfreq
Syntax
fftfreq(n[, d])
fftn
2-D FFT: FFT each row, then FFT each column → { re, im } — numpy.fft.fft2
Syntax
fftn(x)
fftshift
Roll the zero-frequency component to the center of the spectrum (roll by floor(n/2)) — numpy.fft.fftshift
Syntax
fftshift(x)
filtfilt
Zero-phase forward–backward filtering with odd-reflection padding (default padlen 3·max(len a, len b)); no phase distortion — scipy.signal.filtfilt
Syntax
filtfilt(b, a, x)
findPeaks
Strict local-maxima peak indices (x[i-1] < x[i] > x[i+1]), optionally filtered by opts.height (min value), opts.distance (min index separation, greedily keeps the taller peak), and/or opts.prominence (min topographic prominence) — scipy.signal.find_peaks
Syntax
findPeaks(x[, opts])
firls
Least-squares linear-phase FIR design: bands is a flat [lo, hi, lo, hi, …] list of band-edge pairs (Nyquist-normalized) with desired the response at those edges (linearly interpolated within each band; gaps between bands are unconstrained transition regions) — scipy.signal.firls. A genuine (non-approximate) least-squares fit — dense trapezoid-quadrature sampling of the bands plus a cosine-basis normal-equations solve — not bit-pinned against scipy's exact closed-form integrals
Syntax
firls(numtaps, bands, desired)
firwin
FIR lowpass tap design by the windowed-sinc method (Hamming window, unit DC gain); cutoff normalized to Nyquist (1 = Nyquist) — scipy.signal.firwin(numtaps, cutoff) with the default window
Syntax
firwin(numtaps, cutoff)
firwinBandpass
FIR bandpass tap design by the windowed-sinc method (Hamming window): h[n] = (f2·sinc(f2·(n−M/2)) − f1·sinc(f1·(n−M/2)))·hamming[n], cutoffs normalized to Nyquist — the array-cutoff case firwin didn't support (resolves the Phase-0 note)
Syntax
firwinBandpass(numtaps, [f1, f2])
flattopWindow
Cosine-sum windows with the scipy coefficients (4-term Blackman–Harris, 4-term Nuttall, 5-term flat-top)
Syntax
flattopWindow(n[, { sym }])
Typesnumber
fourier
Continuous Fourier transform
Syntax
fourier(f)
freqz
Digital filter frequency response (factory layer)
Syntax
freqz(b, a)
gaussianWindow
Gaussian window with standard deviation std samples
Syntax
gaussianWindow(n, std[, { sym }])
Typesnumber
gaussPulse
Gaussian-modulated cosine pulse at centre frequency fc Hz, fractional bandwidth bw (0.5) at reference level bwr dB (−6)
Syntax
gaussPulse(t, fc[, bw, bwr])
Typesnumber[]
getWindow
Window by name: the ten above plus hamming, hann, blackman, bartlett, rectangular; param is beta / std / alpha / tau; the classic five delegate to windowFunction and are always symmetric
Syntax
getWindow(name, n[, param])
Typesstring, number
goertzel
Goertzel algorithm: power |X[k]|² at a single target frequency (Hz) (JS)
Syntax
goertzel(x, targetFreq, sampleRate)
groupDelay
Filter group delay
Syntax
groupDelay(b, a, w)
highpassFilter
High-pass filter (JS)
Syntax
highpassFilter(x, fc)
hilbertTransform
Hilbert transform (JS)
Syntax
hilbertTransform(x)
idct
Discrete cosine transform / inverse (JS loops)
Syntax
idct(X)
idst
Discrete sine transform / inverse (JS loops)
Syntax
idst(X)
idwt
Inverse discrete wavelet transform (haar/db1-4/sym2-4/coif1-2)
Syntax
idwt(cA, cD[, wavelet])
ifft
Discrete Fourier transform / inverse (factory layer)
Syntax
ifft(X)
ifftshift
Inverse of fftshift (roll by ceil(n/2)) — numpy.fft.ifftshift
Syntax
ifftshift(x)
iirNotch
Second-order notch / peak filter { b, a }; w0 is normalized frequency in (0, 1) (× π rad/sample), Q = w0 / bandwidth with −3 dB bandwidth w0·π/Q (scipy convention)
Syntax
iirNotch(w0, Q)
Typesnumber
iirPeak
Second-order notch / peak filter { b, a }; w0 is normalized frequency in (0, 1) (× π rad/sample), Q = w0 / bandwidth with −3 dB bandwidth w0·π/Q (scipy convention)
Syntax
iirPeak(w0, Q)
Typesnumber
impulseResponse
First n samples of the impulse / step response of the digital filter b/a
Syntax
impulseResponse(b, a, n)
Typesnumber[]
invFourier
Continuous Fourier transform
Syntax
invFourier(F)
irfft
Inverse real FFT: rebuilds the conjugate-symmetric length-n spectrum from rfft's half-spectrum, inverse-FFTs, and returns the real parts — numpy.fft.irfft
Syntax
irfft(spec, n)
istft
Inverse STFT via overlap-add, normalized by the running sum of squared window values (COLA); nperseg defaults to the frame width of S — scipy.signal.istft
Syntax
istft(S[, opts])
kaiserWindow
Kaiser window (beta = 0 is rectangular)
Syntax
kaiserWindow(n, beta[, { sym }])
Typesnumber
lfilter
Apply an IIR/FIR filter (numerator b, denominator a) to x via direct-form II transposed; a[0] normalizes — scipy.signal.lfilter
Syntax
lfilter(b, a, x)
lfilterZi
Steady-state initial conditions for lfilter so a constant input is unchanged at the boundary — scipy.signal.lfilter_zi
Syntax
lfilterZi(b, a)
lombScargle
Lomb–Scargle periodogram of unevenly sampled data at angular frequencies freqs (rad per time unit, with the Scargle τ phase offset); opts.normalize scales a unit sinusoid to ≈ 1, opts.precenter removes the mean
Syntax
lombScargle(t, y, freqs[, opts])
Typesnumber[]
lowpassFilter
Low-pass filter (JS)
Syntax
lowpassFilter(x, fc)
medfilt
Median filter
Syntax
medfilt(x[, window])
multiTaperPSD
Thomson multi-taper PSD; averages K Slepian-tapered periodograms to cut leakage; opts = { nfft, K } (default K=5) → { psd, frequencies } (JS)
Syntax
multiTaperPSD(x[, opts])
nuttallWindow
Cosine-sum windows with the scipy coefficients (4-term Blackman–Harris, 4-term Nuttall, 5-term flat-top)
Syntax
nuttallWindow(n[, { sym }])
Typesnumber
parallelAutoCorr
Auto-correlation → Promise<Float64Array>
Syntax
parallelAutoCorr(a)
Accelparallel†
parallelConv
Convolution → Promise<Float64Array>
Syntax
parallelConv(a, b)
Accelparallel†
parallelFFTMagnitude
FFT magnitude spectrum
Syntax
parallelFFTMagnitude(x)
Accelparallel†
parallelFFTPower
FFT power spectrum
Syntax
parallelFFTPower(x)
Accelparallel†
parallelXCorr
Cross-correlation → Promise<Float64Array>
Syntax
parallelXCorr(a, b)
Accelparallel†
parzenWindow
Bohman, Parzen (4th-order B-spline) and half-sine windows
Syntax
parzenWindow(n[, { sym }])
Typesnumber
peakWidths
Width (in samples) of each peak at relHeight down from the peak toward its topographic base, with linearly-interpolated crossing points — scipy.signal.peak_widths
Syntax
peakWidths(x, peaks[, relHeight=0.5])
periodogram
Power spectral density estimate (JS)
Syntax
periodogram(x)
remez
Optimal equiripple FIR design via the exact Parks-McClellan / Remez exchange (faithful port of the McClellan-Parks-Rabiner program that scipy.signal.remez wraps). scipy convention (distinct from firls): band edges normalized to [0, 0.5] (fs = 1, 0.5 = Nyquist); desired/weight are one value per band (bands.length / 2); type is 'bandpass' (default, symmetric), 'differentiator', or 'hilbert' (antisymmetric). Taps match scipy.signal.remez to machine precision
Syntax
remez(numtaps, bands, desired[, weight, type])
resample
Signal resampling
Syntax
resample(x, ratio)
rfft
Real FFT: full fft(x) truncated to the non-redundant first floor(n/2)+1 bins → { re, im } — numpy.fft.rfft
Syntax
rfft(x)
rfftfreq
DFT sample frequencies for an rfft output (0..floor(n/2)) — numpy.fft.rfftfreq
Syntax
rfftfreq(n[, d])
savgol
Savitzky-Golay smoothing: fits a degree-polyorder polynomial (normal equations over a Vandermonde of window offsets) to each windowLength-point window and takes the center value; edges reuse the nearest boundary window's fit evaluated at the edge point's offset (scipy's mode='interp') — exact on polynomials of degree <= polyorder; pinned bit-for-bit against scipy.signal.savgol_filter
Syntax
savgol(x, windowLength, polyorder)
sawtooth
Sawtooth/triangle of period 2π (scipy): −1 at 0 rising to +1 at width·2π (default 1)
Syntax
sawtooth(t[, width])
Typesnumber[]
sinc
Normalized sinc sin(πx)/(πx) with sinc(0) = 1
Syntax
sinc(x)
Typesnumber
sos2tf
Cascade of second-order sections (rows [b0, b1, b2, a0, a1, a2]) to one { b, a }; not normalized by a0
Syntax
sos2tf(sos)
Typesnumber[][]
sosfilt
Apply a cascade of second-order sections (from zpk2sos) to x, each biquad in direct-form-II transposed — scipy.signal.sosfilt
Syntax
sosfilt(sos, x)
spectrogram
Magnitude spectrogram; each frame is zero-padded to the next power of two (bin i at i / nfft); default windowSize 256 clamped to the signal length
Syntax
spectrogram(x[, opts])
squareWave
Square wave of period 2π: +1 while frac(t/2π) < duty (default 0.5), else −1
Syntax
squareWave(t[, duty])
Typesnumber[]
ss2tf
Transfer function to controllable-canonical state space { A, B, C, D } (scipy), and SISO state space back to { num, den }
Syntax
ss2tf(A, B, C, D)
Typesnumber[], number[][]
stepResponse
First n samples of the impulse / step response of the digital filter b/a
Syntax
stepResponse(b, a, n)
Typesnumber[]
stft
Short-time Fourier transform (windowed overlapping frames → one exact nperseg-point DFT per frame, nperseg bins per row; default nperseg 256 clamped to the signal length) — scipy.signal.stft
Syntax
stft(x[, opts])
sweepPoly
Cosine whose instantaneous frequency is a polynomial in t; polyCoeffs highest order first (numpy poly1d), Hz
Syntax
sweepPoly(t, polyCoeffs[, phi])
Typesnumber[]
tf2ss
Transfer function to controllable-canonical state space { A, B, C, D } (scipy), and SISO state space back to { num, den }
Syntax
tf2ss(b, a)
Typesnumber[], number[][]
tf2zpk
Zeros, poles and gain { z, p, k }, roots sorted by real then imaginary part
Syntax
tf2zpk(b, a)
Typesnumber[]
tukeyWindow
Tapered-cosine window; alpha = 0 rectangular, alpha = 1 Hann (default 0.5)
Syntax
tukeyWindow(n[, alpha, { sym }])
Typesnumber
unitImpulse
Length-n impulse at idx (default 0, or 'mid')
Syntax
unitImpulse(n[, idx])
Typesnumber
unwrapPhase
Remove 2π phase discontinuities
Syntax
unwrapPhase(phase)
wavedec
Multilevel discrete wavelet decomposition (haar/db1-4/sym2-4/coif1-2)
Syntax
wavedec(x[, wavelet, level])
waverec
Multilevel inverse discrete wavelet transform (haar/db1-4/sym2-4/coif1-2)
Syntax
waverec(coeffs[, wavelet])
welchPSD
Welch overlapped-segment-averaging PSD; opts = { frameLength, overlap, window } (defaults 256 clamped to the signal length, frameLength/2, 'hann'; a frame that is not a power of two uses an exact-length DFT) → { psd, frequencies, frameLength } (JS; WASM refused by policy)
Syntax
welchPSD(x[, opts])
wiener
Wiener adaptive filter: local mean m/variance v over a mysize-window (same-length, zero-padded edges), noise = mean(v); output m + max(0, v−noise)/max(v, noise)·(x−m)
Syntax
wiener(x[, mysize])
windowFunction
Window functions (Hamming, Hann, …)
Syntax
windowFunction(n, type)
zpk2sos
Group zeros/poles/gain into cascaded second-order sections [[b0,b1,b2,a0,a1,a2], …] — scipy.signal.zpk2sos
Syntax
zpk2sos(z, p, k)
zpk2tf
Zero-pole-gain → transfer function (factory layer)
Syntax
zpk2tf(z, p, k)